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

Commit 914f403

Browse files
committed
Merge pull request #43 from webflo/fix-compile
Issue #42: Fix compiling of recent php versions
2 parents 43833fd + f519d76 commit 914f403

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

files/brews/bison26.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
class Bisonphp26 < Formula
44
homepage 'http://www.gnu.org/software/bison/'
5-
url 'http://ftpmirror.gnu.org/bison/bison-2.6.5.tar.gz'
6-
mirror 'http://ftp.gnu.org/gnu/bison/bison-2.6.5.tar.gz'
7-
sha1 '2cea0ea4a41dcfc05332613060026de0af1458cc'
5+
url 'http://ftpmirror.gnu.org/bison/bison-2.6.4.tar.gz'
6+
mirror 'http://ftp.gnu.org/gnu/bison/bison-2.6.4.tar.gz'
7+
sha1 '38adec0d7d0f556ec52e21ccbb87edd78327dd9b'
88

9-
version '2.6.5-boxen1'
9+
version '2.6.4-boxen1'
1010

1111
keg_only :provided_by_osx, 'Some formulae require a newer version of bison.'
1212

@@ -15,4 +15,4 @@ def install
1515
"--prefix=#{prefix}"
1616
system "make install"
1717
end
18-
end
18+
end

lib/puppet/provider/php_version/php_source.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def configure(version)
169169
env = "export ac_cv_exeext=''"
170170

171171
# PHP 5.5+ requires a later version of Bison than OSX provides (2.6 vs 2.3)
172-
env << " && export PATH=/opt/boxen/homebrew/opt/bisonphp26/bin:$PATH" unless @resource[:version].match(/\A5\.[34]/)
172+
if Gem::Version.new(@resource[:version]) > Gem::Version.new('5.4.17')
173+
env << " && export PATH=/opt/boxen/homebrew/opt/bisonphp26/bin:$PATH"
174+
end
173175

174176
# Construct and run configure command
175177
configure_command = "cd #{@resource[:phpenv_root]}/php-src/ && #{env} && ./configure #{args}"
@@ -188,7 +190,12 @@ def configure(version)
188190
end
189191

190192
def make
191-
puts %x( cd #{@resource[:phpenv_root]}/php-src/ && make )
193+
# PHP > 5.4.17 requires a later version of Bison than OSX provides (2.6 vs 2.3)
194+
if Gem::Version.new(@resource[:version]) > Gem::Version.new('5.4.17')
195+
env = " && export PATH=/opt/boxen/homebrew/opt/bisonphp26/bin:$PATH"
196+
end
197+
198+
puts %x( cd #{@resource[:phpenv_root]}/php-src/ #{env} && make 2>&1 )
192199
raise "Could not compile PHP @resource[:version]" unless $? == 0
193200
end
194201

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
}
9595

9696
package { 'boxen/brews/bisonphp26':
97-
ensure => '2.6.5-boxen1',
97+
ensure => '2.6.4-boxen1',
9898
}
9999

100100
# Install dupe version of zlib as tapping homebrew dupes appears to have

spec/classes/php_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
})
9898

9999
should contain_package("boxen/brews/bisonphp26").with({
100-
:ensure => "2.6.5-boxen1"
100+
:ensure => "2.6.4-boxen1"
101101
})
102102

103103
should contain_exec("phpenv-setup-root-repo").with({

0 commit comments

Comments
 (0)