[meta-oe] php: Fix absolute paths to php in phar.phar scripts

Message ID 20220703161352.2516944-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe] php: Fix absolute paths to php in phar.phar scripts | expand

Commit Message

Khem Raj July 3, 2022, 4:13 p.m. UTC
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]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../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(-)

Patch

diff --git a/meta-oe/recipes-devtools/php/php/0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch b/meta-oe/recipes-devtools/php/php/0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch
index 26872d1204..acf2940839 100644
--- a/meta-oe/recipes-devtools/php/php/0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch
+++ b/meta-oe/recipes-devtools/php/php/0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch
@@ -18,11 +18,9 @@  Signed-off-by: Claude Bing <cbing@cybernetics.com>
  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
-
diff --git a/meta-oe/recipes-devtools/php/php_8.1.7.bb b/meta-oe/recipes-devtools/php/php_8.1.7.bb
index e9e8eccf3a..043f3a81b2 100644
--- a/meta-oe/recipes-devtools/php/php_8.1.7.bb
+++ b/meta-oe/recipes-devtools/php/php_8.1.7.bb
@@ -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 \