Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at netboot-syslinux-multiplatform 48 lines 1.2 kB view raw
1{ stdenv 2, lib 3, perlPackages 4, makeWrapper 5, shortenPerlShebang 6, mysqlSupport ? false 7, postgresqlSupport ? false 8, templateToolkitSupport ? false 9}: 10 11let 12 sqitch = perlPackages.AppSqitch; 13 modules = with perlPackages; [ ] 14 ++ lib.optional mysqlSupport DBDmysql 15 ++ lib.optional postgresqlSupport DBDPg 16 ++ lib.optional templateToolkitSupport TemplateToolkit; 17in 18 19stdenv.mkDerivation { 20 pname = "sqitch"; 21 version = sqitch.version; 22 23 nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin shortenPerlShebang; 24 25 src = sqitch; 26 dontBuild = true; 27 28 installPhase = '' 29 mkdir -p $out/bin 30 for d in bin/sqitch etc lib share ; do 31 # make sure dest alreay exists before symlink 32 # this prevents installing a broken link into the path 33 if [ -e ${sqitch}/$d ]; then 34 ln -s ${sqitch}/$d $out/$d 35 fi 36 done 37 '' + lib.optionalString stdenv.isDarwin '' 38 shortenPerlShebang $out/bin/sqitch 39 ''; 40 dontStrip = true; 41 postFixup = '' 42 wrapProgram $out/bin/sqitch --prefix PERL5LIB : ${lib.escapeShellArg (perlPackages.makeFullPerlPath modules)} 43 ''; 44 45 meta = { 46 inherit (sqitch.meta) description homepage license platforms; 47 }; 48}