unixODBCDrivers: update and refactor, mark mysql packages as broken

+114 -99
+114 -99
pkgs/development/libraries/unixODBCDrivers/default.nix
··· 1 - {fetchurl, stdenv, unixODBC, glibc, libtool, openssl, zlib, postgresql, mysql, sqlite}: 2 - # each attr contains the name deriv referencing the derivation and ini which 3 - # evaluates to a string which can be appended to the global unix odbc ini file 4 - # to register the driver 1 + { fetchurl, stdenv, unixODBC, cmake, postgresql, mysql55, mariadb, sqlite, zlib, libxml2 }: 2 + 5 3 # I haven't done any parameter tweaking.. So the defaults provided here might be bad 4 + 6 5 { 7 - # new postgres connector library (doesn't work yet) 8 - psqlng = rec { 9 - deriv = stdenv.mkDerivation { 10 - name = "unix-odbc-pg-odbcng-0.90.101"; 11 - buildInputs = [ unixODBC glibc libtool postgresql ]; 12 - # added -ltdl to resolve missing references `dlsym' `dlerror' `dlopen' `dlclose' 13 - preConfigure=" 14 - export CPPFLAGS=-I${unixODBC}/include 15 - export LDFLAGS='-L${unixODBC}/lib -lltdl' 16 - "; 17 - src = fetchurl { 18 - # using my mirror because original url is https 19 - # https://projects.commandprompt.com/public/odbcng/attachment/wiki/Downloads/odbcng-0.90.101.tar.gz"; 20 - url = http://mawercer.de/~publicrepos/odbcng-0.90.101.tar.gz; 21 - sha256 = "13z3sify4z2jcil379704w0knkpflg6di4jh6zx1x2gdgzydxa1y"; 22 - }; 23 - meta = { 24 - description = "unix odbc driver for postgresql"; 25 - homepage = https://projects.commandprompt.com/public/odbcng; 26 - license = stdenv.lib.licenses.gpl2; 27 - }; 6 + psql = stdenv.mkDerivation rec { 7 + name = "psqlodbc-${version}"; 8 + version = "09.05.0210"; 9 + 10 + src = fetchurl { 11 + url = "http://ftp.postgresql.org/pub/odbc/versions/src/${name}.tar.gz"; 12 + sha256 = "0317zrxaiy209xzcc6b5sz6hsyiv4zm74iikp91rgz7z3ll4n4dc"; 13 + }; 14 + 15 + buildInputs = [ unixODBC postgresql ]; 16 + 17 + passthru = { 18 + fancyName = "PostgreSQL"; 19 + driver = "lib/psqlodbcw.so"; 20 + }; 21 + 22 + meta = with stdenv.lib; { 23 + description = "Official PostgreSQL ODBC Driver"; 24 + homepage = https://odbc.postgresql.org/; 25 + license = licenses.lgpl2; 26 + platforms = platforms.linux; 28 27 }; 29 - ini = ""; 30 28 }; 31 - # official postgres connector 32 - psql = rec { 33 - deriv = stdenv.mkDerivation rec { 34 - name = "psqlodbc-09.03.0100"; 35 - buildInputs = [ unixODBC libtool postgresql openssl ]; 36 - preConfigure=" 37 - export CPPFLAGS=-I${unixODBC}/include 38 - export LDFLAGS='-L${unixODBC}/lib -lltdl' 39 - "; 40 - # added -ltdl to resolve missing references `dlsym' `dlerror' `dlopen' `dlclose' 29 + 30 + mariadb = stdenv.mkDerivation rec { 31 + name = "mariadb-connector-odbc-${version}"; 32 + version = "2.0.10"; 33 + 41 34 src = fetchurl { 42 - url = "http://ftp.postgresql.org/pub/odbc/versions/src/${name}.tar.gz"; 43 - sha256 = "0mh10chkmlppidnmvgbp47v5jnphsrls28zwbvyk2crcn8gdx9q1"; 35 + url = "https://downloads.mariadb.org/interstitial/connector-odbc-${version}/src/${name}-ga-src.tar.gz"; 36 + sha256 = "0b6ximy0dg0xhqbrm1l7pn8hjapgpmddi67kh54h6i9cq9hqfdvz"; 37 + }; 38 + 39 + nativeBuildInputs = [ cmake ]; 40 + buildInputs = [ unixODBC mariadb ]; 41 + 42 + cmakeFlags = [ 43 + "-DMARIADB_INCLUDE_DIR=${mariadb.lib}/include/mysql" 44 + ]; 45 + 46 + preConfigure = '' 47 + sed -i \ 48 + -e 's,mariadb_config,mysql_config,g' \ 49 + -e 's,libmariadbclient,libmysqlclient,g' \ 50 + cmake/FindMariaDB.cmake 51 + ''; 52 + 53 + passthru = { 54 + fancyName = "MariaDB"; 55 + driver = "lib/libmyodbc3-3.51.12.so"; 44 56 }; 45 - meta = { 46 - description = "unix odbc driver for postgresql"; 47 - homepage = http://pgfoundry.org/projects/psqlodbc/; 48 - license = "LGPL"; 57 + 58 + meta = with stdenv.lib; { 59 + description = "MariaDB ODBC database driver"; 60 + homepage = https://downloads.mariadb.org/connector-odbc/; 61 + license = licenses.gpl2; 62 + platforms = platforms.linux; 63 + broken = true; 49 64 }; 50 65 }; 51 - ini = 52 - "[PostgreSQL]\n" + 53 - "Description = official PostgreSQL driver for Linux & Win32\n" + 54 - "Driver = ${deriv}/lib/psqlodbcw.so\n" + 55 - "Threading = 2\n"; 56 - }; 57 - # mysql connector 58 - mysql = rec { 59 - libraries = ["lib/libmyodbc3-3.51.12.so"]; 60 - deriv = stdenv.mkDerivation { 61 - name = "mysql-connector-odbc-3.51.12"; 62 - src = fetchurl { 63 - url = http://ftp.snt.utwente.nl/pub/software/mysql/Downloads/MyODBC3/mysql-connector-odbc-3.51.12.tar.gz; 64 - md5 = "a484f590464fb823a8f821b2f1fd7fef"; 65 - }; 66 - configureFlags = "--disable-gui" 67 - + " --with-mysql-path=${mysql.lib} --with-unixODBC=${unixODBC}"; 68 - buildInputs = [ libtool zlib ]; 69 - inherit mysql unixODBC; 66 + 67 + mysql = stdenv.mkDerivation rec { 68 + name = "mysql-connector-odbc-${version}"; 69 + majorVersion = "5.3"; 70 + version = "${majorVersion}.6"; 71 + 72 + src = fetchurl { 73 + url = "https://dev.mysql.com/get/Downloads/Connector-ODBC/${majorVersion}/${name}-src.tar.gz"; 74 + sha256 = "1smi4z49i4zm7cmykjkwlxxzqvn7myngsw5bc35z6gqxmi8c55xr"; 70 75 }; 71 - ini = 72 - "[MYSQL]\n" + 73 - "Description = MySQL driver\n" + 74 - "Driver = ${deriv}/lib/libmyodbc3-3.51.12.so\n" + 75 - "CPTimeout = \n" + 76 - "CPReuse = \n" + 77 - "FileUsage = 3\n "; 78 - }; 79 - sqlite = rec { 80 - deriv = let version = "0.995"; in 81 - stdenv.mkDerivation { 82 - name = "sqlite-connector-odbc-${version}"; 83 76 84 - src = fetchurl { 85 - url = "http://www.ch-werner.de/sqliteodbc/sqliteodbc-${version}.tar.gz"; 86 - sha256 = "1r97fw6xy5w2f8c0ii7blfqfi6salvd3k8wnxpx9wqc1gxk8jnyy"; 87 - }; 77 + nativeBuildInputs = [ cmake ]; 78 + buildInputs = [ unixODBC mysql55 ]; 88 79 89 - buildInputs = [ sqlite ]; 80 + cmakeFlags = [ "-DWITH_UNIXODBC=1" ]; 90 81 91 - configureFlags = "--with-sqlite3=${sqlite} --with-odbc=${unixODBC}"; 82 + passthru = { 83 + fancyName = "MySQL"; 84 + driver = "lib/libmyodbc3-3.51.12.so"; 85 + }; 92 86 93 - # move libraries to $out/lib where they're expected to be 94 - postInstall = '' 95 - mkdir -p "$out/lib" 96 - mv "$out"/*.so "$out/lib" 97 - mv "$out"/*.la "$out/lib" 98 - ''; 87 + meta = with stdenv.lib; { 88 + description = "MariaDB ODBC database driver"; 89 + homepage = https://dev.mysql.com/downloads/connector/odbc/; 90 + license = licenses.gpl2; 91 + platforms = platforms.linux; 92 + broken = true; 93 + }; 94 + }; 99 95 100 - meta = { 101 - description = "ODBC driver for SQLite"; 102 - homepage = http://www.ch-werner.de/sqliteodbc; 103 - license = stdenv.lib.licenses.bsd2; 104 - platforms = stdenv.lib.platforms.linux; 105 - maintainers = with stdenv.lib.maintainers; [ vlstill ]; 106 - }; 96 + sqlite = stdenv.mkDerivation rec { 97 + name = "sqlite-connector-odbc-${version}"; 98 + version = "0.9993"; 99 + 100 + src = fetchurl { 101 + url = "http://www.ch-werner.de/sqliteodbc/sqliteodbc-${version}.tar.gz"; 102 + sha256 = "0dgsj28sc7f7aprmdd0n5a1rmcx6pv7170c8dfjl0x1qsjxim6hs"; 103 + }; 104 + 105 + buildInputs = [ unixODBC sqlite zlib libxml2 ]; 106 + 107 + configureFlags = [ "--with-odbc=${unixODBC}" ]; 108 + 109 + installTargets = [ "install-3" ]; 110 + 111 + # move libraries to $out/lib where they're expected to be 112 + postInstall = '' 113 + mkdir -p "$out/lib" 114 + mv "$out"/*.* "$out/lib" 115 + ''; 116 + 117 + passthru = { 118 + fancyName = "SQLite"; 119 + driver = "lib/libsqlite3odbc.so"; 107 120 }; 108 - ini = 109 - "[SQLite]\n" + 110 - "Description = SQLite ODBC Driver\n" + 111 - "Driver = ${deriv}/lib/libsqlite3odbc.so\n" + 112 - "Setup = ${deriv}/lib/libsqlite3odbc.so\n" + 113 - "Threading = 2\n"; 114 - }; 121 + 122 + meta = with stdenv.lib; { 123 + description = "ODBC driver for SQLite"; 124 + homepage = http://www.ch-werner.de/sqliteodbc; 125 + license = licenses.bsd2; 126 + platforms = platforms.linux; 127 + maintainers = with maintainers; [ vlstill ]; 128 + }; 129 + }; 115 130 }