3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/misc/sqitch/default.nix

33 lines
937 B
Nix
Raw Normal View History

2019-12-18 09:20:00 +00:00
{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule, shortenPerlShebang }:
2015-03-18 13:32:46 +00:00
stdenv.mkDerivation {
name = "${name}-${sqitchModule.version}";
2015-03-18 13:32:46 +00:00
buildInputs = [ perl makeWrapper sqitchModule databaseModule ];
src = sqitchModule;
dontBuild = true;
2019-12-18 09:20:00 +00:00
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang;
2015-03-18 13:32:46 +00:00
installPhase = ''
2015-03-15 13:59:41 +00:00
mkdir -p $out/bin
2015-03-15 15:06:01 +00:00
for d in bin/sqitch etc lib share ; do
2017-10-14 08:10:35 +01:00
# make sure dest alreay exists before symlink
# this prevents installing a broken link into the path
if [ -e ${sqitchModule}/$d ]; then
ln -s ${sqitchModule}/$d $out/$d
fi
2015-03-15 15:06:01 +00:00
done
2019-12-18 09:20:00 +00:00
'' + stdenv.lib.optionalString stdenv.isDarwin ''
shortenPerlShebang $out/bin/sqitch
2015-03-15 13:59:41 +00:00
'';
2015-03-18 13:32:46 +00:00
dontStrip = true;
postFixup = "wrapProgram $out/bin/sqitch --prefix PERL5LIB : $PERL5LIB";
meta = {
platforms = stdenv.lib.platforms.unix;
inherit (sqitchModule.meta) license;
};
2015-03-15 13:59:41 +00:00
}