From 4dec9be42a2e1589874956221e6e976b23bd7954 Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Fri, 5 Jul 2024 20:29:51 +0300 Subject: [PATCH] buildRubyGem: do not override fixupPhase (#323587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oops, looks like we were overriding stdenv’s fixupPhase that runs fixupOutputHooks, including patchShebangsAuto. --- pkgs/development/ruby-modules/gem/default.nix | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix index c5d174fab395..b2bb43736657 100644 --- a/pkgs/development/ruby-modules/gem/default.nix +++ b/pkgs/development/ruby-modules/gem/default.nix @@ -251,19 +251,15 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { done ''} - runHook postInstall - ''; - - # For Ruby-generated binstubs, shebang paths are already in Nix store but for - # ruby used to build the package. Update them to match the host system. Note - # that patchShebangsAuto ignores scripts where shebang line is already in Nix - # store. - fixupPhase = attrs.fixupPhase or '' - runHook preFixup - if [[ -d $out/${ruby.gemPath}/bin ]]; then - patchShebangs --update --host $out/${ruby.gemPath}/bin + # For Ruby-generated binstubs, shebang paths are already in Nix store but for + # ruby used to build the package. Update them to match the host system. Note + # that patchShebangsAuto ignores scripts where shebang line is already in Nix + # store. + if [[ -d $GEM_HOME/bin ]]; then + patchShebangs --update --host -- "$GEM_HOME"/bin fi - runHook postFixup + + runHook postInstall ''; propagatedBuildInputs = gemPath ++ propagatedBuildInputs;