-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathruby-shadow.rb
More file actions
53 lines (46 loc) · 1.94 KB
/
ruby-shadow.rb
File metadata and controls
53 lines (46 loc) · 1.94 KB
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
#####
# Component release information:
# https://github.com/apalmblad/ruby-shadow/tags
# https://rubygems.org/gems/ruby-shadow
#####
component 'ruby-shadow' do |pkg, settings, platform|
pkg.url 'https://github.com/apalmblad/ruby-shadow'
pkg.ref 'refs/tags/2.5.1'
pkg.build_requires "ruby-#{settings[:ruby_version]}"
if !platform.is_cross_compiled? && platform.architecture == 'sparc'
pkg.environment 'PATH', '$(PATH):/opt/pl-build-tools/bin:/usr/ccs/bin:/usr/sfw/bin'
else
pkg.environment 'PATH', '$(PATH):/usr/ccs/bin:/usr/sfw/bin'
end
pkg.environment 'CONFIGURE_ARGS', '--vendor'
if platform.is_solaris?
pkg.environment 'RUBY', settings[:host_ruby] if platform.is_cross_compiled?
ruby = if !platform.is_cross_compiled? && platform.architecture == 'sparc'
File.join(settings[:ruby_bindir], 'ruby')
else
# This should really only be done when cross compiling but
# to avoid breaking solaris x86_64 in 7.x continue preloading
# our hook.
"#{settings[:host_ruby]} -r#{settings[:datadir]}/doc/rbconfig-#{settings[:ruby_version]}-orig.rb"
end
elsif platform.is_cross_compiled?
pkg.environment 'RUBY', settings[:host_ruby]
ruby = "#{settings[:host_ruby]} -r#{settings[:datadir]}/doc/rbconfig-#{settings[:ruby_version]}-orig.rb"
else
ruby = File.join(settings[:ruby_bindir], 'ruby')
end
base = 'resources/patches/ruby_32'
# https://github.com/apalmblad/ruby-shadow/issues/26
# if ruby-shadow gets a 3 release this should be removed
pkg.apply_patch "#{base}/ruby-shadow-taint.patch", strip: '1'
pkg.apply_patch "#{base}/ruby-shadow-rbconfig.patch", strip: '1'
pkg.build do
[
"#{ruby} extconf.rb",
"#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"
]
end
pkg.install do
["#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1) DESTDIR=/ install"]
end
end