summaryrefslogtreecommitdiff
path: root/lang/ruby/3.2/patches/patch-lib_rubygems_ext_builder_rb
diff options
context:
space:
mode:
Diffstat (limited to 'lang/ruby/3.2/patches/patch-lib_rubygems_ext_builder_rb')
-rw-r--r--lang/ruby/3.2/patches/patch-lib_rubygems_ext_builder_rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/ruby/3.2/patches/patch-lib_rubygems_ext_builder_rb b/lang/ruby/3.2/patches/patch-lib_rubygems_ext_builder_rb
new file mode 100644
index 0000000..13283f0
--- /dev/null
+++ b/lang/ruby/3.2/patches/patch-lib_rubygems_ext_builder_rb
@@ -0,0 +1,21 @@
1Ugly hack to make --user-install option work. Without this, when
2a user uses gem install --user-install, it calls
3/usr/bin/install -o root -g bin, which fails due to permission issues.
4This removes the -o root -g bin, so it can succeed as a regular user.
5
6Index: lib/rubygems/ext/builder.rb
7--- lib/rubygems/ext/builder.rb.orig
8+++ lib/rubygems/ext/builder.rb
9@@ -40,6 +40,12 @@ class Gem::Ext::Builder
10 env << "sitelibdir=%s" % sitedir
11 end
12
13+ unless Process.euid == 0
14+ %w[INSTALL INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM].each do |ins|
15+ env.unshift "#{ins}=#{RbConfig::MAKEFILE_CONFIG[ins].gsub(/-o root -g bin/, '')}"
16+ end
17+ end
18+
19 targets.each do |target|
20 # Pass DESTDIR via command line to override what's in MAKEFLAGS
21 cmd = [