diff options
author | leot <leot@pkgsrc.org> | 2018-10-25 09:58:18 +0000 |
---|---|---|
committer | leot <leot@pkgsrc.org> | 2018-10-25 09:58:18 +0000 |
commit | 66190bc632023dfbeb6138ab627918028c76c287 (patch) | |
tree | acf18a4ebf7fb3e6e1d33f318f73565213799707 /www | |
parent | 94c0cc2368213b9604015951ab188889af83d1ef (diff) | |
download | pkgsrc-66190bc632023dfbeb6138ab627918028c76c287.tar.gz |
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 (limited to 'www')
-rw-r--r-- | www/webkit-gtk/Makefile | 3 | ||||
-rw-r--r-- | www/webkit-gtk/distinfo | 3 | ||||
-rw-r--r-- | www/webkit-gtk/patches/patch-Source_WTF_wtf_RAMSize.cpp | 51 |
3 files changed, 54 insertions, 3 deletions
diff --git a/www/webkit-gtk/Makefile b/www/webkit-gtk/Makefile index 9a674cbae48..c620cd16b05 100644 --- a/www/webkit-gtk/Makefile +++ b/www/webkit-gtk/Makefile @@ -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_MINIBROWSER=ON 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 --git a/www/webkit-gtk/distinfo b/www/webkit-gtk/distinfo index d5df7c0b4f7..435b6daecfd 100644 --- a/www/webkit-gtk/distinfo +++ b/www/webkit-gtk/distinfo @@ -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_jit_ExecutableAllocator.cpp) = 36d29a5db03c241 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 --git a/www/webkit-gtk/patches/patch-Source_WTF_wtf_RAMSize.cpp b/www/webkit-gtk/patches/patch-Source_WTF_wtf_RAMSize.cpp new file mode 100644 index 00000000000..9c3ca1936ce --- /dev/null +++ b/www/webkit-gtk/patches/patch-Source_WTF_wtf_RAMSize.cpp @@ -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 |