From ebe1aed1b3060552c9c1d363c5be9380463c63d5 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 2 Mar 2008 18:33:54 +0000 Subject: [PATCH] Additions to deb-package to handle more borderline cases (which constitute 90%, of course). svn path=/nixpkgs/trunk/; revision=10907 --- pkgs/build-support/deb-package/default.nix | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/deb-package/default.nix b/pkgs/build-support/deb-package/default.nix index eb49458a6f3e..e884ae6d36b1 100644 --- a/pkgs/build-support/deb-package/default.nix +++ b/pkgs/build-support/deb-package/default.nix @@ -1,11 +1,17 @@ args : with args; let localDefs = with (builderDefs {src="";} null); - builderDefs { + let + checkFlag = flag : lib.getAttr [flag] false args; + in + builderDefs { inherit src; + inherit checkFlag; buildInputs = []; configureFlags = []; - makeFlags = []; + makeFlags = if (checkFlag "omitConfigure") + then [" PREFIX=$out "] + else []; patch = null; meta = {}; 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/-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 args.extraReplacements else ""))["minInit" "doUnpack"]; @@ -32,7 +46,8 @@ stdenv.mkDerivation rec { name = localDefs.name + "deb"; builder = writeScript (name + "-builder") (textClosure localDefs ([debPatch] ++ - (lib.optional (! (args ? omitConfigure)) "doConfigure") + (lib.optional (! (checkFlag "omitConfigure")) "doConfigure") ++ [doInstall doForceShare])); inherit meta; + inherit src; }