Created
September 3, 2013 03:18
-
-
Save heftig/6419379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git i/Rakefile w/Rakefile | |
index d1bbfa6..ecf10bb 100644 | |
--- i/Rakefile | |
+++ w/Rakefile | |
@@ -52,7 +52,7 @@ end | |
load_configuration | |
-unless BUILD_CONFIG[:config_version] == 179 | |
+unless BUILD_CONFIG[:config_version] == 180 | |
STDERR.puts "Your configuration is outdated, please run ./configure first" | |
exit 1 | |
end | |
diff --git i/configure w/configure | |
index ec2fee9..fd8d791 100755 | |
--- i/configure | |
+++ w/configure | |
@@ -140,7 +140,7 @@ class Configure | |
@release_date = validate_release_date | |
# Configure settings | |
- @config_version = 179 | |
+ @config_version = 180 | |
@run_bundle = true | |
@fetch_gems = true | |
end | |
@@ -1720,7 +1720,8 @@ int main() { return tgetnum(""); } | |
:build_tool_gems => @build_tool_gems, | |
:build_c_ext_gems => @build_c_ext_gems, | |
:rubygems_gems => @rubygems_gems, | |
- :runtime_gems => @runtime_gems | |
+ :runtime_gems => @runtime_gems, | |
+ :default_gems => @default_gems | |
} | |
write_config_rb @config, config_settings | |
@@ -2031,7 +2032,7 @@ required to run it. | |
def unpack_gems | |
@log.write "\nUnpacking bootstrap gems..." | |
- gems = @build_tool_gems + @build_c_ext_gems + @rubygems_gems | |
+ gems = @default_gems = @build_tool_gems + @build_c_ext_gems + @rubygems_gems | |
runtime_gems = File.expand_path "../runtime/gems", __FILE__ | |
FileUtils.mkdir_p runtime_gems unless File.directory? runtime_gems | |
diff --git i/rakelib/preinstall_gems.rb w/rakelib/preinstall_gems.rb | |
index acdd4bd..d290eb7 100644 | |
--- i/rakelib/preinstall_gems.rb | |
+++ w/rakelib/preinstall_gems.rb | |
@@ -1,9 +1,11 @@ | |
require 'rubygems' | |
require 'rubygems/dependency_installer' | |
require 'rubinius/build_config' | |
+require 'fileutils' | |
puts "Pre-installing gems for #{RUBY_VERSION}..." | |
+default_gems = Rubinius::BUILD_CONFIG[:default_gems] | |
gems = Rubinius::BUILD_CONFIG[:runtime_gems] | |
options = { | |
:wrappers => true, | |
@@ -14,6 +16,23 @@ options = { | |
:conservative => true | |
} | |
+FileUtils.mkdir_p Gem::Specification.default_specifications_dir | |
+default_gems.each do |name, version| | |
+ name_re = /#{name}/ | |
+ version_req = Gem::Requirement.create "~> #{version}" | |
+ unless Gem::Specification.any? { |s| s.name =~ name_re and version_req =~ s.version } | |
+ gem = Dir["#{name}-#{version}*"].first | |
+ s = Gem::Installer.new(gem).spec | |
+ spec_file = File.join(Gem::Specification.default_specifications_dir, "#{s.full_name}.gemspec") | |
+ | |
+ File.open(spec_file, "w") do |f| | |
+ f.puts s.to_ruby_for_cache | |
+ end | |
+ | |
+ puts "Wrote gemspec for #{s.name} #{s.version}" | |
+ end | |
+end | |
+ | |
gems.each do |name, version| | |
name_re = /#{name}/ | |
version_req = Gem::Requirement.create "~> #{version}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment