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:
committed by
Wolfgang Walther
parent
48aabeb473
commit
04a14d5941
@@ -19,6 +19,10 @@ stdenv.mkDerivation {
|
|||||||
pname = "libpq";
|
pname = "libpq";
|
||||||
inherit (postgresql) src version patches;
|
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 = [
|
configureFlags = [
|
||||||
"--without-gssapi"
|
"--without-gssapi"
|
||||||
"--without-icu"
|
"--without-icu"
|
||||||
|
|||||||
+2
-6
@@ -5,11 +5,7 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
# This builds a static PostgREST executable based on pkgsStatic.
|
# This builds a static PostgREST executable based on pkgsStatic.
|
||||||
# pkgsStatic is based on musl, so is a kind of cross-compilation.
|
inherit (pkgs) pkgsStatic;
|
||||||
# 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 (pkgsStatic.haskell) lib;
|
inherit (pkgsStatic.haskell) lib;
|
||||||
|
|
||||||
packagesStatic =
|
packagesStatic =
|
||||||
@@ -33,7 +29,7 @@ let
|
|||||||
configureFlags = [ "-fuse-pkg-config" ];
|
configureFlags = [ "-fuse-pkg-config" ];
|
||||||
# postgresql doesn't build in the fully static overlay - but the default
|
# postgresql doesn't build in the fully static overlay - but the default
|
||||||
# derivation is built with static libraries anyway.
|
# derivation is built with static libraries anyway.
|
||||||
libraryPkgconfigDepends = [ pkgsCross.libpq ];
|
libraryPkgconfigDepends = [ pkgsStatic.libpq ];
|
||||||
librarySystemDepends = [ ];
|
librarySystemDepends = [ ];
|
||||||
}).overrideAttrs (_: prevAttrs: {
|
}).overrideAttrs (_: prevAttrs: {
|
||||||
buildInputs = prevAttrs.buildInputs ++ [ pkgsStatic.openssl ];
|
buildInputs = prevAttrs.buildInputs ++ [ pkgsStatic.openssl ];
|
||||||
|
|||||||
Reference in New Issue
Block a user