nixpkgs/pkgs/development/tools/misc/sqitch/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Nix
Raw Normal View History

2020-12-16 02:05:38 +00:00
{ stdenv
, lib
, perlPackages
, makeWrapper
, shortenPerlShebang
, mysqlSupport ? false
, postgresqlSupport ? false
, 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
++ lib.optional postgresqlSupport DBDPg
++ lib.optional templateToolkitSupport TemplateToolkit;
2020-12-16 02:05:38 +00:00
in
2015-03-18 13:32:46 +00:00
stdenv.mkDerivation {
2020-12-16 02:05:38 +00:00
pname = "sqitch";
version = sqitch.version;
2020-12-16 02:05:38 +00:00
nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin shortenPerlShebang;
2020-12-16 02:05:38 +00:00
src = sqitch;
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 = ''
wrapProgram $out/bin/sqitch --prefix PERL5LIB : ${lib.escapeShellArg (perlPackages.makeFullPerlPath modules)}
2020-12-16 02:05:38 +00:00
'';
meta = {
2020-12-16 02:05:38 +00:00
inherit (sqitch.meta) description homepage license platforms;
};
2015-03-15 13:59:41 +00:00
}