From 45a1cbb1256e02f48c1fc0f82585da90d0b6a582 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 24 Sep 2025 12:30:04 +0200 Subject: [PATCH 1/2] krb5: fix build on FreeBSD Failed with: ``` packet.c:481:16: error: use of undeclared identifier 'ENODATA' 481 | return ENODATA; | ^ 1 error generated. ``` Fixed by applying a patch from FreeBSD ports. --- pkgs/development/libraries/kerberos/krb5.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index 514fe0155826..ef1eeeeec289 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, bootstrap_cmds, byacc, # can also use bison, but byacc has fewer dependencies keyutils, @@ -42,6 +43,15 @@ stdenv.mkDerivation rec { hash = "sha256-GogyuMrZI+u/E5T2fi789B46SfRgKFpm41reyPoAU68="; }; + patches = lib.optionals stdenv.hostPlatform.isFreeBSD [ + (fetchpatch { + name = "fix-missing-ENODATA.patch"; + url = "https://cgit.freebsd.org/ports/plain/security/krb5-122/files/patch-lib_krad_packet.c?id=0501f716c4aff7880fde56e42d641ef504593b7d"; + extraPrefix = ""; + hash = "sha256-l8ev+WrDKbTqwgBRYhfJGELkCCE8mJTqVHFBvvCPvgE="; + }) + ]; + outputs = [ "out" "lib" From dcb41fbcee185223ba2bb8c0135b75994a6494c8 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 24 Sep 2025 09:18:26 +0200 Subject: [PATCH 2/2] libpq: 17.6 -> 18.0 --- pkgs/servers/sql/postgresql/libpq.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/sql/postgresql/libpq.nix b/pkgs/servers/sql/postgresql/libpq.nix index f71d254ae7b6..3048e467397b 100644 --- a/pkgs/servers/sql/postgresql/libpq.nix +++ b/pkgs/servers/sql/postgresql/libpq.nix @@ -20,6 +20,15 @@ postgresql, buildPackages, + # Curl + curlSupport ? + lib.meta.availableOn stdenv.hostPlatform curl + # Building statically fails with: + # configure: error: library 'curl' does not provide curl_multi_init + # https://www.postgresql.org/message-id/487dacec-6d8d-46c0-a36f-d5b8c81a56f1%40technowledgy.de + && !stdenv.hostPlatform.isStatic, + curl, + # GSSAPI gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, libkrb5, @@ -31,14 +40,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "libpq"; - version = "17.6"; + version = "18.0"; src = fetchFromGitHub { owner = "postgres"; repo = "postgres"; # rev, not tag, on purpose: see generic.nix. - rev = "refs/tags/REL_17_6"; - hash = "sha256-/7C+bjmiJ0/CvoAc8vzTC50vP7OsrM6o0w+lmmHvKvU="; + rev = "refs/tags/REL_18_0"; + hash = "sha256-xA6gbJe4tIV9bYRFrdI4Rfy20ZwTkvyyjt7ZxvCFEec="; }; __structuredAttrs = true; @@ -61,6 +70,7 @@ stdenv.mkDerivation (finalAttrs: { zlib openssl ] + ++ lib.optionals curlSupport [ curl ] ++ lib.optionals gssSupport [ libkrb5 ] ++ lib.optionals nlsSupport [ gettext ]; @@ -109,6 +119,7 @@ stdenv.mkDerivation (finalAttrs: { "--without-perl" "--without-readline" ] + ++ lib.optionals curlSupport [ "--with-libcurl" ] ++ lib.optionals gssSupport [ "--with-gssapi" ] ++ lib.optionals nlsSupport [ "--enable-nls" ]; @@ -134,6 +145,11 @@ stdenv.mkDerivation (finalAttrs: { make -C src/common install pg_config.env make -C src/include install make -C src/interfaces/libpq install + '' + + lib.optionalString curlSupport '' + make -C src/interfaces/libpq-oauth install + '' + + '' make -C src/port install substituteInPlace src/common/pg_config.env \