nix: remove pkgsCross workaround for libpq

This will make it much easier to actually cross-compile the static
executable to different systems.
This commit is contained in:
Wolfgang Walther
2024-11-12 21:13:31 +01:00
committed by Wolfgang Walther
parent 48aabeb473
commit 04a14d5941
2 changed files with 6 additions and 6 deletions
+4
View File
@@ -19,6 +19,10 @@ 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"
+2 -6
View File
@@ -5,11 +5,7 @@
}:
let
# This builds a static PostgREST executable based on pkgsStatic.
# pkgsStatic is based on musl, so is a kind of cross-compilation.
# We still make this explicit here via pkgsCross, because we need
# to get postgresql/libpq for musl, too.
pkgsCross = pkgs.pkgsCross.musl64;
inherit (pkgsCross) pkgsStatic;
inherit (pkgs) pkgsStatic;
inherit (pkgsStatic.haskell) lib;
packagesStatic =
@@ -33,7 +29,7 @@ let
configureFlags = [ "-fuse-pkg-config" ];
# postgresql doesn't build in the fully static overlay - but the default
# derivation is built with static libraries anyway.
libraryPkgconfigDepends = [ pkgsCross.libpq ];
libraryPkgconfigDepends = [ pkgsStatic.libpq ];
librarySystemDepends = [ ];
}).overrideAttrs (_: prevAttrs: {
buildInputs = prevAttrs.buildInputs ++ [ pkgsStatic.openssl ];