Skip to content

Commit

Permalink
fix(main/php): Fix pcre2 linking with php-pgsql extension
Browse files Browse the repository at this point in the history
  • Loading branch information
termux-pacman-bot committed Jan 4, 2025
1 parent 66e2e80 commit 35c1961
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/php/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TERMUX_PKG_LICENSE_FILE=LICENSE
TERMUX_PKG_MAINTAINER="@termux"
# Please revbump php-* extensions along with "minor" bump (e.g. 8.1.x to 8.2.0)
TERMUX_PKG_VERSION="8.4.1"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/php/php-src/archive/php-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=490df36775b2edbefb586ecb38cb4cd781fb05ac01794a345fc1269cca10792b
TERMUX_PKG_AUTO_UPDATE=false
Expand Down
14 changes: 14 additions & 0 deletions packages/php/ext-pgsql-config.m4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Link with pcre2 library explicitly. Otherwise, the following error is shown at runtime.
dlopen failed: cannot locate symbol "pcre2_match_8" referenced by "$PREFIX/lib/php/pgsql.so"

--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -7,6 +7,8 @@
the libpq paths.])])

if test "$PHP_PGSQL" != "no"; then
+ PGSQL_SHARED_LIBADD=-lpcre2-8
+ PHP_SUBST(PGSQL_SHARED_LIBADD)
PHP_SETUP_PGSQL([PGSQL_SHARED_LIBADD],,, [$PHP_PGSQL])
PHP_SUBST([PGSQL_SHARED_LIBADD])

0 comments on commit 35c1961

Please sign in to comment.