diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index f769bad314..d004b9e491 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -7,14 +7,31 @@ libuv, makeWrapper, switch-ext-version, - curl_8_6, + curl, + libidn2, + libpsl, + libunistring, + libiconv, latestOnly ? false, }: let - curl = curl_8_6; -in -let + # nixpkgs builds libunistring against gnu libiconv on darwin, which collides with apple's in the cli bundle + curlAppleIconv = + let + libunistringApple = libunistring.override { libiconvReal = libiconv; }; + libidn2Apple = libidn2.override { libunistring = libunistringApple; }; + libpslApple = + (libpsl.override { + libidn2 = libidn2Apple; + libunistring = libunistringApple; + }).overrideAttrs + { env.NIX_LDFLAGS = "-liconv"; }; + in + curl.override { + libidn2 = libidn2Apple; + libpsl = libpslApple; + }; pname = "pg_net"; build = version: hash: @@ -22,7 +39,7 @@ let inherit pname version; buildInputs = [ - curl + (if stdenv.isDarwin then curlAppleIconv else curl) postgresql ] ++ lib.optional (version == "0.6") libuv; @@ -35,6 +52,9 @@ let }; buildPhase = '' + ${lib.optionalString (lib.versionOlder version "0.20.4") '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DCURL_DISABLE_TYPECHECK" + ''} make PG_CONFIG=${postgresql}/bin/pg_config ''; diff --git a/nix/ext/postgis.nix b/nix/ext/postgis.nix index 699479b655..b388153d17 100644 --- a/nix/ext/postgis.nix +++ b/nix/ext/postgis.nix @@ -22,16 +22,20 @@ coreutils, cgal, sfcgal, + boost, + icu75, latestOnly ? false, }: let + boostIcu75 = boost.override { icu = icu75; }; # Hold cgal back to 6.0.2 until nixpkgs bumps sfcgal past 2.2.0 (incompatible with CGAL 6.1+). sfcgal' = assert lib.assertMsg (lib.versionAtLeast "2.2.0" sfcgal.version) "sfcgal ${sfcgal.version} is newer than 2.2.0, drop the cgal 6.0.2 pin"; sfcgal.override { - cgal = cgal.overrideAttrs (_: { + boost = boostIcu75; + cgal = (cgal.override { boost = boostIcu75; }).overrideAttrs (_: { version = "6.0.2"; src = fetchurl { url = "https://github.com/CGAL/cgal/releases/download/v6.0.2/CGAL-6.0.2.tar.xz"; diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix index 70c259af3c..6dbf7dccd4 100644 --- a/nix/nixpkgs.nix +++ b/nix/nixpkgs.nix @@ -17,7 +17,6 @@ }; in _final: _prev: { - curl_8_6 = oldstable.curl; v8_oldstable = oldstable.v8; } ) diff --git a/nix/pgbouncer.nix b/nix/pgbouncer.nix index 91e42c230d..3123f4e26e 100644 --- a/nix/pgbouncer.nix +++ b/nix/pgbouncer.nix @@ -6,7 +6,7 @@ libevent, c-ares, pkg-config, - systemd, + systemdLibs, nixosTests, pandoc, python3, @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { openssl c-ares ] - ++ lib.optional stdenv.hostPlatform.isLinux systemd; + ++ lib.optional stdenv.hostPlatform.isLinux systemdLibs; enableParallelBuilding = true; configureFlags = lib.optional stdenv.hostPlatform.isLinux "--with-systemd"; diff --git a/nix/postgresql/generic.nix b/nix/postgresql/generic.nix index 0c5cb589a0..f07dd75690 100644 --- a/nix/postgresql/generic.nix +++ b/nix/postgresql/generic.nix @@ -15,7 +15,7 @@ let icu75, lz4, zstd, - systemd, + systemdLibs, libossp_uuid, pkg-config, libxml2, @@ -33,7 +33,8 @@ let libxslt, # This is important to obtain a version of `libpq` that does not depend on systemd. - systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd && !stdenv.hostPlatform.isStatic, + systemdSupport ? + lib.meta.availableOn stdenv.hostPlatform systemdLibs && !stdenv.hostPlatform.isStatic, enableSystemd ? null, gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, @@ -120,7 +121,7 @@ let ++ lib.optionals (olderThan "13") [ libxcrypt ] ++ lib.optionals lz4Enabled [ lz4 ] ++ lib.optionals zstdEnabled [ zstd ] - ++ lib.optionals systemdSupport' [ systemd ] + ++ lib.optionals systemdSupport' [ systemdLibs ] ++ lib.optionals pythonSupport [ python3 ] ++ lib.optionals gssSupport [ libkrb5 ] ++ lib.optionals stdenv.isLinux [ linux-pam ]