Additions to deb-package to handle more borderline cases (which constitute 90%, of course).

svn path=/nixpkgs/trunk/; revision=10907
This commit is contained in:
Michael Raskin 2008-03-02 18:33:54 +00:00
parent 1452c1facc
commit ebe1aed1b3

View File

@ -1,11 +1,17 @@
args : with args; args : with args;
let let
localDefs = with (builderDefs {src="";} null); localDefs = with (builderDefs {src="";} null);
builderDefs { let
checkFlag = flag : lib.getAttr [flag] false args;
in
builderDefs {
inherit src; inherit src;
inherit checkFlag;
buildInputs = []; buildInputs = [];
configureFlags = []; configureFlags = [];
makeFlags = []; makeFlags = if (checkFlag "omitConfigure")
then [" PREFIX=$out "]
else [];
patch = null; patch = null;
meta = {}; meta = {};
doInstall = if args ? Install then doInstall = if args ? Install then
@ -23,6 +29,14 @@ args : with args;
sed -e 's/-o root//' -i Makefile Makefile.in Makefile.new || true; sed -e 's/-o root//' -i Makefile Makefile.in Makefile.new || true;
sed -e 's/-g root//' -i Makefile Makefile.in Makefile.new || true; sed -e 's/-g root//' -i Makefile Makefile.in Makefile.new || true;
'' ''
+(if (checkFlag "omitFilePatches") then "" else
''
if test -d debian/patches; then
for i in debian/patches/*; do
patch -Np0 -i $i;
done;
fi;
'')
+ (if args ? extraReplacements then + (if args ? extraReplacements then
args.extraReplacements args.extraReplacements
else ""))["minInit" "doUnpack"]; else ""))["minInit" "doUnpack"];
@ -32,7 +46,8 @@ stdenv.mkDerivation rec {
name = localDefs.name + "deb"; name = localDefs.name + "deb";
builder = writeScript (name + "-builder") builder = writeScript (name + "-builder")
(textClosure localDefs ([debPatch] ++ (textClosure localDefs ([debPatch] ++
(lib.optional (! (args ? omitConfigure)) "doConfigure") (lib.optional (! (checkFlag "omitConfigure")) "doConfigure")
++ [doInstall doForceShare])); ++ [doInstall doForceShare]));
inherit meta; inherit meta;
inherit src;
} }