summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortduehr <td@matasano.com>2015-06-25 09:15:55 -0500
committertduehr <td@matasano.com>2015-06-25 09:15:55 -0500
commit794b85ad5ec68695f6dcd85095cbc09216a6a1e7 (patch)
treee3f769ac21590b2b9c43a72447fa6de8dd13b0ae
parent08d820711c67613eb30463e581913ec864a3ffc0 (diff)
parent78c2ec93725d8aecbb48da4872f4f94a59cc0f8e (diff)
downloadffi-794b85ad5ec68695f6dcd85095cbc09216a6a1e7.tar.gz
Merge pull request #439 from larskanis/add-rake-compiler-dock
Simplify cross build tasks and add rake-compiler-dock for building Windows binary gems.
-rw-r--r--Gemfile1
-rw-r--r--Rakefile20
-rw-r--r--ffi.gemspec1
3 files changed, 10 insertions, 12 deletions
diff --git a/Gemfile b/Gemfile
index 213ea1d..da76ca9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
group :development do
gem 'rake', '~> 10.1'
gem 'rake-compiler', '~> 0.9.5'
+ gem 'rake-compiler-dock', '~> 0.3.1'
gem 'rspec', '~> 3.0'
gem 'rubygems-tasks', '~> 0.2.4', :require => 'rubygems/tasks'
gem "rubysl", "~> 2.0", :platforms => 'rbx'
diff --git a/Rakefile b/Rakefile
index 3aa7a75..98d14d2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -169,27 +169,23 @@ if USE_RAKE_COMPILER
ext.cross_platform = %w[i386-mingw32 x64-mingw32] # forces the Windows platform instead of the default one
end
- task 'gem:win32' => ['gem:win32-x64', 'gem:win32-i386']
+ ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0:2.1.5:2.2.1'
- task 'gem:win32-i386' do
- sh("rake cross native:i386-mingw32 gem RUBY_CC_VERSION='1.8.7:1.9.3:2.0.0:2.1.5:2.2.1'") || raise("win32-i386 build failed!")
- end
-
- task 'gem:win32-x64' do
- sh("rake cross native:x64-mingw32 gem RUBY_CC_VERSION='2.0.0:2.1.5:2.2.1'") || raise("win32-x64 build failed!")
- end
-
- (ENV['RUBY_CC_VERSION'] || '1.8.7:1.9.3:2.0.0:2.1.5:2.2.1' ).to_s.split(':').each do |ruby_version|
+ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
task "copy:ffi_c:i386-mingw32:#{ruby_version}" do |t|
sh "i686-w64-mingw32-strip -S #{BUILD_DIR}/i386-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
end
- end
- (ENV['RUBY_CC_VERSION'] || '2.0.0:2.1.5:2.2.1' ).to_s.split(':').each do |ruby_version|
task "copy:ffi_c:x64-mingw32:#{ruby_version}" do |t|
sh "x86_64-w64-mingw32-strip -S #{BUILD_DIR}/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
end
end
+
+ desc "build a windows gem without all the ceremony."
+ task "gem:windows" do
+ require "rake_compiler_dock"
+ RakeCompilerDock.sh "bundle && rake cross native gem MAKE='nice make -j`nproc`'"
+ end
end
Gem::Tasks.new do |t|
diff --git a/ffi.gemspec b/ffi.gemspec
index 7b5b6e3..841cc7a 100644
--- a/ffi.gemspec
+++ b/ffi.gemspec
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 1.8.7'
s.add_development_dependency 'rake', '~> 10.1'
s.add_development_dependency 'rake-compiler', '~> 0.9'
+ s.add_development_dependency 'rake-compiler-dock', '~> 0.3.1'
s.add_development_dependency 'rspec', '~> 2.14.1'
s.add_development_dependency 'rubygems-tasks', "~> 0.2.4"
end