Date: Mon, 26 Mar 2012 17:01:18 GMT From: Olivier Duchateau <duchateau.olivier@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/166422: [PATCH] www/midori Message-ID: <201203261701.q2QH1Ixd008157@red.freebsd.org> Resent-Message-ID: <201203261710.q2QHABvL058023@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 166422 >Category: ports >Synopsis: [PATCH] www/midori >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Mar 26 17:10:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Olivier Duchateau >Release: FreeBSD 8.2-RELEASE-p3 i386 >Organization: >Environment: >Description: Implement "low profile", when RAM is lower than 352 MB. Patch was approuved [1] by main developper. [1] http://git.xfce.org/apps/midori/commit/?id=7789bafc68c91c265cbc40f0561a510a7c6cd6de >How-To-Repeat: >Fix: Patch attached with submission follows: diff -urN /usr/ports/www/midori/Makefile midori/Makefile --- /usr/ports/www/midori/Makefile 2012-03-10 11:39:32.000000000 +0100 +++ midori/Makefile 2012-03-23 16:01:01.000000000 +0100 @@ -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 -urN /usr/ports/www/midori/files/patch-midori_midori-websettings.c midori/files/patch-midori_midori-websettings.c --- /usr/ports/www/midori/files/patch-midori_midori-websettings.c 1970-01-01 01:00:00.000000000 +0100 +++ midori/files/patch-midori_midori-websettings.c 2012-03-23 16:01:01.000000000 +0100 @@ -0,0 +1,51 @@ +--- 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; + } + >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203261701.q2QH1Ixd008157>