summaryrefslogtreecommitdiff
path: root/extra/webkitgtk/PKGBUILD
blob: 88fa24493f7b83b660467a1158fa34a636b288a0 (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
# $Id: PKGBUILD 206206 2014-02-21 18:40:49Z heftig $
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=webkitgtk
pkgver=2.2.5
pkgrel=1
pkgdesc="GTK+ Web content engine library"
arch=(i686 x86_64 mips64el)
url="http://webkitgtk.org/"
license=(custom)
depends=(libxt libxslt sqlite libsoup enchant libgl geoclue gtk3 gst-plugins-base-libs
         libsecret libwebp harfbuzz-icu)
makedepends=(gtk2 gperf gobject-introspection python mesa ruby gtk-doc)
optdepends=('gtk2: Netscape plugin support')
provides=("webkitgtk3=${pkgver}" "libwebkit3=${pkgver}")
conflicts=(webkitgtk3 libwebkit3)
replaces=(webkitgtk3 libwebkit3)
options=(!emptydirs)
source=(http://webkitgtk.org/releases/$pkgname-${pkgver}.tar.xz)
sha256sums=('c710994a1ed0ec78f746a05ae7dc65369ed56d7475f0de576ca7a73ad9c6e670')

prepare() {
  cd $pkgbase-$pkgver

  if [ "$CARCH" = "mips64el" ]; then
     # Fix MIPS N32 support.
      sed -i 's/defined(_ABIO32)/(defined(_ABIO32) || defined(_ABIN32))/' \
          Source/WTF/wtf/Platform.h
     # Don't enable JIT even if configure finds that it's not supported.
      sed -i 's/#define ENABLE_JIT 1/#define ENABLE_JIT 0/' \
          Source/WTF/wtf/Platform.h
  fi

  # Won't be made before files there.
  mkdir -p Programs/resources
}

build() {
  cd $pkgname-$pkgver

  if [ "$CARCH" = "mips64el" ]; then
      # Optimizations make it segfault when running; without
      # -mlong-calls R_MIPS_26 relocations will be used and truncated.
      # Disable unneeded arch-specific warnings.
      export CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=[0-9]} -Wno-cast-align"
      export CFLAGS="${CFLAGS/-O[0-9]} -mlong-calls"
      export CXXFLAGS="${CXXFLAGS/-O[0-9]} -mlong-calls"
      extra="--disable-fast-malloc --disable-optimizations"
  fi

  ./configure --prefix=/usr \
    --libexecdir=/usr/lib/$pkgname \
    --enable-introspection \
    ${extra}

  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make all stamp-po
}

package() {
  cd $pkgname-$pkgver
  make -j1 DESTDIR="$pkgdir" install
  install -Dm644 Source/WebKit/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}