Skip to content

Commit

Permalink
Merge pull request #161298 from bergkvist/macos-shebang
Browse files Browse the repository at this point in the history
ruby-modules/bundler-env: Replace makeWrapper with makeBinaryWrapper to make bundled ruby apps work on macOS
  • Loading branch information
roberth authored Mar 9, 2022
2 parents 55102a3 + a734cbb commit 09477e8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions pkgs/development/ruby-modules/bundled-common/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, runCommand, ruby, lib, rsync
, defaultGemConfig, buildRubyGem, buildEnv
, makeWrapper
, makeBinaryWrapper
, bundler
}@defs:

Expand Down Expand Up @@ -118,9 +118,12 @@ let

wrappedRuby = stdenv.mkDerivation {
name = "wrapped-ruby-${pname'}";
nativeBuildInputs = [ makeWrapper ];
inherit (ruby) gemPath meta;
buildCommand = ''

nativeBuildInputs = [ makeBinaryWrapper ];

dontUnpack = true;

buildPhase = ''
mkdir -p $out/bin
for i in ${ruby}/bin/*; do
makeWrapper "$i" $out/bin/$(basename "$i") \
Expand All @@ -131,6 +134,15 @@ let
--set GEM_PATH ${basicEnv}/${ruby.gemPath}
done
'';

dontInstall = true;

doCheck = true;
checkPhase = ''
$out/bin/ruby --help > /dev/null
'';

inherit (ruby) meta;
};

env = let
Expand Down

0 comments on commit 09477e8

Please sign in to comment.