Skip to content

Commit cb8b1bc

Browse files
authored
browser(webkit): Reduce binary size of WebKit Linux build bundles (GTK and WPE) (#2880)
This patch changes the build system to use the JHBuild minimal dependency system introduced in WebKit r264092 <https://trac.webkit.org/r264092> The build has been tested with Ubuntu-18.04 The binary size of the zip bundles is now: 37M (WPE) and 40M (GTK). Previously it was 54M and 59M (respectively)
1 parent e90ba26 commit cb8b1bc

File tree

6 files changed

+65
-55
lines changed

6 files changed

+65
-55
lines changed

browser_patches/webkit/BUILD_NUMBER

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1305
2-
Changed: [email protected] Wed Jul 8 15:26:58 PDT 2020
1+
1306
2+
Changed: [email protected] Wed Jul 8 18:31:52 PDT 2020
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
REMOTE_URL="https://github.com/webkit/webkit"
22
BASE_BRANCH="master"
3-
BASE_REVISION="19d11039faa6e4da8cf7487e9c54a00a7c6e18e2"
3+
BASE_REVISION="822da5711ad337e1a7da82e813aa99e14fb79e49"

browser_patches/webkit/archive.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,15 @@ createZipForLinux() {
7575
# Copy libvpx.so.5 as Ubuntu 20.04 comes with libvpx.so.6
7676
ldd WebKitBuild/WPE/Release/bin/MiniBrowser | grep -o '[^ ]*\/libvpx.so.5[^ ]*' | xargs cp -t $tmpdir
7777
# Copy some wayland libraries required for Web Process t
78-
cp -d -t $tmpdir WebKitBuild/WPE/DependenciesWPE/Root/lib/libva\-*
78+
if ls WebKitBuild/WPE/DependenciesWPE/Root/lib/libva\-* 2>&1 >/dev/null; then
79+
cp -d -t $tmpdir WebKitBuild/WPE/DependenciesWPE/Root/lib/libva\-*
80+
fi
7981
# Injected bundle is loaded dynamicly via dlopen => not bt listed by ldd.
8082
cp -t $tmpdir WebKitBuild/WPE/Release/lib/libWPEInjectedBundle.so
81-
mkdir -p $tmpdir/gio/modules
82-
cp -t $tmpdir/gio/modules $PWD/WebKitBuild/WPE/DependenciesWPE/Root/lib/gio/modules/*
83+
if test -d $PWD/WebKitBuild/WPE/DependenciesWPE/Root/lib/gio/modules/; then
84+
mkdir -p $tmpdir/gio/modules
85+
cp -t $tmpdir/gio/modules $PWD/WebKitBuild/WPE/DependenciesWPE/Root/lib/gio/modules/*
86+
fi
8387

8488
cd $tmpdir
8589
ln -s libWPEBackend-fdo-1.0.so.1 libWPEBackend-fdo-1.0.so
@@ -100,11 +104,13 @@ createZipForLinux() {
100104
cp -t $tmpdir WebKitBuild/GTK/Release/lib/libwebkit2gtkinjectedbundle.so
101105
# Copy libvpx.so.5 as Ubuntu 20.04 comes with libvpx.so.6
102106
ldd WebKitBuild/GTK/Release/bin/MiniBrowser | grep -o '[^ ]*\/libvpx.so.5[^ ]*' | xargs cp -t $tmpdir
103-
mkdir -p $tmpdir/gio/modules
104-
cp -t $tmpdir/gio/modules $PWD/WebKitBuild/GTK/DependenciesGTK/Root/lib/gio/modules/*
107+
if test -d $PWD/WebKitBuild/GTK/DependenciesGTK/Root/lib/gio/modules; then
108+
mkdir -p $tmpdir/gio/modules
109+
cp -t $tmpdir/gio/modules $PWD/WebKitBuild/GTK/DependenciesGTK/Root/lib/gio/modules/*
110+
fi
105111

106112
# we failed to nicely build libgdk_pixbuf - expect it in the env
107-
rm $tmpdir/libgdk_pixbuf*
113+
rm -f $tmpdir/libgdk_pixbuf*
108114
else
109115
echo "ERROR: must specify --gtk or --wpe"
110116
exit 1

browser_patches/webkit/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ cd "$(dirname $0)"
77

88
build_gtk() {
99
if ! [[ -d ./WebKitBuild/GTK/DependenciesGTK ]]; then
10-
yes | WEBKIT_JHBUILD=1 WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/GTK DEBIAN_FRONTEND=noninteractive ./Tools/Scripts/update-webkitgtk-libs
10+
yes | WEBKIT_JHBUILD=1 WEBKIT_JHBUILD_MODULESET=minimal WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/GTK DEBIAN_FRONTEND=noninteractive ./Tools/Scripts/update-webkitgtk-libs
1111
fi
12-
WEBKIT_JHBUILD=1 WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/GTK ./Tools/Scripts/build-webkit --gtk --release --touch-events --orientation-events MiniBrowser
12+
WEBKIT_JHBUILD=1 WEBKIT_JHBUILD_MODULESET=minimal WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/GTK ./Tools/Scripts/build-webkit --gtk --release --touch-events --orientation-events --no-bubblewrap-sandbox MiniBrowser
1313
}
1414

1515
build_wpe() {
1616
if ! [[ -d ./WebKitBuild/WPE/DependenciesWPE ]]; then
17-
yes | WEBKIT_JHBUILD=1 WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/WPE DEBIAN_FRONTEND=noninteractive ./Tools/Scripts/update-webkitwpe-libs
17+
yes | WEBKIT_JHBUILD=1 WEBKIT_JHBUILD_MODULESET=minimal WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/WPE DEBIAN_FRONTEND=noninteractive ./Tools/Scripts/update-webkitwpe-libs
1818
fi
19-
WEBKIT_JHBUILD=1 WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/WPE ./Tools/Scripts/build-webkit --wpe --release --touch-events --orientation-events MiniBrowser
19+
WEBKIT_JHBUILD=1 WEBKIT_JHBUILD_MODULESET=minimal WEBKIT_OUTPUTDIR=$(pwd)/WebKitBuild/WPE ./Tools/Scripts/build-webkit --wpe --release --touch-events --orientation-events --no-bubblewrap-sandbox MiniBrowser
2020
}
2121

2222
if [[ "$(uname)" == "Darwin" ]]; then

0 commit comments

Comments
 (0)