summary refs log tree commit diff
path: root/pkgs/development/ruby-modules/gem
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-08-29 22:12:44 +0100
committerzimbatm <zimbatm@zimbatm.com>2016-08-29 22:17:59 +0100
commita7cf555e2a744403817bfe2647c030eaa2cd66c7 (patch)
tree384f655a50dad00faaef8a09fe373b23a0001b8f /pkgs/development/ruby-modules/gem
parentb046ebbb7ccaa023f874f6359ad60441ac00f241 (diff)
downloadnixpkgs-a7cf555e2a744403817bfe2647c030eaa2cd66c7.tar
nixpkgs-a7cf555e2a744403817bfe2647c030eaa2cd66c7.tar.gz
nixpkgs-a7cf555e2a744403817bfe2647c030eaa2cd66c7.tar.bz2
nixpkgs-a7cf555e2a744403817bfe2647c030eaa2cd66c7.tar.lz
nixpkgs-a7cf555e2a744403817bfe2647c030eaa2cd66c7.tar.xz
nixpkgs-a7cf555e2a744403817bfe2647c030eaa2cd66c7.tar.zst
nixpkgs-a7cf555e2a744403817bfe2647c030eaa2cd66c7.zip
buildRubyGem: handle build-time ruby dependencies
For some reason `gem install` unsets the GEM_PATH environment variable
internally unless the install dir is provided. This in turn means that
if it invokes extconf.rb and extconf.rb depends on a gem available on
the GEM_PATH (like pkg-config for nokogiri) then it's not available in
that context.

Proof: https://github.com/rubygems/rubygems/blob/d8293c472966cb1de08784dfdd90560e56ceed84/lib/rubygems/commands/install_command.rb#L151
Blame: https://github.com/rubygems/rubygems/commit/9ea600c9c2b77d1459526fe1e2bcdf2ac778c24a

This is a hack that sets the :install_dir to where we would install
anyways (the GEM_HOME is the default installation destination).
Diffstat (limited to 'pkgs/development/ruby-modules/gem')
-rw-r--r--pkgs/development/ruby-modules/gem/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix
index 8015fb1f6d0..347c4a79c59 100644
--- a/pkgs/development/ruby-modules/gem/default.nix
+++ b/pkgs/development/ruby-modules/gem/default.nix
@@ -181,6 +181,7 @@ stdenv.mkDerivation (attrs // {
       --force \
       --http-proxy 'http://nodtd.invalid' \
       --ignore-dependencies \
+      --install-dir "$GEM_HOME" \
       --build-root '/' \
       --backtrace \
       ${documentFlag} \