2019-12-18 10:20:00 +01:00
|
|
|
{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule, shortenPerlShebang }:
|
2016-05-04 12:08:35 +02:00
|
|
|
|
2015-03-18 14:32:46 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "${name}-${sqitchModule.version}";
|
2016-05-04 12:08:35 +02:00
|
|
|
|
2015-03-18 14:32:46 +01:00
|
|
|
buildInputs = [ perl makeWrapper sqitchModule databaseModule ];
|
2016-05-04 12:08:35 +02:00
|
|
|
|
|
|
|
src = sqitchModule;
|
|
|
|
dontBuild = true;
|
|
|
|
|
2019-12-18 10:20:00 +01:00
|
|
|
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang;
|
|
|
|
|
2015-03-18 14:32:46 +01:00
|
|
|
installPhase = ''
|
2015-03-15 14:59:41 +01:00
|
|
|
mkdir -p $out/bin
|
2015-03-15 16:06:01 +01:00
|
|
|
for d in bin/sqitch etc lib share ; do
|
2017-10-14 09:10:35 +02: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 16:06:01 +01:00
|
|
|
done
|
2019-12-18 10:20:00 +01:00
|
|
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
shortenPerlShebang $out/bin/sqitch
|
2015-03-15 14:59:41 +01:00
|
|
|
'';
|
2015-03-18 14:32:46 +01:00
|
|
|
dontStrip = true;
|
|
|
|
postFixup = "wrapProgram $out/bin/sqitch --prefix PERL5LIB : $PERL5LIB";
|
2016-08-02 18:06:29 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2018-11-08 20:45:51 +01:00
|
|
|
inherit (sqitchModule.meta) license;
|
2016-08-02 18:06:29 +02:00
|
|
|
};
|
2015-03-15 14:59:41 +01:00
|
|
|
}
|