bleak_house 4.2 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +1 -1
- data/bleak_house.gemspec +1 -1
- data/ext/build_ruby.rb +29 -19
- data/lib/bleak_house.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
data/CHANGELOG
CHANGED
data/bleak_house.gemspec
CHANGED
data/ext/build_ruby.rb
CHANGED
@@ -16,6 +16,7 @@ require 'fileutils'
|
|
16
16
|
require 'rbconfig'
|
17
17
|
|
18
18
|
def execute(command)
|
19
|
+
puts command
|
19
20
|
unless system(command)
|
20
21
|
puts "Failed: #{command.inspect}"
|
21
22
|
exit -1
|
@@ -32,12 +33,11 @@ end
|
|
32
33
|
|
33
34
|
if which('ruby-bleak-house') and
|
34
35
|
(patchlevel = `ruby-bleak-house -e "puts RUBY_PATCHLEVEL"`.to_i) >= 903
|
35
|
-
puts "Binary `ruby-bleak-house` is already available (patchlevel #{patchlevel})"
|
36
|
+
puts "** Binary `ruby-bleak-house` is already available (patchlevel #{patchlevel})"
|
36
37
|
else
|
37
38
|
# Build
|
38
39
|
Dir.chdir(tmp) do
|
39
40
|
build_dir = "bleak_house"
|
40
|
-
binary_dir = File.dirname(`which ruby`)
|
41
41
|
|
42
42
|
FileUtils.rm_rf(build_dir) rescue nil
|
43
43
|
if File.exist? build_dir
|
@@ -49,48 +49,58 @@ else
|
|
49
49
|
begin
|
50
50
|
Dir.chdir(build_dir) do
|
51
51
|
|
52
|
-
puts "Copy Ruby source"
|
52
|
+
puts "** Copy Ruby source"
|
53
53
|
bz2 = "ruby-1.8.6-p286.tar.bz2"
|
54
54
|
FileUtils.copy "#{source_dir}/#{bz2}", bz2
|
55
55
|
|
56
|
-
puts "Extract"
|
56
|
+
puts "** Extract"
|
57
57
|
execute("tar xjf #{bz2}")
|
58
58
|
File.delete bz2
|
59
59
|
|
60
60
|
Dir.chdir("ruby-1.8.6-p286") do
|
61
61
|
|
62
|
-
puts "Patch
|
63
|
-
execute("patch -p0 <
|
62
|
+
puts "** Patch Ruby"
|
63
|
+
execute("patch -p0 < '#{source_dir}/ruby.patch'")
|
64
64
|
|
65
|
-
|
65
|
+
puts "** Configure"
|
66
|
+
execute("./configure #{Config::CONFIG['configure_args']}".sub("'--enable-shared'", ""))
|
66
67
|
|
67
|
-
puts "Patch
|
68
|
+
puts "Patch Makefile"
|
69
|
+
# FIXME Why is this necessary?
|
68
70
|
makefile = File.read('Makefile')
|
69
71
|
%w{arch sitearch sitedir}.each do | key |
|
70
72
|
makefile.gsub!(/#{key} = .*/, "#{key} = #{Config::CONFIG[key]}")
|
71
73
|
end
|
72
74
|
File.open('Makefile', 'w'){|f| f.puts(makefile)}
|
73
75
|
|
74
|
-
puts "Patch
|
76
|
+
puts "Patch config.h"
|
75
77
|
constants = {
|
76
|
-
'RUBY_LIB' => 'rubylibdir',
|
77
|
-
'RUBY_SITE_LIB' => 'sitedir',
|
78
|
-
'RUBY_SITE_LIB2' => 'sitelibdir',
|
79
|
-
'RUBY_PLATFORM' => 'arch',
|
80
|
-
'RUBY_ARCHLIB' => 'topdir',
|
81
|
-
'RUBY_SITE_ARCHLIB' => 'sitearchdir'
|
78
|
+
'RUBY_LIB' => 'rubylibdir',
|
79
|
+
'RUBY_SITE_LIB' => 'sitedir',
|
80
|
+
'RUBY_SITE_LIB2' => 'sitelibdir',
|
81
|
+
'RUBY_PLATFORM' => 'arch',
|
82
|
+
'RUBY_ARCHLIB' => 'topdir',
|
83
|
+
'RUBY_SITE_ARCHLIB' => 'sitearchdir'
|
82
84
|
}
|
83
85
|
config_h = File.read('config.h')
|
84
86
|
constants.each do | const, key |
|
85
87
|
config_h.gsub!(/#define #{const} .*/, "#define #{const} \"#{Config::CONFIG[key]}\"")
|
86
88
|
end
|
87
|
-
File.open('config.h', 'w'){|f| f.puts(config_h)}
|
88
89
|
|
89
|
-
|
90
|
+
File.open('config.h', 'w') do |f|
|
91
|
+
f.puts(config_h)
|
92
|
+
end
|
93
|
+
|
94
|
+
env = Config::CONFIG.map do |key, value|
|
95
|
+
"#{key}=#{value.inspect}" if key.upcase == key and value
|
96
|
+
end.compact.join(" ")
|
97
|
+
|
98
|
+
puts "** Make"
|
99
|
+
execute("env #{env} make")
|
90
100
|
|
91
|
-
binary = "#{
|
101
|
+
binary = "#{Config::CONFIG['bindir']}/ruby-bleak-house"
|
92
102
|
|
93
|
-
puts "Install binary"
|
103
|
+
puts "** Install binary"
|
94
104
|
if File.exist? "ruby"
|
95
105
|
# Avoid "Text file busy" error
|
96
106
|
File.delete binary if File.exist? binary
|
data/lib/bleak_house.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|