From e79858c8b8453f72d5d9475c811b7c0da4ebb08b Mon Sep 17 00:00:00 2001 From: Mat Boehlke Date: Thu, 7 Oct 2021 15:44:54 -0500 Subject: [PATCH] php: patch to use enchant2 Upstream commit which documents change for enchant2: https://github.com/php/php-src/commit/66d42e98844de694c6f77c299a3dc045ac5a3261 This patch is based in part on https://github.com/archlinux/svntogit-packages/blob/10e873a1e11e7911f9e5e7ba604fe53c44d48c6c/trunk/enchant-2.patch --- srcpkgs/php/patches/php-enchant2.patch | 103 +++++++++++++++++++++++++ srcpkgs/php/template | 4 +- 2 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/php/patches/php-enchant2.patch diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch new file mode 100644 index 000000000000..b82c41211123 --- /dev/null +++ b/srcpkgs/php/patches/php-enchant2.patch @@ -0,0 +1,103 @@ +diff --git a/configure b/configure +index 3ece7a4..b832a68 100755 +--- a/configure ++++ b/configure +@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; } + if test "$PHP_ENCHANT" != "no"; then + + pkg_failed=no +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5 +-$as_echo_n "checking for enchant... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5 ++$as_echo_n "checking for enchant-2... " >&6; } + + if test -n "$ENCHANT_CFLAGS"; then + pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "enchant") 2>&5 ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then +- pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null` ++ pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes + else + pkg_failed=yes +@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then + pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "enchant") 2>&5 ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then +- pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null` ++ pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes + else + pkg_failed=yes +@@ -28173,14 +28173,14 @@ else + _pkg_short_errors_supported=no + fi + if test $_pkg_short_errors_supported = yes; then +- ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1` ++ ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1` + else +- ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1` ++ ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ENCHANT_PKG_ERRORS" >&5 + +- as_fn_error $? "Package requirements (enchant) were not met: ++ as_fn_error $? "Package requirements (enchant-2) were not met: + + $ENCHANT_PKG_ERRORS + +diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c +index 6ce9d4b..1923726 100644 +--- a/ext/enchant/enchant.c ++++ b/ext/enchant/enchant.c +@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check) + for (i = 0; i < n_sugg; i++) { + add_next_index_string(sugg, suggs[i]); + } +- enchant_dict_free_suggestions(pdict->pdict, suggs); ++ enchant_dict_free_string_list(pdict->pdict, suggs); + } + + +@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest) + add_next_index_string(return_value, suggs[i]); + } + +- enchant_dict_free_suggestions(pdict->pdict, suggs); ++ enchant_dict_free_string_list(pdict->pdict, suggs); + } + } + /* }}} */ +@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal) + + PHP_ENCHANT_GET_DICT; + +- enchant_dict_add_to_personal(pdict->pdict, word, wordlen); ++ enchant_dict_add(pdict->pdict, word, wordlen); + } + /* }}} */ + +@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session) + + PHP_ENCHANT_GET_DICT; + +- RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen)); ++ RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen)); + } + /* }}} */ + diff --git a/srcpkgs/php/template b/srcpkgs/php/template index 927bbf8504f8..141f7fee310d 100644 --- a/srcpkgs/php/template +++ b/srcpkgs/php/template @@ -1,9 +1,9 @@ # Template file for 'php' pkgname=php version=7.4.14 -revision=6 +revision=7 hostmakedepends="bison pkg-config apache-devel" -makedepends="apache-devel enchant-devel freetds-devel freetype-devel gdbm-devel +makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel