summaryrefslogtreecommitdiff
path: root/nonprism/webkit2gtk/PKGBUILD
blob: 57b6f39d59b76ddfb470c08bca66adfcbbb623ad (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Maintainer (arch): Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor (arch): Eric Bélanger <eric@archlinux.org>
# Contributor: Andreas Grapentin <andreas@grapentin.org>
# Contributor: Jesús E. <heckyel@parabola.nu>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Luke R. <g4jc@openmailbox.org>
# Contributor: Freemor <freemor@fremor.ca>
# Contributor: bill-auger <bill-auger@programmer.net>


# parabola changes and rationale:
#  - remove geoclue2 support
#  - pinned to 'icu' sodep


pkgname=webkit2gtk
pkgver=2.36.3
pkgrel=1
pkgrel+=.nonprism1
pkgdesc="Web content engine for GTK"
pkgdesc+=", without geoclue2 support"
url="https://webkitgtk.org"
arch=(x86_64)
arch+=(armv7h i686)
license=(custom)
depends=(cairo fontconfig freetype2 libgcrypt glib2 gtk3 harfbuzz harfbuzz-icu
         icu libjpeg libsoup libxml2 zlib libpng sqlite atk libwebp at-spi2-core
         libegl libgl libgles libwpe wpebackend-fdo libxslt libsecret libtasn1
         enchant libx11 libxext libice libxt wayland libnotify hyphen openjpeg2
         woff2 libsystemd bubblewrap libseccomp xdg-dbus-proxy gstreamer
         gst-plugins-base-libs libmanette)
makedepends=(cmake ninja gtk-doc python ruby gobject-introspection
             wayland-protocols systemd gst-plugins-bad gperf)
optdepends=('gst-plugins-good: media decoding'
            'gst-plugins-bad: media decoding'
            'gst-libav: nonfree media decoding')
options=(debug)
source=($url/releases/webkitgtk-$pkgver.tar.xz{,.asc})
source_i686=(webkitgtk-2.36.3-no-sse2.arch32.patch)
sha256sums=('732fcf8c4ec644b8ed28b46ebbd7c1ebab9d9e0afea9bdf5e5d12786afc478d1'
            'SKIP')
sha256sums_i686=('58a724b7f1092a9049186a3b8c61689c31558b6c2b587c827cec04219397adac')
validpgpkeys=('D7FCF61CF9A2DEAB31D81BD3F3D322D0EC4582C3'  # Carlos Garcia Campos <cgarcia@igalia.com>
              '5AA3BC334FD7E3369E7C77B291C559DBE4C9123B') # Adrián Pérez de Castro <aperez@igalia.com>


prepare() {
  cd webkitgtk-$pkgver
  case "$CARCH" in
  i686)
    options+=(!debug)

    # disable SSE2 on 486 and 686
    echo "applying webkitgtk-2.36.3-no-sse2.arch32.patch"
    patch -Rp1 -i "$srcdir"/webkitgtk-2.36.3-no-sse2.arch32.patch
    ;;
  esac
}

build() {
  # Produce minimal debug info: 4.3 GB of debug data makes the
  # build too slow and is too much to package for debuginfod
  CFLAGS+=' -g1'
  CXXFLAGS+=' -g1'

  local parabola_options=( -DENABLE_GEOLOCATION=OFF )
  case "$CARCH" in
  i686)
    # linker runs out of memory on 32-bit
    LDFLAGS+=" -Wl,--no-keep-memory"

    # do not build JIT code on non-pentium4 (breaks in micro-optimizations)
    parabola_options+=( -DENABLE_JIT=OFF -DENABLE_C_LOOP=ON -DENABLE_SAMPLING_PROFILER=OFF )
    ;;
  esac

  cmake -S webkitgtk-$pkgver -B build -G Ninja \
    ${parabola_options[@]} \
    -DPORT=GTK \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DCMAKE_SKIP_RPATH=ON \
    -DUSE_SOUP2=ON \
    -DENABLE_GTKDOC=OFF \
    -DENABLE_MINIBROWSER=ON
  cmake --build build
}

package() {
  depends+=(libwpe-1.0.so libWPEBackend-fdo-1.0.so)
  depends+=(libicui18n.so libicuuc.so)
  provides+=(libjavascriptcoregtk-4.0.so libwebkit2gtk-4.0.so)

  DESTDIR="$pkgdir" cmake --install build

  rm -r "$pkgdir/usr/bin"

  cd webkitgtk-$pkgver
  find Source -name 'COPYING*' -or -name 'LICENSE*' -print0 | sort -z |
    while IFS= read -d $'\0' -r _f; do
      echo "### $_f ###"
      cat "$_f"
      echo
    done |
    install -Dm644 /dev/stdin "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}