[arch-commits] Commit in libproxy/trunk (PKGBUILD)

Jan Steffens heftig at archlinux.org
Sun Mar 8 00:09:25 UTC 2020


    Date: Sunday, March 8, 2020 @ 00:09:18
  Author: heftig
Revision: 376923

0.4.15+33+g454a499-1

Modified:
  libproxy/trunk/PKGBUILD

----------+
 PKGBUILD |  100 +++++++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 68 insertions(+), 32 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-03-07 23:58:30 UTC (rev 376922)
+++ PKGBUILD	2020-03-08 00:09:18 UTC (rev 376923)
@@ -1,47 +1,83 @@
+# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
 # Maintainer: Jan de Groot <jgc at archlinux.org>
 
-pkgname=libproxy
-pkgver=0.4.15
-pkgrel=13
-pkgdesc="A library that provides automatic proxy configuration management"
+pkgbase=libproxy
+pkgname=(libproxy libproxy-mozjs libproxy-webkit)
+pkgver=0.4.15+33+g454a499
+pkgrel=1
+pkgdesc="Automatic proxy configuration management library"
+url="https://libproxy.github.io/libproxy/"
 arch=(x86_64)
-license=('LGPL')
-depends=('gcc-libs')
-optdepends=('networkmanager: NetworkManager configuration module'
-            'perl: Perl bindings'
-            'python2: Python 2.x bindings'
-            'python: Python 3.x bindings'
-            'glib2: gsettings configuration module'
-            'webkit2gtk: PAC proxy support (Webkit2gtk engine)')
-makedepends=('cmake' 'networkmanager' 'python' 'python2' 'perl' 'webkit2gtk')
-url="https://libproxy.github.io/libproxy/"
-source=(https://github.com/libproxy/libproxy/archive/${pkgver}.tar.gz)
-sha256sums=('18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0')
+license=(LGPL)
+depends=(gcc-libs glib2 dbus)
+makedepends=(cmake python python2 perl webkit2gtk git js60)
+_commit=454a499692b8fd36c376d4555ddf343316bfddd4  # master
+source=("git+https://github.com/libproxy/libproxy#commit=$_commit")
+sha256sums=('SKIP')
 
+pkgver() {
+  cd $pkgbase
+  git describe --tags | sed 's/-/+/g'
+}
+
 prepare() {
-  if [ ! -d build ]; then
-    mkdir build
-  fi
+  cd $pkgbase
 }
 
 build() {
-  cd build
-  cmake ../${pkgname}-${pkgver} \
+  cmake -H$pkgbase -Bbuild \
+    -DBIPR=0 \
+    -DCMAKE_BUILD_TYPE=None \
+    -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+    -DCMAKE_C_FLAGS="$CFLAGS" \
     -DCMAKE_INSTALL_PREFIX=/usr \
-    -DLIBEXEC_INSTALL_DIR=/usr/lib/libproxy \
     -DCMAKE_SKIP_RPATH=ON \
+    -DLIBEXEC_INSTALL_DIR=/usr/lib \
     -DPERL_VENDORINSTALL=yes \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DWITH_WEBKIT3=ON \
-    -DWITH_MOZJS=OFF \
-    -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-    -DCMAKE_C_FLAGS="${CFLAGS}" \
     -DPYTHON2_EXECUTABLE:FILEPATH=/usr/bin/python2 \
-    -DBIPR=0
-  make
+    -DWITH_MOZJS=ON \
+    -DWITH_WEBKIT3=ON
+  cmake --build build
 }
 
-package() {
-  cd build
-  make DESTDIR="${pkgdir}" install
+check() {
+  cmake --build build --target test
 }
+
+_pick() {
+  local p="$1" f d; shift
+  for f; do
+    d="$srcdir/$p/${f#$pkgdir/}"
+    mkdir -p "$(dirname "$d")"
+    mv "$f" "$d"
+    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
+  done
+}
+
+package_libproxy() {
+  optdepends=('networkmanager: NetworkManager configuration module'
+              'perl: Perl bindings'
+              'python2: Python 2.x bindings'
+              'python: Python 3.x bindings'
+              'libproxy-mozjs: PAC proxy support (via MozJS)'
+              'libproxy-webkit: PAC proxy support (via WebKit)')
+  provides+=(libproxy.so)
+
+  DESTDIR="$pkgdir" cmake --build build --target install
+
+### Split
+  _pick mozjs "$pkgdir"/usr/lib/libproxy/*/modules/pacrunner_mozjs.so
+  _pick webkit "$pkgdir"/usr/lib/libproxy/*/modules/pacrunner_webkit.so
+}
+
+package_libproxy-mozjs() {
+  pkgdesc="SpiderMonkey-based PAC proxy support for libproxy"
+  depends=(libproxy js60)
+  mv mozjs/* "$pkgdir"
+}
+
+package_libproxy-webkit() {
+  pkgdesc="JavaScriptCore-based PAC proxy support for libproxy"
+  depends=(libproxy webkit2gtk)
+  mv webkit/* "$pkgdir"
+}



More information about the arch-commits mailing list