Skip to content

Commit 41fc088

Browse files
committed
Maintain ruby-shadow + a patched version
Signed-off-by: Tim Meusel <tim@bastelfreak.de>
1 parent b344dc6 commit 41fc088

5 files changed

Lines changed: 63 additions & 3 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"url": "https://github.com/voxpupuli/ruby-shadow",
3+
"ref": "bc7752a9ddbde06c1418734d003a9607bafcc6df"
4+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#####
2+
# Component release information:
3+
# https://github.com/apalmblad/ruby-shadow/tags
4+
# https://rubygems.org/gems/ruby-shadow
5+
# contains https://github.com/apalmblad/ruby-shadow/pull/29
6+
# We are building https://github.com/voxpupuli/ruby-shadow/compare/patch-extconf
7+
# * contains https://github.com/apalmblad/ruby-shadow/pull/29
8+
# * diff https://github.com/apalmblad/ruby-shadow/compare/master...bastelfreak:ruby-shadow:patch-extconf
9+
#####
10+
component 'ruby-shadow-patched' do |pkg, settings, platform|
11+
pkg.load_from_json('configs/components/ruby-shadow.json')
12+
13+
pkg.build_requires "ruby-#{settings[:ruby_version]}"
14+
if !platform.is_cross_compiled? && platform.architecture == 'sparc'
15+
pkg.environment 'PATH', '$(PATH):/opt/pl-build-tools/bin:/usr/ccs/bin:/usr/sfw/bin'
16+
else
17+
pkg.environment 'PATH', '$(PATH):/usr/ccs/bin:/usr/sfw/bin'
18+
end
19+
20+
pkg.environment 'CONFIGURE_ARGS', '--vendor'
21+
22+
if platform.is_solaris?
23+
pkg.environment 'RUBY', settings[:host_ruby] if platform.is_cross_compiled?
24+
25+
ruby = if !platform.is_cross_compiled? && platform.architecture == 'sparc'
26+
File.join(settings[:ruby_bindir], 'ruby')
27+
else
28+
# This should really only be done when cross compiling but
29+
# to avoid breaking solaris x86_64 in 7.x continue preloading
30+
# our hook.
31+
"#{settings[:host_ruby]} -r#{settings[:datadir]}/doc/rbconfig-#{settings[:ruby_version]}-orig.rb"
32+
end
33+
elsif platform.is_cross_compiled?
34+
pkg.environment 'RUBY', settings[:host_ruby]
35+
ruby = "#{settings[:host_ruby]} -r#{settings[:datadir]}/doc/rbconfig-#{settings[:ruby_version]}-orig.rb"
36+
else
37+
ruby = File.join(settings[:ruby_bindir], 'ruby')
38+
end
39+
40+
pkg.build do
41+
[
42+
"#{ruby} extconf.rb",
43+
"#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"
44+
]
45+
end
46+
47+
pkg.install do
48+
["#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1) DESTDIR=/ install"]
49+
end
50+
end
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"url": "https://github.com/bastelfreak/ruby-shadow",
3-
"ref": "bc7752a9ddbde06c1418734d003a9607bafcc6df"
2+
"url": "https://github.com/apalmblad/ruby-shadow",
3+
"ref": "refs/tags/2.5.1"
44
}

configs/components/ruby-shadow.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
ruby = File.join(settings[:ruby_bindir], 'ruby')
3434
end
3535

36+
base = 'resources/patches/ruby_32'
37+
# https://github.com/apalmblad/ruby-shadow/issues/26
38+
# if ruby-shadow gets a 3 release this should be removed
39+
pkg.apply_patch "#{base}/ruby-shadow-taint.patch", strip: '1'
40+
pkg.apply_patch "#{base}/ruby-shadow-rbconfig.patch", strip: '1'
41+
3642
pkg.build do
3743
[
3844
"#{ruby} extconf.rb",

configs/projects/agent-runtime-main.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
end
8282

8383
unless platform.is_aix? || platform.is_windows?
84-
proj.component 'ruby-shadow'
84+
proj.component 'ruby-shadow-patched'
8585
end
8686

8787
# We only build ruby-selinux for EL, Fedora, Debian and Ubuntu (amd64/i386)

0 commit comments

Comments
 (0)