diff options
author | zimbatm <zimbatm@zimbatm.com> | 2016-08-26 14:08:39 +0100 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2016-08-29 17:03:12 +0100 |
commit | 6ae57b1b634d2145f72c1742685695e7192102ba (patch) | |
tree | 8cfbcac5034993ae320235f3d548c94c83430d37 /pkgs/development | |
parent | 2755bcfa7c684ebf347df1e29b155fb30659ab7a (diff) | |
download | nixlib-6ae57b1b634d2145f72c1742685695e7192102ba.tar nixlib-6ae57b1b634d2145f72c1742685695e7192102ba.tar.gz nixlib-6ae57b1b634d2145f72c1742685695e7192102ba.tar.bz2 nixlib-6ae57b1b634d2145f72c1742685695e7192102ba.tar.lz nixlib-6ae57b1b634d2145f72c1742685695e7192102ba.tar.xz nixlib-6ae57b1b634d2145f72c1742685695e7192102ba.tar.zst nixlib-6ae57b1b634d2145f72c1742685695e7192102ba.zip |
bundler: fix usage on nested call
The combination of bundler 1.12.5 and rubygems 1.6.2 doesn't play well at all when trying to run gems such as foreman where bundler is used to run bundler. Just upgrading to the latest bundler rc doesn't fix it and changing rubygems causes a massive rebuild. Issues: - https://github.com/bundler/bundler/issues/4402 - https://github.com/bundler/bundler/issues/4576 - https://github.com/bundler/bundler/issues/4602 - https://github.com/docker-library/ruby/issues/73 This PR patches bundler to work around the issue as highlighted here and unbreaks everything for me: https://github.com/bundler/bundler/issues/4602#issuecomment-233619696
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/ruby-modules/bundler/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/ruby-modules/gem-config/default.nix | 24 |
2 files changed, 19 insertions, 9 deletions
diff --git a/pkgs/development/ruby-modules/bundler/default.nix b/pkgs/development/ruby-modules/bundler/default.nix index 50b8725a0af3..c3c544d52689 100644 --- a/pkgs/development/ruby-modules/bundler/default.nix +++ b/pkgs/development/ruby-modules/bundler/default.nix @@ -7,4 +7,8 @@ buildRubyGem rec { version = "1.12.5"; sha256 = "1q84xiwm9j771lpmiply0ls9l2bpvl5axn3jblxjvrldh8di2pkc"; dontPatchShebangs = true; + + postFixup = '' + sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle + ''; } diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index 95b5033cc9d2..41c837f52f0a 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -29,6 +29,21 @@ let in { + bundler = attrs: + let + templates = "${attrs.ruby.gemPath}/gems/${attrs.gemName}-${attrs.version}/lib/bundler/templates/"; + in { + # patching shebangs would fail on the templates/Executable file, so we + # temporarily remove the executable flag. + preFixup = "chmod -x $out/${templates}/Executable"; + postFixup = '' + chmod +x $out/${templates}/Executable + + # Allows to load another bundler version + sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle + ''; + }; + capybara-webkit = attrs: { buildInputs = [ qt48 ]; }; @@ -177,14 +192,5 @@ in ''; }; - # patching shebangs would fail on the templates/Executable file, so we - # temporarily remove the executable flag. - bundler = attrs: - let - templates = "${attrs.ruby.gemPath}/gems/${attrs.gemName}-${attrs.version}/lib/bundler/templates/"; - in { - preFixup = "chmod -x $out/${templates}/Executable"; - postFixup = "chmod +x $out/${templates}/Executable"; - }; } |