summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-05-18 17:45:38 +0000
committerAlyssa Ross <hi@alyssa.is>2019-08-31 11:33:03 +0000
commit5b0851028fbde2be9f0fc6db009ddb265404c27a (patch)
treed09ea7a29c6cb968bd9031d09ef5352b249fc2e0
parent50d8295cc6aea7ace262b754b36979e210de6967 (diff)
downloadnixpkgs-5b0851028fbde2be9f0fc6db009ddb265404c27a.tar
nixpkgs-5b0851028fbde2be9f0fc6db009ddb265404c27a.tar.gz
nixpkgs-5b0851028fbde2be9f0fc6db009ddb265404c27a.tar.bz2
nixpkgs-5b0851028fbde2be9f0fc6db009ddb265404c27a.tar.lz
nixpkgs-5b0851028fbde2be9f0fc6db009ddb265404c27a.tar.xz
nixpkgs-5b0851028fbde2be9f0fc6db009ddb265404c27a.tar.zst
nixpkgs-5b0851028fbde2be9f0fc6db009ddb265404c27a.zip
ruby: --disable-rubygems for baseruby
This works just fine, and means we don't run into an issue with RubyGems
trying to install into a different Ruby's prefix when cross-compiling.
See https://github.com/NixOS/nixpkgs/pull/51842#issuecomment-478392799.
-rw-r--r--pkgs/development/interpreters/ruby/default.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 62cc77c1253..5908ecac269 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -29,11 +29,13 @@ let
     baseruby = self.override {
       useRailsExpress = false;
       docSupport = false;
+      rubygemsSupport = false;
     };
     self = lib.makeOverridable (
       { stdenv, buildPackages, lib
       , fetchurl, fetchFromSavannah, fetchFromGitHub
       , useRailsExpress ? true
+      , rubygemsSupport ? true
       , zlib, zlibSupport ? true
       , openssl, opensslSupport ? true
       , gdbm, gdbmSupport ? true
@@ -90,7 +92,7 @@ let
             patchLevel = ver.patchLevel;
           }).${ver.majMinTiny};
 
-        postUnpack = ''
+        postUnpack = opString rubygemsSupport ''
           cp -r ${rubygems} $sourceRoot/rubygems
         '';
 
@@ -136,12 +138,6 @@ let
         installFlags = stdenv.lib.optionalString docSupport "install-doc";
         # Bundler tries to create this directory
         postInstall = ''
-          # Update rubygems
-          pushd rubygems
-          chmod +w bundler/bundler.gemspec
-          ${buildRuby} setup.rb --destdir $GEM_HOME
-          popd
-
           # Remove unnecessary groff reference from runtime closure, since it's big
           sed -i '/NROFF/d' $out/lib/ruby/*/*/rbconfig.rb
 
@@ -162,6 +158,12 @@ let
           EOF
 
           rbConfig=$(find $out/lib/ruby -name rbconfig.rb)
+        '' + opString rubygemsSupport ''
+          # Update rubygems
+          pushd rubygems
+          chmod +w bundler/bundler.gemspec
+          ${buildRuby} setup.rb
+          popd
         '' + opString docSupport ''
           # Prevent the docs from being included in the closure
           sed -i "s|\$(DESTDIR)$devdoc|\$(datarootdir)/\$(RI_BASE_NAME)|" $rbConfig