diff options
Diffstat (limited to 'main/pcre2/APKBUILD')
-rw-r--r-- | main/pcre2/APKBUILD | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/main/pcre2/APKBUILD b/main/pcre2/APKBUILD index 9632273021..2c844c7984 100644 --- a/main/pcre2/APKBUILD +++ b/main/pcre2/APKBUILD @@ -9,17 +9,21 @@ arch="all" license="BSD" depends="" depends_dev="libedit-dev zlib-dev" -makedepends="$depends_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="";; + *) _enable_jit="--enable-jit";; +esac + build() { cd "$builddir" # Note: Forced -O3 is recommended (needed?) for Julia. - [ "$CARCH" != "s390x" ] && _enable_jit="--enable-jit" ./configure \ CFLAGS="$CFLAGS -O3" \ --build=$CBUILD \ @@ -36,6 +40,28 @@ build() { 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" |