summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 5544a7f88b40..72e483bc77d3 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -166,5 +166,15 @@ in
       export XAPIAN_CONFIG=${xapian}/bin/xapian-config
     '';
   };
+
+  # 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";
+    };
 }