Merge pull request #75864 from marsam/fix-build-sqitchPg-darwin

sqitchPg: fix build on darwin
This commit is contained in:
Mario Rodas 2019-12-19 10:10:29 -05:00 committed by GitHub
commit c3b0e1268a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule }:
{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule, shortenPerlShebang }:
stdenv.mkDerivation {
name = "${name}-${sqitchModule.version}";
@ -8,6 +8,8 @@ stdenv.mkDerivation {
src = sqitchModule;
dontBuild = true;
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang;
installPhase = ''
mkdir -p $out/bin
for d in bin/sqitch etc lib share ; do
@ -17,6 +19,8 @@ stdenv.mkDerivation {
ln -s ${sqitchModule}/$d $out/$d
fi
done
'' + stdenv.lib.optionalString stdenv.isDarwin ''
shortenPerlShebang $out/bin/sqitch
'';
dontStrip = true;
postFixup = "wrapProgram $out/bin/sqitch --prefix PERL5LIB : $PERL5LIB";