nixpkgs-suyu/pkgs/development/libraries/libdbi-drivers/default.nix

62 lines
1.6 KiB
Nix
Raw Normal View History

2015-03-11 23:28:01 +01:00
{ stdenv, fetchurl, libdbi
2015-04-23 01:06:33 +02:00
, libmysql ? null, sqlite ? null, postgresql ? null
2015-03-11 23:28:01 +01:00
}:
2015-03-11 23:28:01 +01:00
with stdenv.lib;
stdenv.mkDerivation rec {
2015-03-11 23:28:01 +01:00
name = "libdbi-drivers-0.9.0";
src = fetchurl {
url = "mirror://sourceforge/libdbi-drivers/${name}.tar.gz";
2015-03-11 23:28:01 +01:00
sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3";
};
2015-04-23 01:06:33 +02:00
buildInputs = [ libdbi libmysql sqlite postgresql ];
2015-03-11 23:28:01 +01: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"
2015-04-23 01:06:33 +02:00
] ++ optionals (libmysql != null) [
2015-03-11 23:28:01 +01:00
"--with-mysql"
2015-04-23 01:06:33 +02:00
"--with-mysql-incdir=${libmysql}/include/mysql"
"--with-mysql-libdir=${libmysql}/lib/mysql"
2015-03-11 23:28:01 +01:00
] ++ optionals (postgresql != null) [
"--with-pgsql"
"--with-pgsql_incdir=${postgresql}/include"
"--with-pgsql_libdir=${postgresql}/lib"
] ++ optionals (sqlite != null) [
"--with-sqlite3"
"--with-sqlite3-incdir=${sqlite}/include/sqlite"
"--with-sqlite3-libdir=${sqlite}/lib/sqlite"
];
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
'';
meta = {
2015-03-11 23:28:01 +01:00
homepage = http://libdbi-drivers.sourceforge.net/;
description = "Database drivers for libdbi";
2015-03-11 23:28:01 +01:00
platforms = platforms.all;
license = licenses.lgpl21;
maintainers = with maintainers; [ wkennington ];
};
}