2015-09-15 05:27:19 +01:00
|
|
|
{fetchurl, stdenv, unixODBC, glibc, libtool, openssl, zlib, postgresql, mysql, sqlite}:
|
2008-06-12 00:03:30 +01:00
|
|
|
# each attr contains the name deriv referencing the derivation and ini which
|
|
|
|
# evaluates to a string which can be appended to the global unix odbc ini file
|
|
|
|
# to register the driver
|
|
|
|
# I haven't done any parameter tweaking.. So the defaults provided here might be bad
|
|
|
|
{
|
|
|
|
# new postgres connector library (doesn't work yet)
|
|
|
|
psqlng = rec {
|
|
|
|
deriv = stdenv.mkDerivation {
|
|
|
|
name = "unix-odbc-pg-odbcng-0.90.101";
|
|
|
|
buildInputs = [ unixODBC glibc libtool postgresql ];
|
2015-09-15 05:27:19 +01:00
|
|
|
# added -ltdl to resolve missing references `dlsym' `dlerror' `dlopen' `dlclose'
|
2008-06-12 00:03:30 +01:00
|
|
|
preConfigure="
|
|
|
|
export CPPFLAGS=-I${unixODBC}/include
|
|
|
|
export LDFLAGS='-L${unixODBC}/lib -lltdl'
|
|
|
|
";
|
|
|
|
src = fetchurl {
|
|
|
|
# using my mirror because original url is https
|
|
|
|
# https://projects.commandprompt.com/public/odbcng/attachment/wiki/Downloads/odbcng-0.90.101.tar.gz";
|
|
|
|
url = http://mawercer.de/~publicrepos/odbcng-0.90.101.tar.gz;
|
|
|
|
sha256 = "13z3sify4z2jcil379704w0knkpflg6di4jh6zx1x2gdgzydxa1y";
|
|
|
|
};
|
|
|
|
meta = {
|
|
|
|
description = "unix odbc driver for postgresql";
|
|
|
|
homepage = https://projects.commandprompt.com/public/odbcng;
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2008-06-12 00:03:30 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
ini = "";
|
|
|
|
};
|
|
|
|
# official postgres connector
|
|
|
|
psql = rec {
|
2014-02-03 20:03:05 +00:00
|
|
|
deriv = stdenv.mkDerivation rec {
|
|
|
|
name = "psqlodbc-09.03.0100";
|
2008-06-12 00:03:30 +01:00
|
|
|
buildInputs = [ unixODBC libtool postgresql openssl ];
|
|
|
|
preConfigure="
|
|
|
|
export CPPFLAGS=-I${unixODBC}/include
|
|
|
|
export LDFLAGS='-L${unixODBC}/lib -lltdl'
|
|
|
|
";
|
2015-09-15 05:27:19 +01:00
|
|
|
# added -ltdl to resolve missing references `dlsym' `dlerror' `dlopen' `dlclose'
|
2008-06-12 00:03:30 +01:00
|
|
|
src = fetchurl {
|
2014-02-03 20:03:05 +00:00
|
|
|
url = "http://ftp.postgresql.org/pub/odbc/versions/src/${name}.tar.gz";
|
|
|
|
sha256 = "0mh10chkmlppidnmvgbp47v5jnphsrls28zwbvyk2crcn8gdx9q1";
|
2008-06-12 00:03:30 +01:00
|
|
|
};
|
|
|
|
meta = {
|
|
|
|
description = "unix odbc driver for postgresql";
|
|
|
|
homepage = http://pgfoundry.org/projects/psqlodbc/;
|
|
|
|
license = "LGPL";
|
|
|
|
};
|
|
|
|
};
|
2015-09-15 05:27:19 +01:00
|
|
|
ini =
|
2008-06-12 00:03:30 +01:00
|
|
|
"[PostgreSQL]\n" +
|
|
|
|
"Description = official PostgreSQL driver for Linux & Win32\n" +
|
|
|
|
"Driver = ${deriv}/lib/psqlodbcw.so\n" +
|
|
|
|
"Threading = 2\n";
|
|
|
|
};
|
|
|
|
# mysql connector
|
|
|
|
mysql = rec {
|
|
|
|
libraries = ["lib/libmyodbc3-3.51.12.so"];
|
|
|
|
deriv = stdenv.mkDerivation {
|
|
|
|
name = "mysql-connector-odbc-3.51.12";
|
|
|
|
src = fetchurl {
|
|
|
|
url = http://ftp.snt.utwente.nl/pub/software/mysql/Downloads/MyODBC3/mysql-connector-odbc-3.51.12.tar.gz;
|
|
|
|
md5 = "a484f590464fb823a8f821b2f1fd7fef";
|
|
|
|
};
|
|
|
|
configureFlags = "--disable-gui"
|
2015-04-02 00:39:50 +01:00
|
|
|
+ " --with-mysql-path=${mysql.lib} --with-unixODBC=${unixODBC}";
|
|
|
|
buildInputs = [ libtool zlib ];
|
2008-06-12 00:03:30 +01:00
|
|
|
inherit mysql unixODBC;
|
|
|
|
};
|
|
|
|
ini =
|
|
|
|
"[MYSQL]\n" +
|
|
|
|
"Description = MySQL driver\n" +
|
|
|
|
"Driver = ${deriv}/lib/libmyodbc3-3.51.12.so\n" +
|
|
|
|
"CPTimeout = \n" +
|
|
|
|
"CPReuse = \n" +
|
|
|
|
"FileUsage = 3\n ";
|
|
|
|
};
|
2008-06-12 16:54:57 +01:00
|
|
|
sqlite = rec {
|
2013-10-30 17:00:09 +00:00
|
|
|
deriv = let version = "0.995"; in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "sqlite-connector-odbc-${version}";
|
|
|
|
|
2008-06-12 16:54:57 +01:00
|
|
|
src = fetchurl {
|
2013-10-30 17:00:09 +00:00
|
|
|
url = "http://www.ch-werner.de/sqliteodbc/sqliteodbc-${version}.tar.gz";
|
|
|
|
sha256 = "1r97fw6xy5w2f8c0ii7blfqfi6salvd3k8wnxpx9wqc1gxk8jnyy";
|
2008-06-12 16:54:57 +01:00
|
|
|
};
|
2013-10-30 17:00:09 +00:00
|
|
|
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
|
2008-06-12 16:54:57 +01:00
|
|
|
configureFlags = "--with-sqlite3=${sqlite} --with-odbc=${unixODBC}";
|
2013-10-30 17:00:09 +00:00
|
|
|
|
2014-02-03 16:58:23 +00:00
|
|
|
# move libraries to $out/lib where they're expected to be
|
2013-10-30 17:00:09 +00:00
|
|
|
postInstall = ''
|
2014-02-03 16:58:23 +00:00
|
|
|
mkdir -p "$out/lib"
|
|
|
|
mv "$out"/*.so "$out/lib"
|
|
|
|
mv "$out"/*.la "$out/lib"
|
2013-10-30 17:00:09 +00:00
|
|
|
'';
|
|
|
|
|
2015-09-15 05:27:19 +01:00
|
|
|
meta = {
|
2013-10-30 17:00:09 +00:00
|
|
|
description = "ODBC driver for SQLite";
|
|
|
|
homepage = http://www.ch-werner.de/sqliteodbc;
|
|
|
|
license = stdenv.lib.licenses.bsd2;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ vlstill ];
|
2008-06-12 16:54:57 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
ini =
|
|
|
|
"[SQLite]\n" +
|
|
|
|
"Description = SQLite ODBC Driver\n" +
|
|
|
|
"Driver = ${deriv}/lib/libsqlite3odbc.so\n" +
|
|
|
|
"Setup = ${deriv}/lib/libsqlite3odbc.so\n" +
|
|
|
|
"Threading = 2\n";
|
|
|
|
};
|
2008-06-12 00:03:30 +01:00
|
|
|
}
|