Skip to content
Browse files

Support a before_recipes in the pecl resource.

Fixes an incompatibility between libzmq3 installed by our zeromq::ppa
recipe and libzmq previously required by the zmq PHP extension.
  • Loading branch information...
1 parent 1e28763 commit 843d754b1fae907f8dfd0a1b1215d7ea5107cb4f @loicfrering loicfrering committed Mar 7, 2013
View
13 ci_environment/php/attributes/default.rb
@@ -9,7 +9,7 @@
'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") }
},
'memcached' => {
- 'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") },
+ 'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") },
'before_packages' => %w(libevent-dev libcloog-ppl0),
'before_script' => <<-EOF
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
@@ -22,8 +22,8 @@
'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") }
},
'amqp' => {
- 'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") },
- 'before_script' => <<-EOF
+ 'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") },
+ 'before_script' => <<-EOF
git clone git://github.com/alanxz/rabbitmq-c.git
cd rabbitmq-c
git submodule init
@@ -32,8 +32,9 @@
EOF
},
'pear.zero.mq/zmq-beta' => {
- 'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") },
- 'channel' => 'pear.zero.mq',
- 'before_packages' => %w(libzmq-dev)
+ 'versions' => default[:php][:multi][:versions].reject { |version| version.start_with?("5.5") },
+ 'before_recipes' => %w(zeromq::ppa),
+ 'before_packages' => %w(libzmq3-dev),
+ 'channel' => 'pear.zero.mq'
}
}
View
4 ci_environment/php/providers/pecl.rb
@@ -3,6 +3,10 @@
extension = new_resource.extension
versions = new_resource.versions
+ new_resource.before_recipes.each do |recipe|
+ @run_context.include_recipe recipe
+ end
+
new_resource.before_packages.each do |pkg|
package pkg do
action :install
View
1 ci_environment/php/recipes/extensions.rb
@@ -5,6 +5,7 @@
php_pecl php_extension do
channel options['channel']
versions options['versions'] || node.php.multi.versions
+ before_recipes options['before_recipes']
before_packages options['before_packages']
before_script options['before_script']
owner node.travis_build_environment.user
View
1 ci_environment/php/resources/pecl.rb
@@ -3,6 +3,7 @@
attribute :extension, :kind_of => String, :name_attribute => true
attribute :channel, :kind_of => String
attribute :versions, :kind_of => Array
+attribute :before_recipes, :kind_of => Array, :default => []
attribute :before_packages, :kind_of => Array, :default => []
attribute :before_script, :kind_of => String
attribute :owner, :regex => Chef::Config[:user_valid_regex]

0 comments on commit 843d754

Please sign in to comment.
Something went wrong with that request. Please try again.