about summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2013-12-26 18:38:10 -0500
committerShea Levy <shea@shealevy.com>2013-12-26 18:38:10 -0500
commit44c97e02f69add2691ce06424bd62c90b595297d (patch)
treed965f37e1f16123e58dda7c7ef4a68700435761b /pkgs/development/interpreters/ruby
parent88b9e1f191c1c48a285fdb17dc2f5a85860e80c0 (diff)
downloadnixlib-44c97e02f69add2691ce06424bd62c90b595297d.tar
nixlib-44c97e02f69add2691ce06424bd62c90b595297d.tar.gz
nixlib-44c97e02f69add2691ce06424bd62c90b595297d.tar.bz2
nixlib-44c97e02f69add2691ce06424bd62c90b595297d.tar.lz
nixlib-44c97e02f69add2691ce06424bd62c90b595297d.tar.xz
nixlib-44c97e02f69add2691ce06424bd62c90b595297d.tar.zst
nixlib-44c97e02f69add2691ce06424bd62c90b595297d.zip
Move GEM_PATH part of rubygems' setup hook to ruby
Fixes #1413

Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'pkgs/development/interpreters/ruby')
-rw-r--r--pkgs/development/interpreters/ruby/ruby-18.nix15
-rw-r--r--pkgs/development/interpreters/ruby/ruby-19.nix15
-rw-r--r--pkgs/development/interpreters/ruby/ruby-2.0.nix13
-rw-r--r--pkgs/development/interpreters/ruby/rubygems.nix6
4 files changed, 38 insertions, 11 deletions
diff --git a/pkgs/development/interpreters/ruby/ruby-18.nix b/pkgs/development/interpreters/ruby/ruby-18.nix
index f37e8baa68d5..356fce4913c1 100644
--- a/pkgs/development/interpreters/ruby/ruby-18.nix
+++ b/pkgs/development/interpreters/ruby/ruby-18.nix
@@ -33,8 +33,19 @@ stdenv.mkDerivation rec {
   configureFlags = ["--enable-shared" "--enable-pthread"];
 
   installFlags = stdenv.lib.optionalString docSupport "install-doc";
-  # Bundler tries to create this directory
-  postInstall = "mkdir -pv $out/${passthru.gemPath}";
+
+  postInstall = ''
+    # Bundler tries to create this directory
+    mkdir -pv $out/${passthru.gemPath}
+    mkdir -p $out/nix-support
+    cat > $out/nix-support/setup-hook <<EOF
+    addGemPath() {
+      addToSearchPath GEM_PATH \$1/${passthru.gemPath}
+    }
+
+    envHooks+=(addGemPath)
+    EOF
+  '';
 
   meta = {
     license = "Ruby";
diff --git a/pkgs/development/interpreters/ruby/ruby-19.nix b/pkgs/development/interpreters/ruby/ruby-19.nix
index 345439b593e9..d18718184ba6 100644
--- a/pkgs/development/interpreters/ruby/ruby-19.nix
+++ b/pkgs/development/interpreters/ruby/ruby-19.nix
@@ -48,8 +48,19 @@ stdenv.mkDerivation rec {
     ++ ( if stdenv.isDarwin then [ "--with-out-ext=tk " ] else [ ]);
 
   installFlags = stdenv.lib.optionalString docSupport "install-doc";
-  # Bundler tries to create this directory
-  postInstall = "mkdir -pv $out/${passthru.gemPath}";
+
+  postInstall = ''
+    # Bundler tries to create this directory
+    mkdir -pv $out/${passthru.gemPath}
+    mkdir -p $out/nix-support
+    cat > $out/nix-support/setup-hook <<EOF
+    addGemPath() {
+      addToSearchPath GEM_PATH \$1/${passthru.gemPath}
+    }
+
+    envHooks+=(addGemPath)
+    EOF
+  '';
 
   meta = {
     license     = "Ruby";
diff --git a/pkgs/development/interpreters/ruby/ruby-2.0.nix b/pkgs/development/interpreters/ruby/ruby-2.0.nix
index 4ad2f8c515ed..ae242107b968 100644
--- a/pkgs/development/interpreters/ruby/ruby-2.0.nix
+++ b/pkgs/development/interpreters/ruby/ruby-2.0.nix
@@ -46,7 +46,18 @@ stdenv.mkDerivation rec {
 
   installFlags = stdenv.lib.optionalString docSupport "install-doc";
   # Bundler tries to create this directory
-  postInstall = "mkdir -pv $out/${passthru.gemPath}";
+  postInstall = ''
+    # Bundler tries to create this directory
+    mkdir -pv $out/${passthru.gemPath}
+    mkdir -p $out/nix-support
+    cat > $out/nix-support/setup-hook <<EOF
+    addGemPath() {
+      addToSearchPath GEM_PATH \$1/${passthru.gemPath}
+    }
+
+    envHooks+=(addGemPath)
+    EOF
+  '';
 
   meta = {
     license = "Ruby";
diff --git a/pkgs/development/interpreters/ruby/rubygems.nix b/pkgs/development/interpreters/ruby/rubygems.nix
index 22076d5ed9e8..13829c3f9f6a 100644
--- a/pkgs/development/interpreters/ruby/rubygems.nix
+++ b/pkgs/development/interpreters/ruby/rubygems.nix
@@ -18,12 +18,6 @@ rec {
     cat > $out/nix-support/setup-hook <<EOF
     export RUBYOPT=rubygems
     addToSearchPath RUBYLIB $out/lib
-
-    addGemPath() {
-      addToSearchPath GEM_PATH \$1/${ruby.gemPath}
-    }
-
-    envHooks+=(addGemPath)
     EOF'') ["minInit" "addInputs" "doUnpack" "defEnsureDir"];
 
   /* doConfigure should be specified separately */