-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php: Fully version the pear repository #26137
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 @@ def install | |
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 @@ def install | |
--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 @@ def caveats | |
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 @@ def post_install | |
|
||
# fix pear config to install outside cellar | ||
pear_path = HOMEBREW_PREFIX/"share/pear" | ||
cp_r pkgshare/"pear/.", pear_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this re-runnable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is. I've run it quite a few times in testing just to make sure that it didn't override manually installed things and keeps the upstream installed files in sync. Of course more robust testing from other users would be greatly appreciated (we all know what works4me gets). |
||
{ | ||
"php_ini" => etc/"php/#{php_version}/php.ini", | ||
"php_dir" => pear_path, | ||
|
@@ -237,6 +243,8 @@ def post_install | |
system bin/"pear", "config-set", key, value, "system" | ||
end | ||
|
||
system bin/"pear", "update-channels" | ||
|
||
%w[ | ||
opcache | ||
].each do |e| | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be wary of deleting user files here. Additionally, bear in mind this won't work for bottled installs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit wary, but pear has a two-tier configuration system that provides a "system" config and a "user" config. Users should not be modifying the system config and the post_install will rebuild it. The guard is there specifically for source builds, as anyone that has this config file with configuration pointed at a pear repository where the pear files are already installed will skip the pear installation of binaries in the cellar. The would mean build from source upgrades would be missing the
pear
andpecl
binaries.