[Nix-dev] How to handle many different versions of the same package with dependencies nicely?

Marc Weber marco-oweber at gmx.de
Sun Mar 18 21:25:56 CET 2007


I'm still trying to package wmii. ( I managed to build its perequisite
libixp ). Then after building X etc I saw that version 0.2 is to
outdated and found the newer packages here: http://www.suckless.org/snaps/

By now I have the 
dev.../libs.../libixp-0.2/default.nix
dev.../libs.../libixp-0.2/build.sh
files in the pkgs directory

When packaging all of those versions libuxp-{0.1,0.2,-snapX,-snapY,-snapZ} 
I end up having
dev.../libs.../libixp-$i/default.nix
with $i in the { } list given above, right?

Is there an easier way?

The perequisites are specified in the all-packages.nix:
[...]
wmii20070304 = import ../applications/window-managers/wmii-snap20070304 {
   inherit fetchurl stdenv libixp gawk x11;
};
[...]

Now providing different versions would force me adding

	libixp-0.2 = import ../development/libraries/libixp {
	inherit fetchurl stdenv;
	};
	libixp-snapX = import ../development/libraries/libixp {
		[...]
	}
	libixp-snapY = import [...]
	libixp-snapZ = import [...]
	libixp-snapAA = import [...]
	[...}

	wmii20070304 = import ../applications/window-managers/wmii-snap20070304 {
	   libixp = libixp-XX
	   inherit fetchurl stdenv gawk x11;
	};

Is it possible to use a syntax such like this to add the version number
as dependency?

	wmii20070304 = import ../applications/window-managers/wmii-snap20070304 {
	   libixp = libixp { version=X; }
	   inherit fetchurl stdenv gawk x11;
	};

with a libixp/default.nix
	{stdenv, fetchurl, version}:

	stdenv.mkDerivation {
	  name = "libixp-0.2";
	  description = "libixp is a stand-alone client/server 9P library including ixpc client which behaves like wmiir in the past. Its server api is based heavily on Plan 9's lib9p";
	  builder = ./build.sh;
	  src = fetchurl {
	    url = "http://libs.suckless.org/download/libixp-"+version+"tar.gz";
	    case version of
		X : md5 = "e50c613f7410bc1cff3a18926804202f";
		F : md5 = "e50c613f7410bc1cff3a18926804202f";
	    end case
	  };
	}

Marc



More information about the nix-dev mailing list