1 { lib, stdenv, fetchurl, libdbi
2 , libmysqlclient ? null
8 stdenv.mkDerivation rec {
9 name = "libdbi-drivers-0.9.0";
12 url = "mirror://sourceforge/libdbi-drivers/${name}.tar.gz";
13 sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3";
16 buildInputs = [ libdbi sqlite postgresql ] ++ optional (libmysqlclient != null) libmysqlclient;
19 sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure;
24 "--localstatedir=/var"
27 "--with-dbi-incdir=${libdbi}/include"
28 "--with-dbi-libdir=${libdbi}/lib"
29 ] ++ optionals (libmysqlclient != null) [
31 "--with-mysql-incdir=${getDev libmysqlclient}/include/mysql"
32 "--with-mysql-libdir=${libmysqlclient}/lib/mysql"
33 ] ++ optionals (sqlite != null) [
35 "--with-sqlite3-incdir=${sqlite.dev}/include/sqlite"
36 "--with-sqlite3-libdir=${sqlite.out}/lib/sqlite"
37 ] ++ optionals (postgresql != null) [
39 "--with-pgsql_incdir=${postgresql}/include"
40 "--with-pgsql_libdir=${postgresql.lib}/lib"
43 installFlags = [ "DESTDIR=\${out}" ];
48 while rmdir $DIR 2>/dev/null; do
49 DIR="$(dirname "$DIR")"
52 # Remove the unneeded var/lib directories
57 homepage = "http://libdbi-drivers.sourceforge.net/";
58 description = "Database drivers for libdbi";
59 platforms = platforms.all;
60 license = licenses.lgpl21;