Skip to content

Instantly share code, notes, and snippets.

@futoase
Created March 2, 2012 09:30
Show Gist options
  • Select an option

  • Save futoase/1957187 to your computer and use it in GitHub Desktop.

Select an option

Save futoase/1957187 to your computer and use it in GitHub Desktop.
PHP 5.4.0 Release向け homebrew Formulaファイル(レシピ)。 /usr/local/Library/Formula にコピーして brew install php54.
require 'formula'
class Php54 < Formula
url 'http://downloads.php.net/stas/php-5.4.0.tar.gz'
version '5.4'
homepage 'http://www.php.net/'
md5 '46b72e274c6ea7e775245ffdb81c9ce5'
depends_on 'mysql'
def options
[
["--disable-mbstring", "disable multibyte string support"],
["--disable-mysql", "disable MySQL support"],
["--enable-dtrace", "enable Dtrace support"],
["--disable-zip", "disable zip support"]
]
end
def install
args = ["--prefix=#{prefix}",
"--with-mysql=#{`brew --prefix mysql`.strip}",
"--enable-mbstring",
"--enable-zip"
]
if ARGV.include? '--disable-mbstring'
args -= ["--enable-mbstring"]
end
if ARGV.include? '--disable-mysql'
args -= ["--with-mysql=#{`brew --prefix mysql`.strip}"]
end
if ARGV.include? '--enable-dtrace'
args << "--enable-dtrace"
end
if ARGV.include? '--disable-zip'
args -= ["--enable-zip"]
end
system "./configure", *args
inreplace 'Makefile' do |s|
s.change_make_var! "program_suffix", "54"
end
system "make install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment