2024-09-19 14:19:46 +00:00
|
|
|
{ lib, stdenv, fetchurl, postgresql, openssl
|
|
|
|
, withLibiodbc ? false, libiodbc
|
|
|
|
, withUnixODBC ? true, unixODBC
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert lib.xor withLibiodbc withUnixODBC;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "psqlodbc";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "16.00.0000";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-10-11 05:15:48 +00:00
|
|
|
url = "mirror://postgresql/odbc/versions.old/src/${pname}-${version}.tar.gz";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-r9iS+J0uzujT87IxTxvVvy0CIBhyxuNDHlwxCW7KTIs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
buildInputs = [
|
|
|
|
postgresql
|
|
|
|
openssl
|
|
|
|
]
|
|
|
|
++ lib.optional withLibiodbc libiodbc
|
|
|
|
++ lib.optional withUnixODBC unixODBC;
|
|
|
|
|
|
|
|
passthru = lib.optionalAttrs withUnixODBC {
|
|
|
|
fancyName = "PostgreSQL";
|
|
|
|
driver = "lib/psqlodbcw.so";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-libpq=${lib.getDev postgresql}/bin/pg_config"
|
2024-09-19 14:19:46 +00:00
|
|
|
]
|
|
|
|
++ lib.optional withLibiodbc "--with-iodbc=${libiodbc}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-30 08:33:03 +00:00
|
|
|
homepage = "https://odbc.postgresql.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "ODBC driver for PostgreSQL";
|
|
|
|
license = licenses.lgpl2;
|
2024-09-19 14:19:46 +00:00
|
|
|
platforms = platforms.unix;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|