From 9dd45a58cf552196f4d62502c7c5f8e072316c53 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 11 Jun 2008 23:03:30 +0000 Subject: [PATCH] added unixODBCDrivers expression containing unixODBC Postgres connector driver integrating prior pkgs/development/libraries/mysql-connector-odbc/default.nix driver Also provides ini strings for assembling /etc/odbcinst.ini svn path=/nixpkgs/trunk/; revision=12044 --- .../libraries/mysql-connector-odbc/builder.sh | 7 -- .../mysql-connector-odbc/default.nix | 13 --- .../libraries/unixODBC/default.nix | 2 +- .../libraries/unixODBCDrivers/default.nix | 80 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 9 ++- 5 files changed, 86 insertions(+), 25 deletions(-) delete mode 100644 pkgs/development/libraries/mysql-connector-odbc/builder.sh delete mode 100644 pkgs/development/libraries/mysql-connector-odbc/default.nix create mode 100644 pkgs/development/libraries/unixODBCDrivers/default.nix diff --git a/pkgs/development/libraries/mysql-connector-odbc/builder.sh b/pkgs/development/libraries/mysql-connector-odbc/builder.sh deleted file mode 100644 index 7bf6f996bbce..000000000000 --- a/pkgs/development/libraries/mysql-connector-odbc/builder.sh +++ /dev/null @@ -1,7 +0,0 @@ -source $stdenv/setup - -configureFlags="$configureFlags \ - --with-mysql-path=$mysql \ - --with-unixODBC=$unixODBC" - -genericBuild \ No newline at end of file diff --git a/pkgs/development/libraries/mysql-connector-odbc/default.nix b/pkgs/development/libraries/mysql-connector-odbc/default.nix deleted file mode 100644 index 47c14a4d793d..000000000000 --- a/pkgs/development/libraries/mysql-connector-odbc/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{stdenv, fetchurl, mysql, libtool, zlib, unixODBC}: - -stdenv.mkDerivation { - name = "mysql-connector-odbc-3.51.12"; - builder = ./builder.sh; - 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"; - buildInputs = [libtool zlib]; - inherit mysql unixODBC; -} diff --git a/pkgs/development/libraries/unixODBC/default.nix b/pkgs/development/libraries/unixODBC/default.nix index 9049504b7e55..932873ffe94c 100644 --- a/pkgs/development/libraries/unixODBC/default.nix +++ b/pkgs/development/libraries/unixODBC/default.nix @@ -6,5 +6,5 @@ stdenv.mkDerivation { url = mirror://sourceforge/unixodbc/unixODBC-2.2.11.tar.gz; md5 = "9ae806396844e38244cf65ad26ba0f23"; }; - configureFlags = "--disable-gui"; + configureFlags = "--disable-gui --sysconfdir=/etc"; } diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix new file mode 100644 index 000000000000..8072e9cedfc7 --- /dev/null +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -0,0 +1,80 @@ +args : with args; +# 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 ]; + # added -ltdl to resolve missing references `dlsym' `dlerror' `dlopen' `dlclose' + 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; + license = "GPL2"; + }; + }; + ini = ""; + }; +# official postgres connector + psql = rec { + deriv = stdenv.mkDerivation { + name = "psql-odbc-08.03.0200"; + buildInputs = [ unixODBC libtool postgresql openssl ]; + preConfigure=" + export CPPFLAGS=-I${unixODBC}/include + export LDFLAGS='-L${unixODBC}/lib -lltdl' + "; + # added -ltdl to resolve missing references `dlsym' `dlerror' `dlopen' `dlclose' + src = fetchurl { + url = http://wwwmaster.postgresql.org/redir?setmir=53&typ=h&url=http://ftp.de.postgresql.org/mirror/postgresql//odbc/versions/src/psqlodbc-08.03.0200.tar.gz; + name = "psqlodbc-08.03.0200.tar.gz"; + sha256 = "1401hgzvs3m2yr2nbbf9gfy2wwijrk4ihwz972arbn0krsiwxya1"; + }; + meta = { + description = "unix odbc driver for postgresql"; + homepage = http://pgfoundry.org/projects/psqlodbc/; + license = "LGPL"; + }; + }; + ini = + "[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" + + " --with-mysql-path=${mysql} --with-unixODBC=${unixODBC}"; + buildInputs = [libtool zlib]; + 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 "; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e40daac86478..d9f080715975 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3113,10 +3113,6 @@ let pkgs = rec { inherit fetchurl stdenv python; }; - mysqlConnectorODBC = import ../development/libraries/mysql-connector-odbc { - inherit fetchurl stdenv mysql libtool zlib unixODBC; - }; - ncursesFun = lib.sumArgs (import ../development/libraries/ncurses) { inherit fetchurl stdenv; unicode = (system != "i686-cygwin"); @@ -3332,6 +3328,11 @@ let pkgs = rec { inherit fetchurl stdenv; }; + unixODBCDrivers = recurseIntoAttrs (import ../development/libraries/unixODBCDrivers { + inherit fetchurl stdenv unixODBC glibc libtool openssl zlib; + inherit postgresql mysql; + }); + wxGTK = wxGTK26; wxGTK26 = import ../development/libraries/wxGTK-2.6 {