aboutsummaryrefslogtreecommitdiff
path: root/www/midori
diff options
context:
space:
mode:
authorRene Ladan <rene@FreeBSD.org>2012-03-26 21:11:55 +0000
committerRene Ladan <rene@FreeBSD.org>2012-03-26 21:11:55 +0000
commitd69a2379f2c92f18d7ef6ef3f3a846e3cbe68066 (patch)
tree0d93c35bdf25e7304e6cb86e1b342659789d73ad /www/midori
parentb53124fb35f0b630ed83153a3d1a4bf3751a40fa (diff)
downloadports-d69a2379f2c92f18d7ef6ef3f3a846e3cbe68066.tar.gz
ports-d69a2379f2c92f18d7ef6ef3f3a846e3cbe68066.zip
Notes
Diffstat (limited to 'www/midori')
-rw-r--r--www/midori/Makefile1
-rw-r--r--www/midori/files/patch-midori_midori-websettings.c50
2 files changed, 51 insertions, 0 deletions
diff --git a/www/midori/Makefile b/www/midori/Makefile
index 900e812af31b..e255491bcca4 100644
--- a/www/midori/Makefile
+++ b/www/midori/Makefile
@@ -8,6 +8,7 @@
PORTNAME= midori
PORTVERSION= 0.4.4
+PORTREVISION= 1
CATEGORIES= www xfce
MASTER_SITES= ${MASTER_SITE_XFCE}
MASTER_SITE_SUBDIR= src/apps/${PORTNAME}/${PORTVERSION:R}
diff --git a/www/midori/files/patch-midori_midori-websettings.c b/www/midori/files/patch-midori_midori-websettings.c
new file mode 100644
index 000000000000..929ef643251a
--- /dev/null
+++ b/www/midori/files/patch-midori_midori-websettings.c
@@ -0,0 +1,50 @@
+--- midori/midori-websettings.c.orig 2012-03-08 23:34:45.000000000 +0100
++++ midori/midori-websettings.c 2012-03-23 15:48:54.000000000 +0100
+@@ -27,6 +27,11 @@
+ #include <sys/utsname.h>
+ #endif
+
++#if defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
++
+ struct _MidoriWebSettings
+ {
+ WebKitWebSettings parent_instance;
+@@ -347,16 +352,26 @@
+ static gboolean
+ midori_web_settings_low_memory_profile ()
+ {
+- gchar* contents;
+- const gchar* total;
+- if (!g_file_get_contents ("/proc/meminfo", &contents, NULL, NULL))
+- return FALSE;
+- if (contents && (total = strstr (contents, "MemTotal:")) && *total)
+- {
+- const gchar* value = katze_skip_whitespace (total + 9);
+- gdouble mem_total = g_ascii_strtoll (value, NULL, 0);
+- return mem_total / 1024.0 < 352 + 1;
+- }
++ #ifdef __FreeBSD__
++ size_t size;
++ int mem_total;
++ size = sizeof mem_total;
++
++ sysctlbyname("hw.realmem", &mem_total, &size, NULL, 0);
++
++ return mem_total / 1048576 < 352;
++ #else
++ gchar* contents;
++ const gchar* total;
++ if (!g_file_get_contents ("/proc/meminfo", &contents, NULL, NULL))
++ return FALSE;
++ if (contents && (total = strstr (contents, "MemTotal:")) && *total)
++ {
++ const gchar* value = katze_skip_whitespace (total + 9);
++ gdouble mem_total = g_ascii_strtoll (value, NULL, 0);
++ return mem_total / 1024.0 < 352 + 1;
++ }
++ #endif
+ return FALSE;
+ }