forked from archseer/glu
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
69 lines (58 loc) · 2.22 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- coding: UTF-8 -*-
#-*-ruby-*-
#
# Copyright (C) 2006 John M. Gabriele <[email protected]>
# Copyright (C) Eric Hodel <[email protected]>
#
# This program is distributed under the terms of the MIT license.
# See the included MIT-LICENSE file for the terms of this license.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
require 'hoe'
require 'rake/extensiontask'
hoe = Hoe.spec 'glu' do
developer 'Eric Hodel', '[email protected]'
developer 'Lars Kanis', ''
developer 'Blaž Hrastnik', '[email protected]'
developer 'Alain Hoang', ''
developer 'Jan Dvorak', ''
developer 'Minh Thu Vo', ''
developer 'James Adam', ''
self.readme_file = 'README.rdoc'
self.history_file = 'History.rdoc'
self.extra_rdoc_files = FileList['*.rdoc']
extra_dev_deps << ['rake-compiler', '~> 1.0']
extra_dev_deps << ['rake-compiler-dock', '~> 0.6.0']
self.spec_extras = {
:extensions => %w[ext/glu/extconf.rb],
:required_ruby_version => '>= 1.9.2',
}
end
Rake::ExtensionTask.new 'glu', hoe.spec do |ext|
ext.lib_dir = 'lib/glu'
ext.cross_compile = true
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
end
# To reduce the gem file size strip mingw32 dlls before packaging
ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
task "copy:glu:x86-mingw32:#{ruby_version}" do |t|
sh "i686-w64-mingw32-strip -S tmp/x86-mingw32/stage/lib/glu/#{ruby_version[/^\d+\.\d+/]}/glu.so"
end
task "copy:glu:x64-mingw32:#{ruby_version}" do |t|
sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/glu/#{ruby_version[/^\d+\.\d+/]}/glu.so"
end
end
desc "Build windows binary gems per rake-compiler-dock."
task "gem:windows" do
require "rake_compiler_dock"
RakeCompilerDock.sh <<-EOT
rake cross native gem MAKE='nice make -j`nproc`'
EOT
end
task :test => :compile