Update to ruby-gems-0.9.0 and backport some code from the gems subversion

repository to fix building of native extensions. (sigh!)

A summary of changes can be found here:
http://rubyforge.org/forum/forum.php?forum_id=7575

ok msf@, sturm@
This commit is contained in:
bernd 2006-10-19 00:53:55 +00:00
parent c40fa37ee6
commit 5e3bbf0e54
5 changed files with 178 additions and 49 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.1.1.1 2006/06/11 19:11:07 sturm Exp $
# $OpenBSD: Makefile,v 1.2 2006/10/19 00:53:55 bernd Exp $
COMMENT= "package management framework for the Ruby language"
V= 0.8.11
V= 0.9.0
DISTNAME= rubygems-$V
PKGNAME= ruby-gems-$V
CATEGORIES= devel
@ -17,7 +17,7 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= http://rubyforge.org/frs/download.php/5207/
MASTER_SITES= http://rubyforge.org/frs/download.php/11289/
EXTRACT_SUFX= .tgz
MODULES= lang/ruby

View File

@ -1,4 +1,4 @@
MD5 (rubygems-0.8.11.tgz) = aa363b428c4c1fc2e076a4ff77b957d7
RMD160 (rubygems-0.8.11.tgz) = 381ef7f088b3b439f28797d6d7a3257b3e28d6e4
SHA1 (rubygems-0.8.11.tgz) = 6a7d047349a073f24621e589f50a6a6548f943be
SIZE (rubygems-0.8.11.tgz) = 160265
MD5 (rubygems-0.9.0.tgz) = 5d496e1f415b8b4033ab867f01d1161f
RMD160 (rubygems-0.9.0.tgz) = 7d2a4ec1a615f608e75c68ee346d957efbb34ed1
SHA1 (rubygems-0.9.0.tgz) = 90d2193e9bb91dbbfbb81ce749abcd827e3b6b53
SIZE (rubygems-0.9.0.tgz) = 174321

View File

@ -0,0 +1,115 @@
$OpenBSD: patch-lib_rubygems_installer_rb,v 1.1 2006/10/19 00:53:55 bernd Exp $
Backport from rubygems subversion repository. Fixes building of native
extensions. (i.e. ruby-postgresql)
---
r1062 | jimweirich | 2006-08-10 20:15:28 +0200 (Thu, 10 Aug 2006) | 2 lines
Installed Tilman Sauerbeck's patch to fix C builds in gems.
---
--- lib/rubygems/installer.rb.orig Wed Jun 7 05:39:54 2006
+++ lib/rubygems/installer.rb Wed Oct 18 19:36:51 2006
@@ -292,9 +292,12 @@ TEXT
say "Building native extensions. This could take a while..."
start_dir = Dir.pwd
dest_path = File.join(directory, spec.require_paths[0])
+ ran_rake = false # only run rake once
- results = []
spec.extensions.each do |extension|
+ break if ran_rake
+ results = []
+
case extension
when /extconf/ then
builder = ExtExtConfBuilder
@@ -302,6 +305,7 @@ TEXT
builder = ExtConfigureBuilder
when /rakefile/i then
builder = ExtRakeBuilder
+ ran_rake = true
else
builder = nil
results = ["No builder for extension '#{extension}'"]
@@ -310,7 +314,7 @@ TEXT
begin
err = false
Dir.chdir File.join(directory, File.dirname(extension))
- results = builder.build(extension, directory, dest_path)
+ results = builder.build(extension, directory, dest_path, results)
rescue => ex
err = true
end
@@ -551,29 +555,27 @@ TEXT
end # class Uninstaller
class ExtConfigureBuilder
- def self.build(extension, directory, dest_path)
- results = []
+ def self.build(extension, directory, dest_path, results)
unless File.exist?('Makefile') then
cmd = "sh ./configure --prefix=#{dest_path}"
results << cmd
results << `#{cmd}`
end
- results.push(*ExtExtConfBuilder.make(dest_path))
+ ExtExtConfBuilder.make(dest_path, results)
results
end
end
class ExtExtConfBuilder
- def self.build(extension, directory, dest_path)
- results = ["#{Gem.ruby} #{File.basename(extension)} #{ARGV.join(" ")}"]
+ def self.build(extension, directory, dest_path, results)
+ results << "#{Gem.ruby} #{File.basename(extension)} #{ARGV.join(" ")}"
results << `#{Gem.ruby} #{File.basename(extension)} #{ARGV.join(" ")}`
- results.push(*make(dest_path))
+ make(dest_path, results)
results
end
- def self.make(dest_path)
- results = []
+ def self.make(dest_path, results)
raise unless File.exist?('Makefile')
mf = File.read('Makefile')
mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
@@ -585,27 +587,25 @@ TEXT
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
end
- ['', 'install', 'clean'].each do |target|
+ ['', 'install'].each do |target|
results << "#{make_program} #{target}".strip
results << `#{make_program} #{target}`
- end
- results
+ raise unless $?.exitstatus.zero?
+ end
end
end
class ExtRakeBuilder
- def ExtRakeBuilder.build(ext, directory, dest_path)
+ def ExtRakeBuilder.build(ext, directory, dest_path, results)
make_program = ENV['rake'] || 'rake'
make_program += " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}"
- results = []
+ results << "#{make_program} extension".strip
+ results << `#{make_program} extension`
- ['', 'install', 'clean'].each do |target|
- results << "#{make_program} #{target}".strip
- results << `#{make_program} #{target}`
- end
+ raise unless $?.exitstatus.zero?
results
end

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-post-install_rb,v 1.1 2006/10/19 00:53:55 bernd Exp $
--- post-install.rb.orig Fri Sep 1 09:36:29 2006
+++ post-install.rb Fri Sep 1 09:36:36 2006
@@ -77,6 +77,5 @@ def install_sources
end
install_windows_batch_files
-remove_stubs
install_sources

