diff --git a/default.nix b/default.nix index d5d9ead48..6d1245c4d 100644 --- a/default.nix +++ b/default.nix @@ -43,7 +43,6 @@ let allOverlays.build-toolbox allOverlays.checked-shell-script allOverlays.gitignore - allOverlays.postgresql-libpq (allOverlays.haskell-packages { inherit compiler; }) allOverlays.slocat ]; diff --git a/nix/libpq.nix b/nix/libpq.nix deleted file mode 100644 index 150029462..000000000 --- a/nix/libpq.nix +++ /dev/null @@ -1,61 +0,0 @@ -# Creating a separate libpq package is is discussed in -# https://github.com/NixOS/nixpkgs/issues/61580, but nixpkgs has not moved -# forward, yet. -# This package is passed to postgresql-libpq (haskell) which needs to be -# cross-compiled to the static build and possibly other architectures as -# as well. To reduce the number of dependencies that need to be built with -# it, this derivation focuses on building the client libraries only. No -# server, no tests. -{ stdenv -, lib -, openssl -, zlib -, postgresql -, pkg-config -, tzdata -}: - -stdenv.mkDerivation { - pname = "libpq"; - inherit (postgresql) src version patches; - - __structuredAttrs = true; - env.CFLAGS = "-fdata-sections -ffunction-sections" - + (if stdenv.cc.isClang then " -flto" else " -fmerge-constants -Wl,--gc-sections"); - - configureFlags = [ - "--without-gssapi" - "--without-icu" - "--without-readline" - "--with-openssl" - "--with-system-tzdata=${tzdata}/share/zoneinfo" - "--sysconfdir=/etc/postgresql" - ]; - - nativeBuildInputs = [ pkg-config tzdata ]; - buildInputs = [ openssl zlib ]; - - buildFlags = [ "submake-libpq" "submake-libpgport" ]; - - installPhase = '' - runHook preInstall - - make -C src/bin/pg_config install - make -C src/common install - make -C src/include install - make -C src/interfaces/libpq install - make -C src/port install - - rm -rfv $out/share - - runHook postInstall - ''; - - outputs = [ "out" ]; - - meta = with lib; { - homepage = "https://www.postgresql.org"; - description = "Client API library for PostgreSQL"; - license = licenses.postgresql; - }; -} diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index 18900f0a1..4a5f88643 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -3,6 +3,5 @@ checked-shell-script = import ./checked-shell-script; gitignore = import ./gitignore.nix; haskell-packages = import ./haskell-packages.nix; - postgresql-libpq = import ./postgresql-libpq.nix; slocat = import ./slocat.nix; } diff --git a/nix/overlays/postgresql-libpq.nix b/nix/overlays/postgresql-libpq.nix deleted file mode 100644 index bace97da4..000000000 --- a/nix/overlays/postgresql-libpq.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: super: -{ - # Depending on which nixpkgs version is pinned, libpq might either be available already - or not. - libpq = super.libpq or (super.callPackage ../libpq.nix { - postgresql = super.postgresql_16; - }); -} diff --git a/nix/static.nix b/nix/static.nix index be6b2f0b1..3d8f66789 100644 --- a/nix/static.nix +++ b/nix/static.nix @@ -18,23 +18,6 @@ let # Cross compiling with native bignum works better than with gmp enableNativeBignum = true; }; - - overrides = pkgs.lib.composeExtensions old.overrides (_: prev: { - postgresql-libpq = (lib.overrideCabal prev.postgresql-libpq { - # TODO: This section can be simplified when this PR has made it's way to us: - # https://github.com/NixOS/nixpkgs/pull/286370 - # Additionally, we need to use the default version in nixpkgs, otherwise the - # override will not be active as well. - # Using use-pkg-config flag, because pg_config won't work when cross-compiling - configureFlags = [ "-fuse-pkg-config" ]; - # postgresql doesn't build in the fully static overlay - but the default - # derivation is built with static libraries anyway. - libraryPkgconfigDepends = [ pkgsStatic.libpq ]; - librarySystemDepends = [ ]; - }).overrideAttrs (_: prevAttrs: { - buildInputs = prevAttrs.buildInputs ++ [ pkgsStatic.openssl ]; - }); - }); }); makeExecutableStatic = drv: pkgs.lib.pipe drv [