app=webkitgtk
version=2.34.6
build=1sml
homepage="https://webkitgtk.org/"
download="https://webkitgtk.org/releases/webkitgtk-2.34.6.tar.xz"
desc="GTK+ port of the WebKit"
requires="libwebp libtasn1 gtk3 bubblewrap gst-plugins-base libmanette ruby"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version 
  fixbuilddirpermissions

  unset CFLAGS CXXFLAGS

  patch -p1 < $srcdir/symboltable.patch
  patch -p1 < $srcdir/shapeoutsideinfo.patch

  mkdir -p smbuild && cd smbuild
  cmake .. -GNinja \
    -DPORT=GTK \
    -DCMAKE_BUILD_TYPE=MinSizeRel \
    -DCMAKE_SKIP_RPATH=ON \
    -DCMAKE_INSTALL_PREFIX="" \
    -DLIB_INSTALL_DIR="/lib" \
    -DENABLE_GTKDOC=OFF \
    -DENABLE_GEOLOCATION=OFF \
    -DENABLE_SAMPLING_PROFILER=OFF \
    -DENABLE_MINIBROWSER=ON \
    -DUSE_WPE_RENDERER=OFF \
    -DUSE_LD_GOLD=OFF \
    -DUSE_SYSTEMD=OFF \
    -DUSE_SOUP2=ON \
    -DENABLE_GLES2=ON 

  ninja JavaScriptCore-4-gir
  ninja

  DESTDIR="$pkg" ninja install

  mkfinalpkg
}

sha512sums="
57ab25af027ae39820622743c258f3e6d0af86376f2a4c3a8ede560ca6652c98c49056c716aace56291264c18164cb60395be9779a9d12455e6a0f7d2c197343  webkitgtk-2.34.6.tar.xz
a1304879072c2fcfa5b664faf7f57353e1eca007aa0f5723f2020d9f1ed10c7f3281ec3b0f359467843a7ea7014e7994b2b85ca97de96cd78cfedcc7839fdc0f  shapeoutsideinfo.patch
dd2b9a6ac0afdc3a79c6b7c904cd5a5d1dbbae7a5c002dbbdf50bf93dbeba44a31f957cab199262ff83fe3e5e2970670353eed927392b2443684b214695b8473  symboltable.patch
"
