Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions nix/ext/pg_net.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,39 @@
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:
stdenv.mkDerivation rec {
inherit pname version;

buildInputs = [
curl
(if stdenv.isDarwin then curlAppleIconv else curl)
postgresql
]
++ lib.optional (version == "0.6") libuv;
Expand All @@ -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
'';

Expand Down
6 changes: 5 additions & 1 deletion nix/ext/postgis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 0 additions & 1 deletion nix/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
};
in
_final: _prev: {
curl_8_6 = oldstable.curl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is dropping this safe? what tests cover it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like its handled by the export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DCURL_DISABLE_TYPECHECK" in pg_net

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safe. Only pg_net used curl_8_6, and it now builds against the main curl. Old versions get -DCURL_DISABLE_TYPECHECK for the curl 8.17 header break, as @mmlb noted. Every pg_net version builds for 15 and 17, and the pg_net tests run in the check harness.

v8_oldstable = oldstable.v8;
}
)
Expand Down
4 changes: 2 additions & 2 deletions nix/pgbouncer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
libevent,
c-ares,
pkg-config,
systemd,
systemdLibs,
nixosTests,
pandoc,
python3,
Expand All @@ -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";

Expand Down
7 changes: 4 additions & 3 deletions nix/postgresql/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let
icu75,
lz4,
zstd,
systemd,
systemdLibs,
libossp_uuid,
pkg-config,
libxml2,
Expand All @@ -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,

Expand Down Expand Up @@ -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 ]
Expand Down
Loading