Skip to contentSkip to conversation

php: Fix absolute paths to php in phar.phar scripts

PATCH New Khem Raj 1 participant 1 message Jul 3, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 php: Fix absolute paths to php in phar.phar scripts

This patch is not only needed for target but also needed for native and nativesdk variants.

Fixes
do_populate_sysroot: QA Issue: : /work/x86_64-linux/php-native/8.1.7-r0/sysroot-destdir/
work/x86_64-linux/php-native/8.1.7-r0/recipe-sysroot-native/usr/bin/phar.phar maximum shebang size exceeded, the ma ximum size is 128. [shebang-size]

---
 .../0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch | 9 ++-------
 meta-oe/recipes-devtools/php/php_8.1.7.bb                | 2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)
meta-oe/recipes-devtools/php/php/0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch +2 -7
index 26872d1204..acf2940839 100644
@@ -18,11 +18,9 @@ Signed-off-by: Claude Bing <[email protected]>
  ext/phar/Makefile.frag | 17 +++--------------
  1 file changed, 3 insertions(+), 14 deletions(-)
 
-diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag
-index 58789cae25..c02af1b186 100644
 --- a/ext/phar/Makefile.frag
 +++ b/ext/phar/Makefile.frag
-@@ -10,20 +10,9 @@ pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
+@@ -10,20 +10,9 @@ pharcmd: $(builddir)/phar.php $(builddir
  
  PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
  PHP_PHARCMD_EXECUTABLE = ` \
@@ -42,10 +40,7 @@ index 58789cae25..c02af1b186 100644
 -PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
 +               $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; `
 +
-+PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
++PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "/usr/bin/env $(program_prefix)php$(program_suffix)$(EXEEXT)";`
  
  $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc
  	-@test -d $(builddir)/phar || mkdir $(builddir)/phar
--- 
-2.25.1
-
meta-oe/recipes-devtools/php/php_8.1.7.bb +1 -1
index e9e8eccf3a..043f3a81b2 100644
@@ -16,6 +16,7 @@ SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
            file://0002-build-php.m4-don-t-unset-cache-variables.patch \
            file://0003-php-remove-host-specific-info-from-header-file.patch \
            file://0004-configure.ac-don-t-include-build-libtool.m4.patch \
+           file://0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch \
            file://0009-php-don-t-use-broken-wrapper-for-mkdir.patch \
            file://0010-iconv-fix-detection.patch \
           "
@@ -23,7 +24,6 @@ SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
 SRC_URI:append:class-target = " \
             file://0001-ext-opcache-config.m4-enable-opcache.patch \
             file://0005-pear-fix-Makefile.frag-for-Yocto.patch \
-            file://0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch \
             file://0007-sapi-cli-config.m4-fix-build-directory.patch \
             file://0008-ext-imap-config.m4-fix-include-paths.patch \
             file://php-fpm.conf \
Signature · 1 line
2.37.0