Commit 88797b32 authored by Andy Postnikov's avatar Andy Postnikov
Browse files

testing/php8-snuffleupagus: new aport

parent 72625ea7
Pipeline #82262 failed with stages
in 1 minute and 28 seconds
# Maintainer: Julien (jvoisin) Voisin <julien.voisin+snuffleupagus@dustri.org>
pkgname=php8-snuffleupagus
_extname=snuffleupagus
pkgver=0.7.0
pkgrel=0
pkgdesc="Security module for PHP 8"
url="https://snuffleupagus.readthedocs.io"
arch="all"
license="LGPL-3.0-only"
depends="php8-common"
builddir="$srcdir/$_extname-$pkgver/src"
makedepends="php8-dev php8-cgi"
source="php-$_extname-$pkgver.tar.gz::https://github.com/jvoisin/snuffleupagus/archive/v$pkgver.tar.gz
pcre.patch"
build() {
phpize8
./configure \
--prefix=/usr \
--enable-snuffleupagus \
--with-php-config=php-config8
make
}
check() {
TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make test TESTS="tests/cookies_encryption tests/deny_writable"
TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make test TESTS="tests/global_strict"
TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make test TESTS="tests/harden_rand tests/sloppy_comparison tests/unserialize"
# TODO re-enable these tests
#TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make test TESTS="tests/disable_function"
#TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make test TESTS="tests/xxe"
#TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make test TESTS="tests/eval_blacklist"
#TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make test TESTS="tests/dump_request"
}
package() {
make INSTALL_ROOT="$pkgdir" install
local _confdir="$pkgdir"/etc/php8/conf.d
install -d $_confdir
install -m644 ../config/$_extname.ini $_confdir/$pkgname.ini
install -m644 ../config/default.rules $_confdir/$_extname.rules
}
sha512sums="608ad97a9b8118c30f7c2d39b154233e5398e839d9253d7e9dd4b17ad030c5b6dfe3d794c9a469e30f32c8b21a2fdba24e0d9dba3c46f28144edcf174089fc97 php-snuffleupagus-0.7.0.tar.gz
d21115ecaa7ae0b19ce2fa601619fdab1308a52a32ecbfc042da6709cb59d5d2542c29ba32af1cb3aad4b3410d9f1fd3878e507f985fa2b2f9c81197b8766354 pcre.patch"
From 3c528d9d03cec872382a6f400b5701a8fbfd59b4 Mon Sep 17 00:00:00 2001
From: jvoisin <julien.voisin@dustri.org>
Date: Sun, 3 Jan 2021 14:12:54 +0100
Subject: [PATCH] Don't check for bundled pcre in php8
Patch coming from https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/16372/diffs#diff-content-c2549fd272f686fb013e5c74164615ca073560bb
---
src/php_snuffleupagus.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h
index dc0a4715..248045cb 100644
--- a/php_snuffleupagus.h
+++ b/php_snuffleupagus.h
@@ -45,9 +45,6 @@
#include "zend_vm.h"
/* Compatibility */
-#if ( !HAVE_PCRE && !HAVE_BUNDLED_PCRE )
-#error Snuffleupagus requires PHP7+ with PCRE support
-#endif
#if PHP_VERSION_ID < 70000
#error Snuffleupagus only works with PHP7+. You shouldn't use PHP5 anyway, \
since it's not supported anymore: https://secure.php.net/supported-versions.php
@@ -58,6 +55,10 @@ typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
#if PHP_VERSION_ID >= 80000
#define TSRMLS_FETCH()
#define TSRMLS_C
+#else
+#if ( !HAVE_PCRE && !HAVE_BUNDLED_PCRE )
+#error Snuffleupagus requires PHP7+ with PCRE support
+#endif
#endif
#define SP_CONFIG_VALID 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment