void-packages/srcpkgs/php8.2/patches/cross-ltmain-sysroot-support.patch
Joel Beckmeyer 4a97542c26 php8.2: update to 8.2.26.
- enable fpm ACLs
- clean up patches
- generate configure locally instead of using vendored for ease of
  patching
- add user for php-fpm instead of using uncreated `http` user
2024-11-23 12:28:58 +01:00

49 lines
1.8 KiB
Diff

PHP's phpize is based on a very old libtool to generate build files for its
extensions. This libtool does not support .la files with '=' to support
sysroot.
In order to support more PHP extension cross compilation this modifies
ltmain.sh to support such path. This is a bit hackish has it only get sysroot
from the used toolchain; the proper way to fix that is to have PHP developpers
to update the autotools file used to build there extensions.
--- a/build/ltmain.sh 2021-09-09 15:19:14.822208365 +0200
+++ b/build/ltmain.sh 2021-09-09 15:47:55.397011151 +0200
@@ -2375,6 +2375,13 @@ EOF
*) . ./$lib ;;
esac
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
+ newdependency_libs="$newdependency_libs $deplib"
+ done
+ dependency_libs=${newdependency_libs}
+
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
@@ -5750,6 +5757,13 @@ fi\
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
+
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
+ newdependency_libs="$newdependency_libs $deplib"
+ done
+
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
@@ -5767,7 +5781,7 @@ library_names='$library_names'
old_library='$old_library'
# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
+dependency_libs='$newdependency_libs'
# Version information for $libname.
current=$current