php@7.0: 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.
This commit is contained in:
Kevin Abel 2018-04-03 22:58:34 -05:00 committed by ilovezfs
parent ac2b36d650
commit b1f6cd91bc

View file

@ -3,6 +3,7 @@ class PhpAT70 < Formula
homepage "https://secure.php.net/"
url "https://php.net/get/php-7.0.29.tar.xz/from/this/mirror"
sha256 "ca79d3ecc123bff4b623d4a1bbf5ad53ad39f5f2f5912fecc0ea97e95eba21cc"
revision 1
bottle do
sha256 "a69d7632ed603a87d4b9140258287ae60366dde630bc3ec35e4425371bbd669b" => :high_sierra
@ -76,7 +77,7 @@ class PhpAT70 < Formula
ENV.append "CPPFLAGS", "-DU_USING_ICU_NAMESPACE=1"
config_path = etc/"php/#{php_version}"
# Prevent system pear config from inhibitting pear install
# 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
@ -88,6 +89,7 @@ class PhpAT70 < 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
@ -197,7 +199,7 @@ class PhpAT70 < Formula
end
def post_install
pear_prefix = share/"pear"
pear_prefix = pkgshare/"pear"
pear_files = %W[
#{pear_prefix}/.depdblock
#{pear_prefix}/.filemap
@ -223,7 +225,8 @@ class PhpAT70 < Formula
php_ext_dir = opt_prefix/"lib/php"/php_basename
# fix pear config to install outside cellar
pear_path = HOMEBREW_PREFIX/"share/pear"
pear_path = HOMEBREW_PREFIX/"share/pear@#{php_version}"
cp_r pkgshare/"pear/.", pear_path
{
"php_ini" => etc/"php/#{php_version}/php.ini",
"php_dir" => pear_path,
@ -241,6 +244,8 @@ class PhpAT70 < Formula
system bin/"pear", "config-set", key, value, "system"
end
system bin/"pear", "update-channels"
%w[
opcache
].each do |e|