openbsd-ports/devel/ruby-gems/patches/patch-lib_rubygems_ext_builder_rb
jeremy b3b474bb7a This adds an ugly hack to make gem install --user-install work
for gems with native extensions. Without this, it calls
/usr/bin/install -o root -g bin as a regular user, which fails due
to permission issues. This removes the -o root -g bin, so it can
succeed as a regular user.

Regen patches while here.

Idea to just remove -o root -g bin instead of using cp -p from
landry@.

OK landry@
2010-10-06 18:12:19 +00:00

21 lines
917 B
Plaintext

$OpenBSD: patch-lib_rubygems_ext_builder_rb,v 1.1 2010/10/06 18:12:19 jeremy Exp $
Ugly hack to make --user-install option work. Without this, when
a user uses gem install --user-install, it calls
/usr/bin/install -o root -g bin, which fails due to permission issues.
This removes the -o root -g bin, so it can succeed as a regular user.
Gem::Installer.path_warning is only set if --user-install is used,
according to a grep of the sources.
--- lib/rubygems/ext/builder.rb.orig Wed Oct 6 10:27:31 2010
+++ lib/rubygems/ext/builder.rb Wed Oct 6 10:28:16 2010
@@ -19,6 +19,7 @@ class Gem::Ext::Builder
mf = File.read('Makefile')
mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
+ mf = mf.gsub(/-o root -g bin/, "") if Gem::Installer.path_warning
File.open('Makefile', 'wb') {|f| f.print mf}