git.iko.soy/typeable/nixpkgs
on master help sign in
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

commit6ae57b1b634d2145f72c1742685695e7192102ba authorzimbatm <zimbatm@zimbatm.com> dateFri 26 Aug 2016, 14:08 (10 years ago) parent2755bcf
2 files changed+19−9
pkgs/development/ruby-modules/bundler/default.nix+4 pkgs/development/ruby-modules/gem-config/default.nix+15−9
pkgs/development/ruby-modules/bundler/default.nix+4
@@ -7,4 +7,8 @@ buildRubyGem rec {
77 version = "1.12.5";
88 sha256 = "1q84xiwm9j771lpmiply0ls9l2bpvl5axn3jblxjvrldh8di2pkc";
99 dontPatchShebangs = true;
10+
11+ postFixup = ''
12+ sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
13+ '';
1014}
pkgs/development/ruby-modules/gem-config/default.nix+15−9
@@ -29,6 +29,21 @@ let
2929in
3030
3131{
32+ bundler = attrs:
33+ let
34+ templates = "${attrs.ruby.gemPath}/gems/${attrs.gemName}-${attrs.version}/lib/bundler/templates/";
35+ in {
36+ # patching shebangs would fail on the templates/Executable file, so we
37+ # temporarily remove the executable flag.
38+ preFixup = "chmod -x $out/${templates}/Executable";
39+ postFixup = ''
40+ chmod +x $out/${templates}/Executable
41+
42+ # Allows to load another bundler version
43+ sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
44+ '';
45+ };
46+
3247 capybara-webkit = attrs: {
3348 buildInputs = [ qt48 ];
3449 };
@@ -177,14 +192,5 @@ in
177192 '';
178193 };
179194
180− # patching shebangs would fail on the templates/Executable file, so we
181− # temporarily remove the executable flag.
182− bundler = attrs:
183− let
184− templates = "${attrs.ruby.gemPath}/gems/${attrs.gemName}-${attrs.version}/lib/bundler/templates/";
185− in {
186− preFixup = "chmod -x $out/${templates}/Executable";
187− postFixup = "chmod +x $out/${templates}/Executable";
188− };
189195}
190196