From 28c91c5b3ccd95ce810981ff904584d7bf34a15a Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Tue, 3 Apr 2018 22:58:01 -0500 Subject: [PATCH] php: fully version pear repo A shared version is still possible with user configuration, but we should follow the versioned policies to avoid link problems between versions. --- Formula/php.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Formula/php.rb b/Formula/php.rb index f7b7cc0798..705b652e78 100644 --- a/Formula/php.rb +++ b/Formula/php.rb @@ -1,8 +1,9 @@ class Php < Formula desc "General-purpose scripting language" - homepage "https://php.net/" + homepage "https://secure.php.net/" url "https://php.net/get/php-7.2.4.tar.xz/from/this/mirror" sha256 "7916b1bd148ddfd46d7f8f9a517d4b09cd8a8ad9248734e7c8dd91ef17057a88" + revision 1 bottle do sha256 "465136132568d7b316e8cec31569aa67af7ce8b6d4e472a55d78c0fbdf22401b" => :high_sierra @@ -71,6 +72,9 @@ class Php < Formula ENV.append "CPPFLAGS", "-DU_USING_ICU_NAMESPACE=1" config_path = etc/"php/#{php_version}" + # Prevent system pear config from inhibiting pear install + (config_path/"pear.conf").delete if (config_path/"pear.conf").exist? + # Prevent homebrew from harcoding path to sed shim in phpize script ENV["lt_cv_path_SED"] = "sed" @@ -80,6 +84,7 @@ class Php < Formula --sysconfdir=#{config_path} --with-config-file-path=#{config_path} --with-config-file-scan-dir=#{config_path}/conf.d + --with-pear=#{pkgshare}/pear --enable-bcmath --enable-calendar --enable-dba @@ -193,7 +198,7 @@ class Php < Formula end def post_install - pear_prefix = share/"pear" + pear_prefix = pkgshare/"pear" pear_files = %W[ #{pear_prefix}/.depdblock #{pear_prefix}/.filemap @@ -220,6 +225,7 @@ class Php < Formula # fix pear config to install outside cellar pear_path = HOMEBREW_PREFIX/"share/pear" + cp_r pkgshare/"pear/.", pear_path { "php_ini" => etc/"php/#{php_version}/php.ini", "php_dir" => pear_path, @@ -237,6 +243,8 @@ class Php < Formula system bin/"pear", "config-set", key, value, "system" end + system bin/"pear", "update-channels" + %w[ opcache ].each do |e|