From 1a6cff7349434503283297cd7b1821fe23b776fc Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 30 Mar 2017 23:54:20 +0200 Subject: [PATCH] php: Link pgsql extension against libpcre The pgsql extension uses pcre functions but does not link against libpcre by default, as the php executable which dlopen():s the extension already links against libpcre. However, on Android this doesn't work, see https://github.com/android-ndk/ndk/issues/201 so we need to link against libpcre explicitly. --- packages/php/build.sh | 1 + packages/php/ext-pgsql-config.m4.patch | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 packages/php/ext-pgsql-config.m4.patch diff --git a/packages/php/build.sh b/packages/php/build.sh index ca8c2a32..83a83796 100644 --- a/packages/php/build.sh +++ b/packages/php/build.sh @@ -1,6 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://php.net TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language" TERMUX_PKG_VERSION=7.1.3 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=e4887c2634778e37fd962fbdf5c4a7d32cd708482fe07b448804625570cb0bb0 # Build native php for phar to build (see pear-Makefile.frag.patch): diff --git a/packages/php/ext-pgsql-config.m4.patch b/packages/php/ext-pgsql-config.m4.patch new file mode 100644 index 00000000..2b6f9822 --- /dev/null +++ b/packages/php/ext-pgsql-config.m4.patch @@ -0,0 +1,15 @@ +diff -u -r ../php-7.1.3/ext/pgsql/config.m4 ./ext/pgsql/config.m4 +--- ../php-7.1.3/ext/pgsql/config.m4 2017-03-14 14:17:47.000000000 +0100 ++++ ./ext/pgsql/config.m4 2017-03-30 23:24:49.664225152 +0200 +@@ -101,6 +101,11 @@ + LDFLAGS=$old_LDFLAGS + + PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD) ++ dnl The pgsql extension uses pcre so needs to link explicitly ++ dnl against it to work on android (the php binary, which dlopen():s ++ dnl this module already links to pcre, but that is not enough on ++ dnl Android, see https://github.com/android-ndk/ndk/issues/201): ++ PHP_ADD_LIBRARY_WITH_PATH(pcre, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD) + PHP_SUBST(PGSQL_SHARED_LIBADD) + + PHP_ADD_INCLUDE($PGSQL_INCLUDE) -- 2.11.0