]> Cypherpunks repositories - bass.git/commitdiff
WebKitGTK skel
authorSergey Matveev <stargrave@stargrave.org>
Fri, 21 Jun 2024 16:19:55 +0000 (19:19 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 22 Jun 2024 18:50:52 +0000 (21:50 +0300)
build/distfiles/.gitignore
build/distfiles/webkitgtk-2.34.6.tar.xz.meta4 [new file with mode: 0644]
build/skel/www/webkitgtk-2.34.6-fbsd.patch [new file with mode: 0644]
build/skel/www/webkitgtk-2.34.6.do [new file with mode: 0644]

index 3904cfc4b7e627cba706d45c58c488afc2bf1167f8dcaf99a2085794943044f7..1f92bfd1d173247886ebdcdfd49f180d27faf005f6242678c31611831595a661 100644 (file)
 /vim.git/
 /vorbis-tools-1.4.2.tar.gz
 /wavpack-5.7.0.tar.xz
+/webkitgtk-2.34.6.tar.xz
 /wireshark-4.2.5.tar.xz
 /x264-2024-05-12.tar.zst
 /x264.git/
diff --git a/build/distfiles/webkitgtk-2.34.6.tar.xz.meta4 b/build/distfiles/webkitgtk-2.34.6.tar.xz.meta4
new file mode 100644 (file)
index 0000000..454b16c
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metalink xmlns="urn:ietf:params:xml:ns:metalink">
+  <file name="webkitgtk-2.34.6.tar.xz">
+    <hash type="blake3-256">d209b77e94d8f55735aa35ce6d2a6212f038003b717d3f680bbdaab2049e1371</hash>
+    <hash type="blake2b-512">7ab93a81f6c74ff712ddb057cbba758978b978323098071e9e35e3aa8efab4c747b8375e10a302185a82b0e89d822c89d199d2d4092c4acd9a423c1f6696c2ab</hash>
+    <hash type="blake2b-256">60e4210e4a65b8fecf1fba1622c10cf35b4bc0fdfc3a9893c749942914552f4f</hash>
+    <hash type="skein-512">9332855acae22460f29ed020d1c836572b52eb6e863bcd7b065c1bc6893bff4fc900acf6f096558080f3fe0fbf6b29634d65e7d737a12efa335603a1c3c27709</hash>
+    <hash type="shake128">f275c601c86e858a2204f6b271ef586548b59bef1612090510fae7e3fe575d1a</hash>
+    <hash type="shake256">3ffd1d438311582fc4dc53fb82a630189a2046f0365f2619a2dc5d009808319e27033e94b69ccd62c7e632ea9723f4e0e66ff56167d4624925e95b8708d460c3</hash>
+    <hash type="sha-512">57ab25af027ae39820622743c258f3e6d0af86376f2a4c3a8ede560ca6652c98c49056c716aace56291264c18164cb60395be9779a9d12455e6a0f7d2c197343</hash>
+    <hash type="sha-256">6bc8fd034aad0432a2459ce4fc7ee25ad65a4924c618bf8d93b52b0c1a84c1f6</hash>
+    <hash type="streebog-512">40427daaedea768f57a53976a3c42182663c209f762d8fba4132b385eb8b7682bcd88d1c63e7453aef2fd6ea3470c787553662bee022d273071a8548a9f2ab86</hash>
+    <hash type="streebog-256">04032cce85d4200ef11e1f6190263d229a2f638fe102531f587ed2bf2f6bed2f</hash>
+    <hash type="xxh3-128">add4fd5f195145540ec36d8a2de4ec33</hash>
+    <size>24393340</size>
+    <url>https://webkitgtk.org/releases/webkitgtk-2.34.6.tar.xz</url>
+  </file>
+</metalink>
diff --git a/build/skel/www/webkitgtk-2.34.6-fbsd.patch b/build/skel/www/webkitgtk-2.34.6-fbsd.patch
new file mode 100644 (file)
index 0000000..5582cbd
--- /dev/null
@@ -0,0 +1,185 @@
+diff -urN webkitgtk-2.34.6.orig/Source/JavaScriptCore/jsc.cpp webkitgtk-2.34.6/Source/JavaScriptCore/jsc.cpp
+--- webkitgtk-2.34.6.orig/Source/JavaScriptCore/jsc.cpp        2022-02-04 00:04:27.000000000 +0300
++++ webkitgtk-2.34.6/Source/JavaScriptCore/jsc.cpp     2024-06-21 17:19:48.817173000 +0300
+@@ -100,6 +100,9 @@
+ #else
+ #include <unistd.h>
+ #endif
++#if PLATFORM(GTK)
++#include <locale.h>
++#endif
+ #if PLATFORM(COCOA)
+ #include <crt_externs.h>
+diff -urN webkitgtk-2.34.6.orig/Source/JavaScriptCore/offlineasm/config.rb webkitgtk-2.34.6/Source/JavaScriptCore/offlineasm/config.rb
+--- webkitgtk-2.34.6.orig/Source/JavaScriptCore/offlineasm/config.rb   2021-05-17 16:22:35.000000000 +0300
++++ webkitgtk-2.34.6/Source/JavaScriptCore/offlineasm/config.rb        2024-06-21 17:20:32.153460000 +0300
+@@ -22,11 +22,11 @@
+ # THE POSSIBILITY OF SUCH DAMAGE.
+ buildProductsDirectory = ENV['BUILT_PRODUCTS_DIR'];
+-if buildProductsDirectory and File.exists?(buildProductsDirectory)
++if buildProductsDirectory and File.exist?(buildProductsDirectory)
+     $: << "#{buildProductsDirectory}/usr/local/include/WebKitAdditions/Scripts"
+ end
+ sdkRootDirectory = ENV['SDKROOT'];
+-if sdkRootDirectory and File.exists?(sdkRootDirectory)
++if sdkRootDirectory and File.exist?(sdkRootDirectory)
+     $: << "#{sdkRootDirectory}/usr/local/include/WebKitAdditions/Scripts"
+ end
+diff -urN webkitgtk-2.34.6.orig/Source/JavaScriptCore/offlineasm/parser.rb webkitgtk-2.34.6/Source/JavaScriptCore/offlineasm/parser.rb
+--- webkitgtk-2.34.6.orig/Source/JavaScriptCore/offlineasm/parser.rb   2021-10-21 11:52:07.000000000 +0300
++++ webkitgtk-2.34.6/Source/JavaScriptCore/offlineasm/parser.rb        2024-06-21 17:07:30.146305000 +0300
+@@ -832,10 +832,10 @@
+                 @idx += 1
+                 additionsDirectoryName = "#{@buildProductsDirectory}/usr/local/include/WebKitAdditions/"
+                 fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName
+-                if not File.exists?(fileName)
++                if not File.exist?(fileName)
+                     fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName
+                 end
+-                fileExists = File.exists?(fileName)
++                fileExists = File.exist?(fileName)
+                 raise "File not found: #{fileName}" if not fileExists and not isOptional
+                 list << parse(fileName) if fileExists
+             else
+@@ -864,10 +864,10 @@
+                 @idx += 1
+                 additionsDirectoryName = "#{@buildProductsDirectory}/usr/local/include/WebKitAdditions/"
+                 fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName
+-                if not File.exists?(fileName)
++                if not File.exist?(fileName)
+                     fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName
+                 end
+-                fileExists = File.exists?(fileName)
++                fileExists = File.exist?(fileName)
+                 raise "File not found: #{fileName}" if not fileExists and not isOptional
+                 fileList << fileName if fileExists
+             else
+diff -urN webkitgtk-2.34.6.orig/Source/JavaScriptCore/runtime/NativeExecutable.cpp webkitgtk-2.34.6/Source/JavaScriptCore/runtime/NativeExecutable.cpp
+--- webkitgtk-2.34.6.orig/Source/JavaScriptCore/runtime/NativeExecutable.cpp   2021-10-21 11:52:07.000000000 +0300
++++ webkitgtk-2.34.6/Source/JavaScriptCore/runtime/NativeExecutable.cpp        2024-06-21 17:20:50.174796000 +0300
+@@ -24,6 +24,7 @@
+  */
+ #include "config.h"
++#include "ExecutableBaseInlines.h"
+ #include "NativeExecutable.h"
+ #include "ExecutableBaseInlines.h"
+diff -urN webkitgtk-2.34.6.orig/Source/WTF/wtf/RAMSize.cpp webkitgtk-2.34.6/Source/WTF/wtf/RAMSize.cpp
+--- webkitgtk-2.34.6.orig/Source/WTF/wtf/RAMSize.cpp   2021-05-17 16:22:40.000000000 +0300
++++ webkitgtk-2.34.6/Source/WTF/wtf/RAMSize.cpp        2024-06-21 17:05:43.552906000 +0300
+@@ -35,6 +35,8 @@
+ #include <sys/sysinfo.h>
+ #elif OS(UNIX)
+ #include <unistd.h>
++#include <sys/types.h>
++#include <sys/sysctl.h>
+ #endif // OS(LINUX) || OS(UNIX)
+ #else
+ #include <bmalloc/bmalloc.h>
+@@ -56,14 +58,18 @@
+         return ramSizeGuess;
+     return status.ullTotalPhys;
+ #elif USE(SYSTEM_MALLOC)
+-#if OS(LINUX) || OS(FREEBSD)
++#if OS(LINUX)
+     struct sysinfo si;
+     sysinfo(&si);
+     return si.totalram * si.mem_unit;
+ #elif OS(UNIX)
+-    long pages = sysconf(_SC_PHYS_PAGES);
+-    long pageSize = sysconf(_SC_PAGE_SIZE);
+-    return pages * pageSize;
++    size_t physmem, len;
++    int mib[2] = { CTL_HW, HW_PHYSMEM };
++    if (sysctl(mib, 2, &physmem, &len, NULL, 0) == 0
++      && len == sizeof(physmem))
++      return physmem;
++    else
++      return 512 * MB; // guess
+ #else
+ #error "Missing a platform specific way of determining the available RAM"
+ #endif // OS(LINUX) || OS(FREEBSD) || OS(UNIX)
+diff -urN webkitgtk-2.34.6.orig/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp webkitgtk-2.34.6/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp
+--- webkitgtk-2.34.6.orig/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp    2021-10-21 11:52:08.000000000 +0300
++++ webkitgtk-2.34.6/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp 2024-06-21 17:22:23.951381000 +0300
+@@ -28,7 +28,7 @@
+ #include "config.h"
+ #include <wtf/MemoryPressureHandler.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ #include <wtf/Logging.h>
+ #include <wtf/MainThread.h>
+diff -urN webkitgtk-2.34.6.orig/Source/WebCore/platform/PlatformScreen.h webkitgtk-2.34.6/Source/WebCore/platform/PlatformScreen.h
+--- webkitgtk-2.34.6.orig/Source/WebCore/platform/PlatformScreen.h     2021-10-21 11:52:09.000000000 +0300
++++ webkitgtk-2.34.6/Source/WebCore/platform/PlatformScreen.h  2024-06-21 17:21:24.777609000 +0300
+@@ -48,6 +48,12 @@
+ typedef struct CGColorSpace *CGColorSpaceRef;
+ #endif
++// X11 headers define a bunch of macros with common terms, interfering with WebCore and WTF enum values.
++// As a workaround, we explicitly undef them here.
++#if defined(None)
++#undef None
++#endif
++
+ namespace WebCore {
+ class DestinationColorSpace;
+diff -urN webkitgtk-2.34.6.orig/Source/WebCore/platform/network/DNS.h webkitgtk-2.34.6/Source/WebCore/platform/network/DNS.h
+--- webkitgtk-2.34.6.orig/Source/WebCore/platform/network/DNS.h        2021-10-21 11:52:09.000000000 +0300
++++ webkitgtk-2.34.6/Source/WebCore/platform/network/DNS.h     2024-06-21 17:21:10.656663000 +0300
+@@ -33,6 +33,7 @@
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+ #else
++#include <sys/socket.h>
+ #include <netinet/in.h>
+ #endif
+diff -urN webkitgtk-2.34.6.orig/Source/WebCore/platform/text/TextCodec.cpp webkitgtk-2.34.6/Source/WebCore/platform/text/TextCodec.cpp
+--- webkitgtk-2.34.6.orig/Source/WebCore/platform/text/TextCodec.cpp   2021-05-17 16:22:42.000000000 +0300
++++ webkitgtk-2.34.6/Source/WebCore/platform/text/TextCodec.cpp        2024-06-21 17:21:36.058482000 +0300
+@@ -24,6 +24,8 @@
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+  */
++#include <stdio.h>
++
+ #include "config.h"
+ #include "TextCodec.h"
+diff -urN webkitgtk-2.34.6.orig/Source/WebDriver/PlatformGTK.cmake webkitgtk-2.34.6/Source/WebDriver/PlatformGTK.cmake
+--- webkitgtk-2.34.6.orig/Source/WebDriver/PlatformGTK.cmake   2021-09-16 15:43:07.000000000 +0300
++++ webkitgtk-2.34.6/Source/WebDriver/PlatformGTK.cmake        2024-06-21 17:21:47.027374000 +0300
+@@ -5,6 +5,7 @@
+ list(APPEND WebDriver_SYSTEM_INCLUDE_DIRECTORIES
+     "${GLIB_INCLUDE_DIRS}"
+     "${LIBSOUP_INCLUDE_DIRS}"
++    "${ICU_INCLUDE_DIRS}"
+ )
+ list(APPEND WebDriver_SOURCES
+@@ -18,4 +19,5 @@
+ list(APPEND WebDriver_LIBRARIES
+     ${LIBSOUP_LIBRARIES}
++    ${ICU_LIBRARIES}
+ )
+diff -urN webkitgtk-2.34.6.orig/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb webkitgtk-2.34.6/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb
+--- webkitgtk-2.34.6.orig/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb       2021-05-17 16:22:42.000000000 +0300
++++ webkitgtk-2.34.6/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb    2024-06-21 17:22:09.359781000 +0300
+@@ -36,7 +36,7 @@
+       end
+       generated_path = File.join tmpdir, output_filename
+-      if !File.exists?(generated_path)
++      if !File.exist?(generated_path)
+         puts "ERROR: Generated file does not exist at expected path."
+         exit 1
+       end
diff --git a/build/skel/www/webkitgtk-2.34.6.do b/build/skel/www/webkitgtk-2.34.6.do
new file mode 100644 (file)
index 0000000..cdf82b0
--- /dev/null
@@ -0,0 +1,49 @@
+[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../../..
+sname=$1.do . "$BASS_ROOT"/lib/rc
+. "$BASS_ROOT"/build/skel/common.rc
+
+bdeps="
+rc-paths
+stow
+archivers/zstd
+devel/cmake-3.28.3
+devel/ninja-v1.12.1
+devel/pkgconf-2.1.1
+lang/ruby-3.3.3
+"
+redo-ifchange $bdeps "$DISTFILES"/$NAME.tar.xz
+hsh=$("$BASS_ROOT"/build/bin/cksum $BASS_REV $SPATH)
+. "$BASS_ROOT"/build/lib/create-tmp-for-build.rc
+"$BASS_ROOT"/build/bin/pkg-inst $bdeps $rdeps
+. ./rc
+tar xf "$DISTFILES"/$NAME.tar.xz
+"$BASS_ROOT"/bin/rm-r "$SKELBINS"/$ARCH/$NAME-$hsh
+
+cd $NAME
+patch -p1 <"$BASS_ROOT"/build/skel/www/webkitgtk-2.34.6-fbsd.patch >&2
+mkdir build
+cd build
+cmake -GNinja \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX="$SKELBINS"/$ARCH/$NAME-$hsh \
+    -DPORT=GTK \
+    -DUSE_SOUP2=on \
+    -DUSE_WPE_RENDERER=off \
+    -DENABLE_GAMEPAD=off \
+    -DUSE_SYSTEMD=off \
+    -DENABLE_VIDEO=off \
+    -DENABLE_WEB_AUDIO=off \
+    -DUSE_WOFF2=off \
+    -DENABLE_SPELLCHECK=off \
+    -DENABLE_DRAG_SUPPORT=off \
+    -DENABLE_TOUCH_EVENTS=off \
+    -DENABLE_MINIBROWSER=on \
+    -DUSE_SYSTEM_MALLOC=on \
+    -DUSE_LCMS=off \
+    -DUSE_LIBHYPHEN=off \
+    -DUSE_LIBSECRET=off .. >&2
+ninja >&2
+ninja install >&2
+
+cd "$SKELBINS"/$ARCH
+"$BASS_ROOT"/build/lib/mk-pkg $NAME-$hsh