Update common patches

This commit is contained in:
Shivam Mathur
2025-11-24 04:18:57 +05:30
parent 865d4645a1
commit 7662a9b5f4
6 changed files with 46 additions and 18 deletions

View File

@ -1,13 +1,10 @@
patch_geos() {
php_version_id="$(php -r "echo PHP_VERSION_ID;")"
if [ "$php_version_id" -ge 70000 ]; then
if [[ $(printf '%s\n%s\n' "${version:?}" "7.0" | sort -V | head -n1) == "7.0" ]]; then
sed -i~ -e "s/, ce->name/, ZSTR_VAL(ce->name)/; s/ulong /zend_ulong /" geos.c
fi
if [ "$php_version_id" -ge 80500 ]; then
sed -i~ -e "s/zend_exception_get_default(TSRMLS_C)/zend_ce_exception/" geos.c
fi
get -q -n /tmp/php8.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0003-add-all-arginfo-and-fix-build-with-PHP-8.patch
get -q -n /tmp/toString.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0006-fix-__toString-with-8.2.patch
patch -p1 < /tmp/php8.patch 2>/dev/null || true
patch -p1 < /tmp/toString.patch 2>/dev/null || true
}
}