aboutsummaryrefslogtreecommitdiff
path: root/extra/webkit2gtk/build
blob: df726ff0a2f8b549af5d6aecf76f8bb203ed21e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh -e

sed_i() {
    for file; do :; done
    sed "$@" > _
    cat _ > "$file"; rm -f _
}

# Enable the use of openjpeg if the package is installed.
cpt-list openjpeg2 >/dev/null 2>&1 && jpeg=ON

# Enable webcrypto if libtasn1 is installed.
cpt-list libtasn1 >/dev/null 2>&1 && libtasn=ON

patch -p1 < fix-musl.patch
patch -p1 < icu-69.patch

# Remove gettext requirement.
sed_i 's/ngettext/printf/g' Tools/MiniBrowser/gtk/BrowserDownloadsBar.c
sed_i '/po_files \*\.po/d'  Source/WebCore/platform/gtk/po/CMakeLists.txt
sed_i '/^GETTEXT_C/d'       Source/WebCore/platform/gtk/po/CMakeLists.txt

# Fix clang build.
sed -i '/LC_ALL/d'       Source/JavaScriptCore/jsc.cpp
sed -i '/WTFLogAlways/d' Source/JavaScriptCore/jsc.cpp

export DESTDIR="$1"

# Webkit's CMake configuration forces color output using clang-specific flags
# when using Ninja as the CMAKE_GENERATOR. We should disable them.
sed_i s,-fcolor-diagnostics,, Source/cmake/WebKitCompilerFlags.cmake

cmake -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIB_INSTALL_DIR=/usr/lib \
    -DPORT=GTK \
    -DCMAKE_SKIP_RPATH=ON \
    -DENABLE_BUBBLEWRAP_SANDBOX=OFF \
    -DENABLE_SAMPLING_PROFILER=OFF \
    -DENABLE_GEOLOCATION=OFF \
    -DENABLE_GLES2=ON \
    -DENABLE_INTROSPECTION=OFF \
    -DENABLE_MINIBROWSER=OFF \
    -DENABLE_SPELLCHECK=OFF \
    -DUSE_LIBHYPHEN=OFF \
    -DUSE_LIBNOTIFY=OFF \
    -DUSE_LIBSECRET=OFF \
    -DUSE_SYSTEMD=OFF \
    -DUSE_OPENJPEG=${jpeg:-OFF} \
    -DUSE_WOFF2=OFF \
    -DUSE_WPE_RENDERER=OFF \
    -DENABLE_WEB_CRYPTO=${libtasn:-OFF} \
    -DENABLE_WAYLAND_TARGET=OFF \
    -DENABLE_GAMEPAD=OFF \
    -Wno-dev

cmake --build   build
cmake --install build