2020-12-16 02:05:38 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, perlPackages
|
|
|
|
, makeWrapper
|
|
|
|
, shortenPerlShebang
|
|
|
|
, mysqlSupport ? false
|
|
|
|
, postgresqlSupport ? false
|
2023-02-06 21:56:25 +00:00
|
|
|
, templateToolkitSupport ? false
|
2020-12-16 02:05:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
sqitch = perlPackages.AppSqitch;
|
2023-06-12 15:04:26 +00:00
|
|
|
modules = with perlPackages; [ AlgorithmBackoff ]
|
2020-12-16 02:05:38 +00:00
|
|
|
++ lib.optional mysqlSupport DBDmysql
|
2023-02-06 21:56:25 +00:00
|
|
|
++ lib.optional postgresqlSupport DBDPg
|
|
|
|
++ lib.optional templateToolkitSupport TemplateToolkit;
|
2020-12-16 02:05:38 +00:00
|
|
|
in
|
2016-05-04 10:08:35 +00:00
|
|
|
|
2015-03-18 13:32:46 +00:00
|
|
|
stdenv.mkDerivation {
|
2020-12-16 02:05:38 +00:00
|
|
|
pname = "sqitch";
|
|
|
|
version = sqitch.version;
|
2016-05-04 10:08:35 +00:00
|
|
|
|
2020-12-16 02:05:38 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin shortenPerlShebang;
|
2016-05-04 10:08:35 +00:00
|
|
|
|
2020-12-16 02:05:38 +00:00
|
|
|
src = sqitch;
|
2016-05-04 10:08:35 +00:00
|
|
|
dontBuild = true;
|
|
|
|
|
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 07:10:35 +00:00
|
|
|
# make sure dest alreay exists before symlink
|
|
|
|
# this prevents installing a broken link into the path
|
2020-12-16 02:05:38 +00:00
|
|
|
if [ -e ${sqitch}/$d ]; then
|
|
|
|
ln -s ${sqitch}/$d $out/$d
|
2017-10-14 07:10:35 +00:00
|
|
|
fi
|
2015-03-15 15:06:01 +00:00
|
|
|
done
|
2020-12-16 02:05:38 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2019-12-18 09:20:00 +00:00
|
|
|
shortenPerlShebang $out/bin/sqitch
|
2015-03-15 13:59:41 +00:00
|
|
|
'';
|
2015-03-18 13:32:46 +00:00
|
|
|
dontStrip = true;
|
2020-12-16 02:05:38 +00:00
|
|
|
postFixup = ''
|
2022-05-06 16:33:53 +00:00
|
|
|
wrapProgram $out/bin/sqitch --prefix PERL5LIB : ${lib.escapeShellArg (perlPackages.makeFullPerlPath modules)}
|
2020-12-16 02:05:38 +00:00
|
|
|
'';
|
2016-08-02 16:06:29 +00:00
|
|
|
|
|
|
|
meta = {
|
2020-12-16 02:05:38 +00:00
|
|
|
inherit (sqitch.meta) description homepage license platforms;
|
2016-08-02 16:06:29 +00:00
|
|
|
};
|
2015-03-15 13:59:41 +00:00
|
|
|
}
|