about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2008-03-02 14:56:15 +0000
committerMichael Raskin <7c6f434c@mail.ru>2008-03-02 14:56:15 +0000
commit1452c1facc9bfc9d0e49b54f8e0108e8e52c10be (patch)
tree51bee5b4524bc5f933a19b3285e00e1629ed29ae /pkgs/build-support
parent2a583e6f73e6dca3f5a2c623e1c15ade846e5218 (diff)
downloadnixlib-1452c1facc9bfc9d0e49b54f8e0108e8e52c10be.tar
nixlib-1452c1facc9bfc9d0e49b54f8e0108e8e52c10be.tar.gz
nixlib-1452c1facc9bfc9d0e49b54f8e0108e8e52c10be.tar.bz2
nixlib-1452c1facc9bfc9d0e49b54f8e0108e8e52c10be.tar.lz
nixlib-1452c1facc9bfc9d0e49b54f8e0108e8e52c10be.tar.xz
nixlib-1452c1facc9bfc9d0e49b54f8e0108e8e52c10be.tar.zst
nixlib-1452c1facc9bfc9d0e49b54f8e0108e8e52c10be.zip
Added helper for adding Debian packages
svn path=/nixpkgs/trunk/; revision=10906
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/deb-package/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/build-support/deb-package/default.nix b/pkgs/build-support/deb-package/default.nix
new file mode 100644
index 000000000000..eb49458a6f3e
--- /dev/null
+++ b/pkgs/build-support/deb-package/default.nix
@@ -0,0 +1,38 @@
+args : with args;	
+	let 
+       	localDefs = with (builderDefs {src="";} null);
+	 builderDefs {
+		inherit src;
+		buildInputs = [];
+		configureFlags = [];
+		makeFlags =  [];
+		patch = null;
+		meta = {};
+		doInstall = if args ? Install then 
+		(FullDepEntry 
+		  args.Install 
+		  (["doMake"] 
+		  ++ (lib.getAttr ["extraInstallDeps"] [] args))
+		)
+		else FullDepEntry "" ["doMakeInstall"];
+
+		debPatch = FullDepEntry ((if args ? patch then ''
+		  gunzip < ${args.patch} | patch -Np1
+		'' else "")
+		+''
+		  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 args ? extraReplacements then 
+		  args.extraReplacements 
+		else ""))["minInit" "doUnpack"];
+	} args null; /* null is a terminator for sumArgs */
+	in with localDefs;
+stdenv.mkDerivation rec {
+	name = localDefs.name + "deb";
+	builder = writeScript (name + "-builder")
+		(textClosure localDefs ([debPatch] ++ 
+		(lib.optional (! (args ? omitConfigure)) "doConfigure")
+		++ [doInstall doForceShare]));
+	inherit meta;
+}