Files
nixpkgs/pkgs/by-name/ps/psqlodbc/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

68 lines
1.4 KiB
Nix

{
autoreconfHook,
fetchFromGitHub,
lib,
libpq,
nix-update-script,
openssl,
stdenv,
withLibiodbc ? false,
libiodbc,
withUnixODBC ? true,
unixODBC,
}:
assert lib.xor withLibiodbc withUnixODBC;
stdenv.mkDerivation (finalAttrs: {
pname = "psqlodbc";
version = "17.00.0006";
src = fetchFromGitHub {
owner = "postgresql-interfaces";
repo = "psqlodbc";
tag = "REL-${lib.replaceString "." "_" finalAttrs.version}";
hash = "sha256-iu1PWkfOyWtMmy7/8W+acu8v+e8nUPkCIHtVNZ8HzRg=";
};
buildInputs = [
libpq
openssl
]
++ lib.optional withLibiodbc libiodbc
++ lib.optional withUnixODBC unixODBC;
nativeBuildInputs = [
autoreconfHook
];
strictDeps = true;
configureFlags = [
"CPPFLAGS=-DSQLCOLATTRIBUTE_SQLLEN" # needed for cross
"--with-libpq=${lib.getDev libpq}"
]
++ lib.optional withLibiodbc "--with-iodbc=${libiodbc}"
++ lib.optional withUnixODBC "--with-unixodbc=${unixODBC}";
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version-regex=^REL-(\\d+)_(\\d+)_(\\d+)$" ];
};
}
// lib.optionalAttrs withUnixODBC {
fancyName = "PostgreSQL";
driver = "lib/psqlodbcw.so";
};
meta = {
homepage = "https://odbc.postgresql.org/";
description = "ODBC driver for PostgreSQL";
license = lib.licenses.lgpl2;
platforms = lib.platforms.unix;
teams = libpq.meta.teams;
};
})