summaryrefslogtreecommitdiff
path: root/harmony/pcre2
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
commit7553795ec2d735c01dbdde129a65b7f45d5aa999 (patch)
treeb3970009a8246b0c17a105fe6b10c8077fc2b763 /harmony/pcre2
parente2b01859c88d221992403d1293d42da33002be4d (diff)
downloadpackages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.gz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.bz2
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.xz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.zip
Add harmony/ repo for packages still being discussed
See https://wiki.adelielinux.org/wiki/Project:Harmony
Diffstat (limited to 'harmony/pcre2')
-rw-r--r--harmony/pcre2/APKBUILD87
1 files changed, 87 insertions, 0 deletions
diff --git a/harmony/pcre2/APKBUILD b/harmony/pcre2/APKBUILD
new file mode 100644
index 000000000..115be1e56
--- /dev/null
+++ b/harmony/pcre2/APKBUILD
@@ -0,0 +1,87 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=pcre2
+pkgver=10.30
+pkgrel=0
+pkgdesc="Perl-compatible regular expression library"
+url="http://pcre.sourceforge.net/"
+arch="all"
+license="BSD"
+depends=""
+depends_dev="libedit-dev zlib-dev"
+makedepends="$depends_dev paxmark"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-tools
+ libpcre2-16:_libpcre libpcre2-32:_libpcre"
+source="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+case "$CARCH" in
+ s390x) _enable_jit="";;
+ ppc64) _enable_jit="";;
+ *) _enable_jit="--enable-jit";;
+esac
+
+build() {
+ cd "$builddir"
+
+ # Note: Forced -O3 is recommended (needed?) for Julia.
+ ./configure \
+ CFLAGS="$CFLAGS -O3" \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --docdir=/usr/share/doc/$pkgname-$pkgver \
+ --htmldir=/usr/share/doc/$pkgname-$pkgver/html \
+ --enable-pcre2-16 \
+ --enable-pcre2-32 \
+ --enable-pcre2grep-libz \
+ --enable-pcre2test-libedit \
+ --with-match-limit-recursion=8192 \
+ $_enable_jit
+ make
+}
+
+# Note: RunTest and pcre2_jit_test generates some binaries in .libs that needs
+# to disable MPROTECT on grsecurity kernel. That's why it's so complicated...
+check() {
+ cd "$builddir"
+
+ local is_pax=$(grep -q PaX /proc/$$/status && echo 'yes' || echo 'no')
+
+ if [ "$is_pax" = yes ]; then
+ timeout -t 1 -s KILL ./RunTest 2>/dev/null || true
+ find .libs -type f ! -name 'lib*' | xargs paxmark m
+ fi
+ ./RunTest
+
+ if [ -n "$_enable_jit" ]; then
+ if [ "$is_pax" = yes ]; then
+ timeout -t 1 -s KILL ./pcre2_jit_test >/dev/null || true
+ find .libs -type f ! -name 'lib*' | xargs paxmark m
+ fi
+ ./pcre2_jit_test
+ fi
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install
+}
+
+_libpcre() {
+ local bits="${subpkgname##*-}"
+ pkgdesc="PCRE2 with $bits bit character support"
+
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libpcre2-$bits.so* "$subpkgdir"/usr/lib/
+}
+
+tools() {
+ pkgdesc="Auxiliary utilities for PCRE2"
+
+ mkdir -p "$subpkgdir"/usr/
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
+}
+
+sha512sums="af6c7cd8e25ec1ed538c89808b144a508ee6f5ca08134f04119e4786d69643bea99bec3c9527d201cec47ba52032d55ad7692b448b4696d68fd4ed1081dbaa62 pcre2-10.30.tar.gz"