pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/webkit-gtk webkit-gtk: Add support to build with -...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cbf7e4c46092
branches:  trunk
changeset: 314347:cbf7e4c46092
user:      leot <leot%pkgsrc.org@localhost>
date:      Thu Oct 25 09:58:18 2018 +0000

description:
webkit-gtk: Add support to build with -DUSE_SYSTEM_MALLOC=ON on NetBSD

On NetBSD there is no <sys/sysinfo.h> but we can use hw.usermem64.

This should address WebKitGTK+ support for NetBSD ports where
USE_SYSTEM_MALLOC is by default OFF.

Side-note: on NetBSD/amd64 -current when building with -DUSE_SYSTEM_MALLOC=ON
both SunSpider and JetStream benchmarks shows a very little performance penalty,
so also remove the `-DUSE_SYSTEM_MALLOC=ON' commented out CMAKE_ARGS (i.e. when
possible just use the preferred malloc).

diffstat:

 www/webkit-gtk/Makefile                                 |   3 +-
 www/webkit-gtk/distinfo                                 |   3 +-
 www/webkit-gtk/patches/patch-Source_WTF_wtf_RAMSize.cpp |  51 +++++++++++++++++
 3 files changed, 54 insertions(+), 3 deletions(-)

diffs (89 lines):

diff -r 58fee9ab6185 -r cbf7e4c46092 www/webkit-gtk/Makefile
--- a/www/webkit-gtk/Makefile   Thu Oct 25 09:51:19 2018 +0000
+++ b/www/webkit-gtk/Makefile   Thu Oct 25 09:58:18 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.145 2018/10/24 18:31:07 leot Exp $
+# $NetBSD: Makefile,v 1.146 2018/10/25 09:58:18 leot Exp $
 
 DISTNAME=      webkitgtk-2.22.2
 PKGNAME=       ${DISTNAME:S/webkitgtk/webkit-gtk/}
@@ -37,7 +37,6 @@
 CMAKE_ARGS+=           -DENABLE_GEOLOCATION=OFF
 CMAKE_ARGS+=           -DUSE_GSTREAMER_GL=OFF
 CMAKE_ARGS+=           -DUSE_LIBHYPHEN=OFF
-#CMAKE_ARGS+=          -DUSE_SYSTEM_MALLOC=ON # XXX: needs adjustements for sysinfo() stuffs in Source/WTF/wtf/RAMSize.cpp
 
 REPLACE_PERL+= Source/JavaScriptCore/create_hash_table
 REPLACE_PERL+= Source/WebCore/bindings/scripts/*.pl
diff -r 58fee9ab6185 -r cbf7e4c46092 www/webkit-gtk/distinfo
--- a/www/webkit-gtk/distinfo   Thu Oct 25 09:51:19 2018 +0000
+++ b/www/webkit-gtk/distinfo   Thu Oct 25 09:58:18 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.107 2018/10/24 18:31:07 leot Exp $
+$NetBSD: distinfo,v 1.108 2018/10/25 09:58:18 leot Exp $
 
 SHA1 (webkitgtk-2.22.2.tar.xz) = ff0c40e81e240aa0743f7e6483f175defebd1417
 RMD160 (webkitgtk-2.22.2.tar.xz) = f8f16a72800debdf9b74a03151299f16f69fcc1c
@@ -12,6 +12,7 @@
 SHA1 (patch-Source_JavaScriptCore_runtime_MachineContext.h) = 23bc86a389f8009ec829c3ee0fe3effe3f20b012
 SHA1 (patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h) = f1eee7f9d3012edee1915234c837cff820f97092
 SHA1 (patch-Source_WTF_wtf_Platform.h) = 5cf36cf7cca8a39d75a788ca988758927b421d95
+SHA1 (patch-Source_WTF_wtf_RAMSize.cpp) = aa36df14e9715a47a386c37082a540390e30efa4
 SHA1 (patch-Source_WTF_wtf_StackBounds.cpp) = 22a71daac8443f079ad8bcc7285cfd7319c972b3
 SHA1 (patch-Source_WebCore_inspector_InspectorFrontendHost.cpp) = daf6351a1a0b5a49592a2bb6db0d54620c7b09e3
 SHA1 (patch-Source_WebCore_platform_FileSystem.cpp) = adef1a42c4e210f0a3dcb82807e2d2039684a0ec
diff -r 58fee9ab6185 -r cbf7e4c46092 www/webkit-gtk/patches/patch-Source_WTF_wtf_RAMSize.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/webkit-gtk/patches/patch-Source_WTF_wtf_RAMSize.cpp   Thu Oct 25 09:58:18 2018 +0000
@@ -0,0 +1,51 @@
+$NetBSD: patch-Source_WTF_wtf_RAMSize.cpp,v 1.1 2018/10/25 09:58:18 leot Exp $
+
+Add support for NetBSD.
+
+--- Source/WTF/wtf/RAMSize.cpp.orig    2017-08-03 11:00:07.000000000 +0000
++++ Source/WTF/wtf/RAMSize.cpp
+@@ -32,7 +32,9 @@
+ #if OS(WINDOWS)
+ #include <windows.h>
+ #elif defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC
+-#if OS(UNIX)
++#if OS(NETBSD)
++#include <sys/sysctl.h>
++#elif OS(UNIX)
+ #include <sys/sysinfo.h>
+ #endif // OS(UNIX)
+ #else
+@@ -41,7 +43,7 @@
+ 
+ namespace WTF {
+ 
+-#if OS(WINDOWS)
++#if OS(WINDOWS) || (OS(NETBSD) && defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC)
+ static const size_t ramSizeGuess = 512 * MB;
+ #endif
+ 
+@@ -55,13 +57,22 @@ static size_t computeRAMSize()
+         return ramSizeGuess;
+     return status.ullTotalPhys;
+ #elif defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC
+-#if OS(UNIX)
++#if OS(NETBSD)
++    int mib[2];
++    size_t len, totalram;
++    mib[0] = CTL_HW;
++    mib[1] = HW_USERMEM64;
++    len = sizeof(totalram);
++    if (sysctl(mib, 2, &totalram, &len, NULL, 0))
++        return ramSizeGuess;
++    return totalram;
++#elif OS(UNIX)
+     struct sysinfo si;
+     sysinfo(&si);
+     return si.totalram * si.mem_unit;
+ #else
+ #error "Missing a platform specific way of determining the available RAM"
+-#endif // OS(UNIX)
++#endif // USE_SYSTEM_MALLOC
+ #else
+     return bmalloc::api::availableMemory();
+ #endif



Home | Main Index | Thread Index | Old Index