Improved builder for Sqitch

This commit is contained in:
Robin Bate Boerop
2015-03-18 10:32:46 -03:00
parent 566cd9ba19
commit a3a98d7242
3 changed files with 21 additions and 23 deletions
+9 -14
View File
@@ -1,20 +1,15 @@
{ stdenv, writeScript, makeWrapper, sqitchModule }:
stdenv.mkDerivation rec {
name = "sqitch-0.999";
buildInputs = [ makeWrapper ];
builder = writeScript (name + "-builder.sh") ''
. ${stdenv}/setup
{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule }:
stdenv.mkDerivation {
name = "${name}-${sqitchModule.version}";
buildInputs = [ perl makeWrapper sqitchModule databaseModule ];
unpackPhase = ":";
buildPhase = ":";
installPhase = ''
mkdir -p $out/bin
for d in bin/sqitch etc lib share ; do
ln -s ${sqitchModule}/$d $out/$d
done
fixupPhase
wrapProgram $out/bin/sqitch \
--prefix PERL5LIB : \
"$(for i in $(cat ${sqitchModule}/nix-support/propagated-native-build-inputs) ; do
echo -n "$i"/lib/perl5/site_perl:
done
echo ${sqitchModule}/lib/perl5/site_perl
)"
'';
dontStrip = true;
postFixup = "wrapProgram $out/bin/sqitch --prefix PERL5LIB : $PERL5LIB";
}