summary refs log tree commit diff
path: root/pkgs/development/libraries/libdbi-drivers/0.8.2-1.nix
blob: 575d141fcf5c037a209c6d8b1fa5e51ef3af56a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
args : with args;
	let localDefs = builderDefs.passthru.function {
		src = /* put a fetchurl here */
			fetchurl {
				url = mirror://sourceforge/libdbi-drivers/libdbi-drivers-0.8.2-1.tar.gz;
				sha256 = "1bflwl1k3rf1h8clx3zv5pxnm5hbhq6izikv0phkss3qxkjm61ap";
			};

		buildInputs = [libdbi]  
		++(if args ? mysql then [args.mysql] else [])
		++(if args ? sqlite then [args.sqlite] else [])
		;
		configureFlags = [
			" --enable-libdbi "
			" --with-dbi-incdir=${libdbi}/include " 
			" --with-dbi-libdir=${libdbi}/lib " 
		]
		++ (if args ? mysql then [
			" --with-mysql "
			" --with-mysql-incdir=${args.mysql}/include/mysql " 
			" --with-mysql-libdir=${args.mysql}/lib/mysql " 
		] else [])
		++ (if args ? sqlite then [
			" --with-sqlite "
			" --with-sqlite-incdir=${args.sqlite}/include/sqlite " 
			" --with-sqlite-libdir=${args.sqlite}/lib/sqlite " 
		] else [])
		;
	};
	in with localDefs;
stdenv.mkDerivation rec {
	name = "libdbi"+version;
	builder = writeScript (name + "-builder")
		(textClosure localDefs [doConfigure doMakeInstall doForceShare doPropagate]);
	meta = {
		description = "
	DB independent interface to DB; DB drivers (mysql only for now).
";
		inherit src;
	};
}