From 5d5f2957f5b44aff59f25994e5d076498d35c1a4 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Thu, 26 Jun 2014 02:12:52 +0200 Subject: [PATCH 1/2] Issue #42: Fix compiling of recent php versions --- files/brews/bison26.rb | 10 +++++----- lib/puppet/provider/php_version/php_source.rb | 11 +++++++++-- manifests/init.pp | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/files/brews/bison26.rb b/files/brews/bison26.rb index 692a2f8..8e41a1e 100644 --- a/files/brews/bison26.rb +++ b/files/brews/bison26.rb @@ -2,11 +2,11 @@ class Bisonphp26 < Formula homepage 'http://www.gnu.org/software/bison/' - url 'http://ftpmirror.gnu.org/bison/bison-2.6.5.tar.gz' - mirror 'http://ftp.gnu.org/gnu/bison/bison-2.6.5.tar.gz' - sha1 '2cea0ea4a41dcfc05332613060026de0af1458cc' + url 'http://ftpmirror.gnu.org/bison/bison-2.6.4.tar.gz' + mirror 'http://ftp.gnu.org/gnu/bison/bison-2.6.4.tar.gz' + sha1 '38adec0d7d0f556ec52e21ccbb87edd78327dd9b' - version '2.6.5-boxen1' + version '2.6.4-boxen1' keg_only :provided_by_osx, 'Some formulae require a newer version of bison.' @@ -15,4 +15,4 @@ def install "--prefix=#{prefix}" system "make install" end -end \ No newline at end of file +end diff --git a/lib/puppet/provider/php_version/php_source.rb b/lib/puppet/provider/php_version/php_source.rb index 8dfccf6..96bf543 100644 --- a/lib/puppet/provider/php_version/php_source.rb +++ b/lib/puppet/provider/php_version/php_source.rb @@ -169,7 +169,9 @@ def configure(version) env = "export ac_cv_exeext=''" # PHP 5.5+ requires a later version of Bison than OSX provides (2.6 vs 2.3) - env << " && export PATH=/opt/boxen/homebrew/opt/bisonphp26/bin:$PATH" unless @resource[:version].match(/\A5\.[34]/) + if Gem::Version.new(@resource[:version]) > Gem::Version.new('5.4.17') + env << " && export PATH=/opt/boxen/homebrew/opt/bisonphp26/bin:$PATH" + end # Construct and run configure command configure_command = "cd #{@resource[:phpenv_root]}/php-src/ && #{env} && ./configure #{args}" @@ -188,7 +190,12 @@ def configure(version) end def make - puts %x( cd #{@resource[:phpenv_root]}/php-src/ && make ) + # PHP > 5.4.17 requires a later version of Bison than OSX provides (2.6 vs 2.3) + if Gem::Version.new(@resource[:version]) > Gem::Version.new('5.4.17') + env = " && export PATH=/opt/boxen/homebrew/opt/bisonphp26/bin:$PATH" + end + + puts %x( cd #{@resource[:phpenv_root]}/php-src/ #{env} && make 2>&1 ) raise "Could not compile PHP @resource[:version]" unless $? == 0 end diff --git a/manifests/init.pp b/manifests/init.pp index 4c26730..828d74e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -94,7 +94,7 @@ } package { 'boxen/brews/bisonphp26': - ensure => '2.6.5-boxen1', + ensure => '2.6.4-boxen1', } # Install dupe version of zlib as tapping homebrew dupes appears to have From f519d760806349df2c64579be442ed8ff9bbda34 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Thu, 26 Jun 2014 09:57:51 +0200 Subject: [PATCH 2/2] Fix php_spec --- spec/classes/php_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/php_spec.rb b/spec/classes/php_spec.rb index 2845b4c..369dfb2 100644 --- a/spec/classes/php_spec.rb +++ b/spec/classes/php_spec.rb @@ -97,7 +97,7 @@ }) should contain_package("boxen/brews/bisonphp26").with({ - :ensure => "2.6.5-boxen1" + :ensure => "2.6.4-boxen1" }) should contain_exec("phpenv-setup-root-repo").with({