From ff98c1506590f160b3d97a6b5df00123dc702a40 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 7 Oct 2024 07:07:23 -0500 Subject: php: add v7.4.33, v8.3.12 (fix CVEs) (#46829) * php: add v7.4.33, v8.3.12 * php: mv sbang.patch sbang-7.patch * php: add sbang-8.patch * [@spackbot] updating style on behalf of wdconinc * Replace --with-libiconv= (not recognized) with --with-iconv= --------- Co-authored-by: wdconinc Co-authored-by: Bernhard Kaindl --- var/spack/repos/builtin/packages/php/package.py | 45 +++++++++++++++++----- var/spack/repos/builtin/packages/php/sbang-7.patch | 42 ++++++++++++++++++++ var/spack/repos/builtin/packages/php/sbang-8.patch | 42 ++++++++++++++++++++ var/spack/repos/builtin/packages/php/sbang.patch | 42 -------------------- 4 files changed, 119 insertions(+), 52 deletions(-) create mode 100644 var/spack/repos/builtin/packages/php/sbang-7.patch create mode 100644 var/spack/repos/builtin/packages/php/sbang-8.patch delete mode 100644 var/spack/repos/builtin/packages/php/sbang.patch diff --git a/var/spack/repos/builtin/packages/php/package.py b/var/spack/repos/builtin/packages/php/package.py index 9abe26f281..6de2f97c2b 100644 --- a/var/spack/repos/builtin/packages/php/package.py +++ b/var/spack/repos/builtin/packages/php/package.py @@ -19,15 +19,32 @@ class Php(AutotoolsPackage): license("PHP-3.01") - version("7.4.1", sha256="4d9d7c5681bec3af38a935d033657dce09a9913498f8022d7ca163a7f2f493a7") - version("7.4.0", sha256="91d34b48025ab9789216df89e247b6904912eeeaeff38c300ef314bdda8920b0") - version("7.3.13", sha256="e68b8d9e659f2993eee912f05860e546fdc18e459f31cd2771f404df21285f0b") - version("7.3.12", sha256="d0672ea84c0ab184f636acff3230d376d89a2067d59a87a2f1842361ee1f97d6") - version("7.3.11", sha256="4d861b2f3bc640ded8b591ce87250161392a6244a3c84042da0c06fd8c500eb2") - version("7.2.26", sha256="da132a836cec8021c00f22952e6044d91628ee3d2ef92a95d65cf91bad810600") - version("7.2.25", sha256="049b2d291c45cb889d15fcd2bac6da7d15ca5d535d272d2f8879fb834bbf276e") - version("7.2.24", sha256="334c9915733f6a29e1462f64038b1b4b1b21cb18f4f5f980add86792b5550ab3") - version("7.1.33", sha256="f80a795a09328a9441bae4a8a60fa0d6d43ec5adc98f5aa5f51d06f4522c07fe") + version("8.3.12", sha256="d5d4e6ffc6d6b2f02a87c45741623e08045ec6509ade44a1033e0f8bbb374119") + version("7.4.33", sha256="dfbb2111160589054768a37086bda650a0041c89878449d078684d70d6a0e411") + with default_args(deprecated=True): + version("7.4.1", sha256="4d9d7c5681bec3af38a935d033657dce09a9913498f8022d7ca163a7f2f493a7") + version("7.4.0", sha256="91d34b48025ab9789216df89e247b6904912eeeaeff38c300ef314bdda8920b0") + version( + "7.3.13", sha256="e68b8d9e659f2993eee912f05860e546fdc18e459f31cd2771f404df21285f0b" + ) + version( + "7.3.12", sha256="d0672ea84c0ab184f636acff3230d376d89a2067d59a87a2f1842361ee1f97d6" + ) + version( + "7.3.11", sha256="4d861b2f3bc640ded8b591ce87250161392a6244a3c84042da0c06fd8c500eb2" + ) + version( + "7.2.26", sha256="da132a836cec8021c00f22952e6044d91628ee3d2ef92a95d65cf91bad810600" + ) + version( + "7.2.25", sha256="049b2d291c45cb889d15fcd2bac6da7d15ca5d535d272d2f8879fb834bbf276e" + ) + version( + "7.2.24", sha256="334c9915733f6a29e1462f64038b1b4b1b21cb18f4f5f980add86792b5550ab3" + ) + version( + "7.1.33", sha256="f80a795a09328a9441bae4a8a60fa0d6d43ec5adc98f5aa5f51d06f4522c07fe" + ) depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated @@ -39,10 +56,13 @@ class Php(AutotoolsPackage): depends_on("pkgconfig", type="build") depends_on("bison", type="build") depends_on("re2c", type="build") + depends_on("bash", type="build") + depends_on("libiconv", when="@8:") depends_on("libxml2") depends_on("sqlite") - patch("sbang.patch") + patch("sbang-7.patch", when="@7") + patch("sbang-8.patch", when="@8") def patch(self): """ @@ -68,3 +88,8 @@ class Php(AutotoolsPackage): def autoreconf(self, spec, prefix): bash = which("bash") bash("./buildconf", "--force") + + @when("@8:") + def configure_args(self): + args = [f"--with-iconv={self.spec['libiconv'].prefix}"] + return args diff --git a/var/spack/repos/builtin/packages/php/sbang-7.patch b/var/spack/repos/builtin/packages/php/sbang-7.patch new file mode 100644 index 0000000000..aca17c8ff3 --- /dev/null +++ b/var/spack/repos/builtin/packages/php/sbang-7.patch @@ -0,0 +1,42 @@ +--- spack-src/ext/phar/phar/pharcommand.inc.org 2019-12-18 01:35:53.000000000 +0900 ++++ spack-src/ext/phar/phar/pharcommand.inc 2020-08-20 12:26:16.207347572 +0900 +@@ -68,6 +68,12 @@ + 'inf' => ' Hash-bang line to start the archive (e.g. #!/usr/bin/php). The hash ' + .' mark itself \'#!\' and the newline character are optional.' + ), ++ 'z' => array( ++ 'typ' => 'any', ++ 'val' => NULL, ++ 'inf' => ' Hash-bang line to start the archive for spack. The hash ' ++ .' mark itself \'#!\' and the newline character are optional.' ++ ), + 'c' => array( + 'typ' => 'compalg', + 'val' => NULL, +@@ -455,7 +461,7 @@ + */ + static function cli_cmd_arg_pack() + { +- $args = self::phar_args('abcFhilpsxy', 'pharnew'); ++ $args = self::phar_args('azbcFhilpsxy', 'pharnew'); + + $args[''] = array( + 'typ' => 'any', +@@ -560,6 +566,7 @@ + } + + $alias = $this->args['a']['val']; ++ $spack_hb = $this->args['z']['val']; + $hashbang = $this->args['b']['val']; + $archive = $this->args['f']['val']; + $hash = $this->args['h']['val']; +@@ -571,6 +578,9 @@ + $invregex = $this->args['x']['val']; + $input = $this->args['']['val']; + ++ if (isset($spack_hb)) { ++ $hashbang = "$spack_hb\n"; ++ } + $hash = self::phar_check_hash($hash, $privkey); + + $phar = new Phar($archive, 0, $alias); diff --git a/var/spack/repos/builtin/packages/php/sbang-8.patch b/var/spack/repos/builtin/packages/php/sbang-8.patch new file mode 100644 index 0000000000..c9afec864a --- /dev/null +++ b/var/spack/repos/builtin/packages/php/sbang-8.patch @@ -0,0 +1,42 @@ +--- a/ext/phar/phar/pharcommand.inc.org ++++ b/ext/phar/phar/pharcommand.inc +@@ -68,6 +68,12 @@ class PharCommand extends CLICommand + 'inf' => ' Hash-bang line to start the archive (e.g. #!/usr/bin/php). The hash ' + .' mark itself \'#!\' and the newline character are optional.' + ), ++ 'z' => array( ++ 'typ' => 'any', ++ 'val' => NULL, ++ 'inf' => ' Hash-bang line to start the archive for spack. The hash ' ++ .' mark itself \'#!\' and the newline character are optional.' ++ ), + 'c' => array( + 'typ' => 'compalg', + 'val' => NULL, +@@ -467,7 +473,7 @@ class PharCommand extends CLICommand + */ + static function cli_cmd_arg_pack() + { +- $args = self::phar_args('abcFhilpsxy', 'pharnew'); ++ $args = self::phar_args('azbcFhilpsxy', 'pharnew'); + + $args[''] = array( + 'typ' => 'any', +@@ -572,6 +578,7 @@ class PharCommand extends CLICommand + } + + $alias = $this->args['a']['val']; ++ $spack_hb = $this->args['z']['val']; + $hashbang = $this->args['b']['val']; + $archive = $this->args['f']['val']; + $hash = $this->args['h']['val']; +@@ -583,6 +590,9 @@ class PharCommand extends CLICommand + $invregex = $this->args['x']['val']; + $input = $this->args['']['val']; + ++ if (isset($spack_hb)) { ++ $hashbang = "$spack_hb\n"; ++ } + $hash = self::phar_check_hash($hash, $privkey); + + $phar = new Phar($archive, 0, $alias); diff --git a/var/spack/repos/builtin/packages/php/sbang.patch b/var/spack/repos/builtin/packages/php/sbang.patch deleted file mode 100644 index aca17c8ff3..0000000000 --- a/var/spack/repos/builtin/packages/php/sbang.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- spack-src/ext/phar/phar/pharcommand.inc.org 2019-12-18 01:35:53.000000000 +0900 -+++ spack-src/ext/phar/phar/pharcommand.inc 2020-08-20 12:26:16.207347572 +0900 -@@ -68,6 +68,12 @@ - 'inf' => ' Hash-bang line to start the archive (e.g. #!/usr/bin/php). The hash ' - .' mark itself \'#!\' and the newline character are optional.' - ), -+ 'z' => array( -+ 'typ' => 'any', -+ 'val' => NULL, -+ 'inf' => ' Hash-bang line to start the archive for spack. The hash ' -+ .' mark itself \'#!\' and the newline character are optional.' -+ ), - 'c' => array( - 'typ' => 'compalg', - 'val' => NULL, -@@ -455,7 +461,7 @@ - */ - static function cli_cmd_arg_pack() - { -- $args = self::phar_args('abcFhilpsxy', 'pharnew'); -+ $args = self::phar_args('azbcFhilpsxy', 'pharnew'); - - $args[''] = array( - 'typ' => 'any', -@@ -560,6 +566,7 @@ - } - - $alias = $this->args['a']['val']; -+ $spack_hb = $this->args['z']['val']; - $hashbang = $this->args['b']['val']; - $archive = $this->args['f']['val']; - $hash = $this->args['h']['val']; -@@ -571,6 +578,9 @@ - $invregex = $this->args['x']['val']; - $input = $this->args['']['val']; - -+ if (isset($spack_hb)) { -+ $hashbang = "$spack_hb\n"; -+ } - $hash = self::phar_check_hash($hash, $privkey); - - $phar = new Phar($archive, 0, $alias); -- cgit v1.2.3-70-g09d2