Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #43 from webflo/fix-compile
Browse files Browse the repository at this point in the history
Issue #42: Fix compiling of recent php versions
  • Loading branch information
mattheath committed Jun 26, 2014
2 parents 43833fd + f519d76 commit 914f403
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
10 changes: 5 additions & 5 deletions files/brews/bison26.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.'

Expand All @@ -15,4 +15,4 @@ def install
"--prefix=#{prefix}"
system "make install"
end
end
end
11 changes: 9 additions & 2 deletions lib/puppet/provider/php_version/php_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 914f403

Please sign in to comment.