bleak_house 4.2 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- v4.2. Harden patch/build process. Fix bug.
2
+ v4.2.1. Harden patch/build process. Fix bug.
3
3
 
4
4
  v4.1.1. Update bundled Ruby to patchlevel 230.
5
5
 
data/bleak_house.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{bleak_house}
5
- s.version = "4.2"
5
+ s.version = "4.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
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, configure, and build"
63
- execute("patch -p0 < \'#{source_dir}/ruby.patch\'")
62
+ puts "** Patch Ruby"
63
+ execute("patch -p0 < '#{source_dir}/ruby.patch'")
64
64
 
65
- execute("./configure --prefix=#{binary_dir[0..-5]}") # --with-static-linked-ext
65
+ puts "** Configure"
66
+ execute("./configure #{Config::CONFIG['configure_args']}".sub("'--enable-shared'", ""))
66
67
 
67
- puts "Patch the makefile for arch/sitedir"
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 the config.h for constants"
76
+ puts "Patch config.h"
75
77
  constants = {
76
- 'RUBY_LIB' => 'rubylibdir', #define RUBY_LIB "/usr/lib/ruby/1.8"
77
- 'RUBY_SITE_LIB' => 'sitedir', #define RUBY_SITE_LIB "/usr/lib/ruby/site_ruby"
78
- 'RUBY_SITE_LIB2' => 'sitelibdir', #define RUBY_SITE_LIB2 "/usr/lib/ruby/site_ruby/1.8"
79
- 'RUBY_PLATFORM' => 'arch', #define RUBY_PLATFORM "i686-linux"
80
- 'RUBY_ARCHLIB' => 'topdir', #define RUBY_ARCHLIB "/usr/lib/ruby/1.8/i686-linux"
81
- 'RUBY_SITE_ARCHLIB' => 'sitearchdir' #define RUBY_SITE_ARCHLIB "/usr/lib/ruby/site_ruby/1.8/i686-linux"
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
- execute("make")
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 = "#{binary_dir}/ruby-bleak-house"
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
@@ -1,5 +1,5 @@
1
1
 
2
- unless RUBY_PATCHLEVEL > 900
2
+ unless RUBY_PATCHLEVEL >= 903
3
3
  raise "This build of Ruby has not been successfully patched for BleakHouse."
4
4
  end
5
5
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bleak_house
3
3
  version: !ruby/object:Gem::Version
4
- version: "4.2"
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
metadata.gz.sig CHANGED
Binary file