View File

@ -1,48 +1,52 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2006/06/11 19:11:07 sturm Exp $
@comment $OpenBSD: PLIST,v 1.2 2006/10/19 00:53:55 bernd Exp $
bin/gem
bin/gem_mirror
bin/gem_server
bin/gemlock
bin/gemri
bin/gemwhich
bin/generate_yaml_index.rb
bin/index_gem_repository.rb
bin/update_rubygems
lib/ruby/gems/
lib/ruby/gems/${REV}/
lib/ruby/gems/${REV}/cache/
lib/ruby/gems/${REV}/cache/sources-0.0.1.gem
lib/ruby/gems/${REV}/doc/
lib/ruby/gems/${REV}/gems/
lib/ruby/gems/${REV}/gems/sources-0.0.1/
lib/ruby/gems/${REV}/gems/sources-0.0.1/lib/
lib/ruby/gems/${REV}/gems/sources-0.0.1/lib/sources.rb
lib/ruby/gems/${REV}/specifications/
lib/ruby/gems/${REV}/specifications/sources-0.0.1.gemspec
lib/ruby/site_ruby/${REV}/gemconfigure.rb
lib/ruby/site_ruby/${REV}/rubygems/
lib/ruby/site_ruby/${REV}/rubygems.rb
lib/ruby/site_ruby/${REV}/rubygems/builder.rb
lib/ruby/site_ruby/${REV}/rubygems/cmd_manager.rb
lib/ruby/site_ruby/${REV}/rubygems/command.rb
lib/ruby/site_ruby/${REV}/rubygems/config_file.rb
lib/ruby/site_ruby/${REV}/rubygems/custom_require.rb
lib/ruby/site_ruby/${REV}/rubygems/dependency_list.rb
lib/ruby/site_ruby/${REV}/rubygems/deployment.rb
lib/ruby/site_ruby/${REV}/rubygems/doc_manager.rb
lib/ruby/site_ruby/${REV}/rubygems/format.rb
lib/ruby/site_ruby/${REV}/rubygems/gem_commands.rb
lib/ruby/site_ruby/${REV}/rubygems/gem_openssl.rb
lib/ruby/site_ruby/${REV}/rubygems/gem_runner.rb
lib/ruby/site_ruby/${REV}/rubygems/installer.rb
lib/ruby/site_ruby/${REV}/rubygems/loadpath_manager.rb
lib/ruby/site_ruby/${REV}/rubygems/old_format.rb
lib/ruby/site_ruby/${REV}/rubygems/open-uri.rb
lib/ruby/site_ruby/${REV}/rubygems/package.rb
lib/ruby/site_ruby/${REV}/rubygems/remote_installer.rb
lib/ruby/site_ruby/${REV}/rubygems/rubygems_version.rb
lib/ruby/site_ruby/${REV}/rubygems/security.rb
lib/ruby/site_ruby/${REV}/rubygems/source_index.rb
lib/ruby/site_ruby/${REV}/rubygems/specification.rb
lib/ruby/site_ruby/${REV}/rubygems/timer.rb
lib/ruby/site_ruby/${REV}/rubygems/user_interaction.rb
lib/ruby/site_ruby/${REV}/rubygems/validator.rb
lib/ruby/site_ruby/${REV}/rubygems/version.rb
lib/ruby/site_ruby/${REV}/ubygems.rb
lib/ruby/gems/${MODRUBY_REV}/
lib/ruby/gems/${MODRUBY_REV}/cache/
lib/ruby/gems/${MODRUBY_REV}/cache/sources-0.0.1.gem
lib/ruby/gems/${MODRUBY_REV}/doc/
lib/ruby/gems/${MODRUBY_REV}/gems/
lib/ruby/gems/${MODRUBY_REV}/gems/sources-0.0.1/
lib/ruby/gems/${MODRUBY_REV}/gems/sources-0.0.1/lib/
lib/ruby/gems/${MODRUBY_REV}/gems/sources-0.0.1/lib/sources.rb
lib/ruby/gems/${MODRUBY_REV}/specifications/
lib/ruby/gems/${MODRUBY_REV}/specifications/sources-0.0.1.gemspec
lib/ruby/site_ruby/${MODRUBY_REV}/gemconfigure.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rbconfig/
lib/ruby/site_ruby/${MODRUBY_REV}/rbconfig/datadir.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/builder.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/cmd_manager.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/command.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/config_file.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/custom_require.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/dependency_list.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/doc_manager.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/format.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/gem_commands.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/gem_openssl.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/gem_runner.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/incremental_fetcher.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/installer.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/loadpath_manager.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/old_format.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/open-uri.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/package.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/remote_installer.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/rubygems_version.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/security.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/source_index.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/specification.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/timer.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/user_interaction.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/validator.rb
lib/ruby/site_ruby/${MODRUBY_REV}/rubygems/version.rb
lib/ruby/site_ruby/${MODRUBY_REV}/ubygems.rb