2015-03-11 22:28:01 +00:00
|
|
|
{ stdenv, fetchurl, libdbi
|
2019-09-22 08:38:09 +01:00
|
|
|
, libmysqlclient ? null
|
2017-12-28 08:54:41 +00:00
|
|
|
, sqlite ? null
|
|
|
|
, postgresql ? null
|
2015-03-11 22:28:01 +00:00
|
|
|
}:
|
2007-12-01 16:20:23 +00:00
|
|
|
|
2015-03-11 22:28:01 +00:00
|
|
|
with stdenv.lib;
|
2007-12-01 16:20:23 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-03-11 22:28:01 +00:00
|
|
|
name = "libdbi-drivers-0.9.0";
|
2010-07-29 19:55:16 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/libdbi-drivers/${name}.tar.gz";
|
2015-03-11 22:28:01 +00:00
|
|
|
sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3";
|
2010-07-29 19:55:16 +01:00
|
|
|
};
|
|
|
|
|
2019-09-22 08:38:09 +01:00
|
|
|
buildInputs = [ libdbi sqlite postgresql ] ++ optional (libmysqlclient != null) libmysqlclient;
|
2015-03-11 22:28:01 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure;
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--disable-docs"
|
|
|
|
"--enable-libdbi"
|
|
|
|
"--with-dbi-incdir=${libdbi}/include"
|
|
|
|
"--with-dbi-libdir=${libdbi}/lib"
|
2019-09-22 08:38:09 +01:00
|
|
|
] ++ optionals (libmysqlclient != null) [
|
2015-03-11 22:28:01 +00:00
|
|
|
"--with-mysql"
|
2019-09-22 08:38:09 +01:00
|
|
|
"--with-mysql-incdir=${libmysqlclient}/include/mysql"
|
|
|
|
"--with-mysql-libdir=${libmysqlclient}/lib/mysql"
|
2015-03-11 22:28:01 +00:00
|
|
|
] ++ optionals (sqlite != null) [
|
|
|
|
"--with-sqlite3"
|
2015-10-13 21:30:30 +01:00
|
|
|
"--with-sqlite3-incdir=${sqlite.dev}/include/sqlite"
|
|
|
|
"--with-sqlite3-libdir=${sqlite.out}/lib/sqlite"
|
2017-12-28 08:54:41 +00:00
|
|
|
] ++ optionals (postgresql != null) [
|
|
|
|
"--with-pgsql"
|
|
|
|
"--with-pgsql_incdir=${postgresql}/include"
|
|
|
|
"--with-pgsql_libdir=${postgresql.lib}/lib"
|
2015-03-11 22:28:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
installFlags = [ "DESTDIR=\${out}" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/$out/* $out
|
|
|
|
DIR=$out/$out
|
|
|
|
while rmdir $DIR 2>/dev/null; do
|
|
|
|
DIR="$(dirname "$DIR")"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Remove the unneeded var/lib directories
|
|
|
|
rm -rf $out/var
|
|
|
|
'';
|
2019-01-26 10:01:09 +00:00
|
|
|
|
2010-07-29 19:55:16 +01:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://libdbi-drivers.sourceforge.net/";
|
2010-07-29 19:55:16 +01:00
|
|
|
description = "Database drivers for libdbi";
|
2015-03-11 22:28:01 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.lgpl21;
|
2010-07-29 19:55:16 +01:00
|
|
|
};
|
2007-12-01 16:20:23 +00:00
|
|
|
}
|