commit e92ff736adfb0fd7a4ab0d56037eec3bf625cfef Author: Michael Osipov Date: 2022-09-21T16:47:09+02:00 devel/pear: update to 1.10.13 This not only updates the port, but also unbreaks the segmentation fault on PHP 8.2 which was caused by a meanwhile unnecessary patch hunk for go-pear.php. The bug in PHP 8.2 was reported upstream: https://github.com/php/php-src/issues/9589 diff --git a/Mk/Uses/pear.mk b/Mk/Uses/pear.mk index d18d2b20e9ab..0496dded11b9 100644 --- a/Mk/Uses/pear.mk +++ b/Mk/Uses/pear.mk @@ -22,7 +22,7 @@ IGNORE= Incorrect 'USES+= pear:${pear_ARGS}' usage: argument [${arg}] is not rec . endif . endfor -_pear_IGNORE_WITH_PHP= 82 +_pear_IGNORE_WITH_PHP= IGNORE_WITH_PHP?= ${_pear_IGNORE_WITH_PHP} php_ARGS+= flavors .include "${USESDIR}/php.mk" diff --git a/devel/pear/Makefile b/devel/pear/Makefile index ae76c3fc19cd..77eb05998219 100644 --- a/devel/pear/Makefile +++ b/devel/pear/Makefile @@ -1,6 +1,5 @@ PORTNAME= pear -PORTVERSION= 1.10.12 -PORTREVISION= 0 +PORTVERSION= 1.10.13 CATEGORIES= devel MASTER_SITES= http://build.dimapanov.com/~fluffy/distfiles/ \ LOCAL/fluffy \ @@ -19,7 +18,6 @@ NO_BUILD= yes NO_ARCH= yes USE_PHP= pcre:build xml:build zlib:build -IGNORE_WITH_PHP=82 PEARDIR= ${PREFIX}/share/pear @@ -30,16 +28,14 @@ post-patch: -e "s|%%BUNDLEDIR%%|${WRKSRC}/go-pear-bundle|" \ -e "s|%%TMPDIR%%|/tmp/pear|" \ ${WRKSRC}/go-pear - @cd ${WRKSRC}/go-pear-bundle && ${MKDIR} tmp && ${TAR} -C tmp -xf PEAR-${PORTVERSION}.tar + @cd ${WRKSRC}/go-pear-bundle && ${MKDIR} tmp && ${TAR} -C tmp -xzf PEAR-${PORTVERSION}.tgz @cd ${WRKSRC}/go-pear-bundle/tmp/PEAR-${PORTVERSION} && ${PATCH} -s -p0 < ${FILESDIR}/extra-patch-PEAR-Config.php @${RM} ${WRKSRC}/go-pear-bundle/tmp/PEAR-${PORTVERSION}/PEAR/Config.php.orig @${MD5} -q ${WRKSRC}/go-pear-bundle/tmp/PEAR-${PORTVERSION}/PEAR/Config.php > ${WRKSRC}/Config.php.md5 - @cd ${WRKSRC}/go-pear-bundle/tmp && ${TAR} -cf ../PEAR-${PORTVERSION}.tar PEAR-${PORTVERSION} package.xml + @cd ${WRKSRC}/go-pear-bundle/tmp && ${TAR} -czf ../PEAR-${PORTVERSION}.tgz PEAR-${PORTVERSION} package.xml do-install: @cd ${WRKSRC} && ${SETENV} DESTDIR=${STAGEDIR} ${LOCALBASE}/bin/php -q ./go-pear - @${SED} -i "" "s| 'https://raw.github.com/pear/pear-core/master/PEAR5.php', + 'PEAR.php' => 'https://raw.github.com/pear/pear-core/master/PEAR.php', + 'Archive/Tar.php' => 'https://raw.github.com/pear/Archive_Tar/master/Archive/Tar.php', + 'Console/Getopt.php' => 'https://raw.github.com/pear/Console_Getopt/trunk/Console/Getopt.php', +@@ -125,7 +127,7 @@ $bootstrap_pkgs = array( // uses URL like http://pear. ); $installer_packages = array( @@ -18,16 +39,16 @@ 'Structures_Graph-stable', 'Archive_Tar-stable', 'Console_Getopt-stable', -@@ -250,7 +252,7 @@ if (WEBINSTALLER) { +@@ -259,7 +261,7 @@ if (WEBINSTALLER) { } - // Anything past this step has something to do with the installation + // Anything past this step has something to do with the installation } - +/* if (!WEBINSTALLER) { $tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r'); -@@ -294,7 +296,7 @@ If you wish to abort, press Control-C now, or press En +@@ -303,7 +305,7 @@ If you wish to abort, press Control-C now, or press En $http_proxy = $tmp; } } @@ -36,7 +57,7 @@ $origpwd = getcwd(); $config_vars = array_keys($config_desc); -@@ -345,7 +347,7 @@ we strongly recommand to use it. +@@ -354,7 +356,7 @@ we strongly recommand to use it. break; } } @@ -45,7 +66,7 @@ while (!WEBINSTALLER) { print " Below is a suggested file layout for your new PEAR installation. To -@@ -428,7 +430,7 @@ If you have a CLI (or CGI) php.exe available, we stron +@@ -437,7 +439,7 @@ If you have a CLI (or CGI) php.exe available, we stron } } } @@ -54,7 +75,7 @@ #### # Installation stuff #### -@@ -488,7 +490,7 @@ full write access to this directory and the install di +@@ -497,7 +499,7 @@ full write access to this directory and the install di continue; } @@ -63,7 +84,7 @@ if (!@is_dir($dir)) { if (!mkdir_p($dir)) { if (!WEBINSTALLER) { -@@ -561,7 +563,7 @@ if (WEBINSTALLER) { +@@ -570,7 +572,7 @@ if (WEBINSTALLER) { ob_start(); } } @@ -72,7 +93,7 @@ if (!WEBINSTALLER) { $msg = "The following PEAR packages are bundled with PHP: " . implode(', ', array_keys($pfc_packages)); -@@ -571,17 +573,19 @@ if (!WEBINSTALLER) { +@@ -580,17 +582,17 @@ if (!WEBINSTALLER) { $install_optional_packages = array(); print "\n"; } @@ -82,8 +103,6 @@ # Download #### -+dl('xml.so'); -+ if (function_exists('set_include_path')) { - set_include_path($ptmp); + set_include_path($ptmp . PATH_SEPARATOR . "%%BUNDLEDIR%%"); @@ -96,7 +115,7 @@ if (!extension_loaded('zlib') && !WEBINSTALLER) { // In Web context we could be in multithread env which makes dl() end up with a fatal error. if (WINDOWS) { @dl('php_zlib.dll'); -@@ -606,18 +610,19 @@ print "Loading zlib: ".($have_gzip ? 'ok' : 'failed'). +@@ -615,18 +617,19 @@ print "Loading zlib: ".($have_gzip ? 'ok' : 'failed'). if (!$have_gzip) { print "Downloading uncompressed packages\n"; }; @@ -118,7 +137,7 @@ } // gopear_bundle usage -@@ -645,19 +650,21 @@ displayHTMLProgress($progress = 5); +@@ -654,19 +657,20 @@ displayHTMLProgress($progress = 5); // Bootstrap needed ? $nobootstrap = false; @@ -129,8 +148,8 @@ $nobootstrap &= is_file($php_dir.'/'.$file); } } +- +*/ - if ($nobootstrap) { print('Using previously install ... '); if (function_exists('set_include_path')) { @@ -142,32 +161,24 @@ } include_once 'PEAR.php'; print "ok\n"; -@@ -691,6 +698,7 @@ displayHTMLProgress($progress = 20); +@@ -700,6 +704,7 @@ displayHTMLProgress($progress = 20); // Extract needed ? $noextract = false; +/* if (is_dir($php_dir)) { $noextract = @include_once 'PEAR/Registry.php'; - -@@ -701,6 +709,7 @@ if (is_dir($php_dir)) { + +@@ -710,7 +715,7 @@ if (is_dir($php_dir)) { } } } +- +*/ - if ($noextract) { print('Using previously installed installer ... '); -@@ -722,7 +731,7 @@ if ($noextract) { - displayHTMLProgress($progress += round(19 / count($bootstrap_pkgs))); - - $fullpkg = substr($tarball, 0, strrpos($tarball, '.')); -- $tar = &new Archive_Tar($tarball, $have_gzip); -+ $tar = new Archive_Tar($tarball, $have_gzip); - if (!$tar->extractModify($ptmp, $fullpkg)) { - bail("Extraction for $fullpkg failed!\n"); - } -@@ -747,13 +756,8 @@ include_once "PEAR/Config.php"; + print "ok\n"; +@@ -756,13 +761,8 @@ include_once "PEAR/Config.php"; include_once "PEAR/Command.php"; include_once "PEAR/Registry.php"; @@ -182,7 +193,7 @@ $config->set('preferred_state', 'stable'); foreach ($config_vars as $var) { if (isset($$var) && $$var != '') { -@@ -765,7 +769,7 @@ $config->set('temp_dir', $temp_dir); +@@ -774,7 +774,7 @@ $config->set('temp_dir', $temp_dir); $config->set('http_proxy', $http_proxy); $config->store(); @@ -191,7 +202,7 @@ PEAR_Command::setFrontendType('CLI'); PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently -@@ -787,6 +791,11 @@ foreach ($to_install as $pkg) { +@@ -796,6 +796,11 @@ foreach ($to_install as $pkg) { } else { $options = array('onlyreqdeps' => true); } @@ -203,7 +214,7 @@ if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) { print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n"); displayHTMLProgress($progress += round(50 / count($to_install))); -@@ -821,7 +830,7 @@ displayHTMLProgress($progress = 99); +@@ -830,7 +835,7 @@ displayHTMLProgress($progress = 99); // Base installation finished @@ -212,7 +223,7 @@ ini_restore("include_path"); if (!WEBINSTALLER) { -@@ -980,6 +989,7 @@ if ( WINDOWS ) { +@@ -993,6 +998,7 @@ if ( WINDOWS ) { if (WINDOWS && !WEBINSTALLER) { win32CreateRegEnv(); } @@ -220,7 +231,7 @@ // Set of functions following /** * Parse the given dirname -@@ -1134,7 +1144,7 @@ function which($program, $dont_search_in = false) +@@ -1179,7 +1185,7 @@ function which($program, $dont_search_in = false) if (!strlen($dir)) { continue; } @@ -229,13 +240,13 @@ $dir .= '\\'; } $tmp = $dir . $program; -@@ -1418,19 +1428,17 @@ function detect_install_dirs($_prefix = null) { +@@ -1463,19 +1469,17 @@ function detect_install_dirs($_prefix = null) { } } else { if ($_prefix === null) { - #$prefix = dirname(PHP_BINDIR); - $prefix = dirname(__FILE__); -+ $prefix = '%%PREFIX%%'; ++ $prefix = '%%PREFIX%%'; } else { $prefix = $_prefix; } @@ -249,12 +260,12 @@ $test_dir = '$php_dir/tests'; - $temp_dir = '$prefix/temp'; - -+ $temp_dir = '%%TMPDIR%%'; ++ $temp_dir = '%%TMPDIR%%'; +/* // check if the user has installed PHP with PHP or GNU layout if (@is_dir("$prefix/lib/php/.registry")) { $php_dir = '$prefix/lib/php'; -@@ -1442,6 +1450,7 @@ function detect_install_dirs($_prefix = null) { +@@ -1487,6 +1491,7 @@ function detect_install_dirs($_prefix = null) { } elseif (@is_dir("$prefix/share/php/.registry")) { $php_dir = '$prefix/share/php'; }