summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/sql/postgresql/default.nix
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2023-04-26 18:32:52 +0200
committerYureka <yuka@yuka.dev>2023-05-28 19:51:06 +0200
commit8d4a81b1851be7823e23d26bd02abcfb902d2bef (patch)
tree9a59eb50c8fb2394ede1d2a58c6019a8556706bd /pkgs/servers/sql/postgresql/default.nix
parent1d5ff2163e7a9611d4f808ae2c404f45e1566c36 (diff)
pkgsMusl.postgresql: fix build
Diffstat (limited to 'pkgs/servers/sql/postgresql/default.nix')
-rw-r--r--pkgs/servers/sql/postgresql/default.nix22
1 files changed, 20 insertions, 2 deletions
diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix
index 48b94841548e..669502706fc9 100644
--- a/pkgs/servers/sql/postgresql/default.nix
+++ b/pkgs/servers/sql/postgresql/default.nix
@@ -2,9 +2,9 @@ let
generic =
# dependencies
- { stdenv, lib, fetchurl, makeWrapper
+ { stdenv, lib, fetchurl, makeWrapper, fetchpatch
, glibc, zlib, readline, openssl, icu, lz4, zstd, systemd, libossp_uuid
- , pkg-config, libxml2, tzdata, libkrb5
+ , pkg-config, libxml2, tzdata, libkrb5, substituteAll, darwin
# This is important to obtain a version of `libpq` that does not depend on systemd.
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd && !stdenv.hostPlatform.isStatic
@@ -103,6 +103,24 @@ let
./patches/hardcode-pgxs-path.patch
./patches/specify_pkglibdir_at_runtime.patch
./patches/findstring.patch
+
+ (substituteAll {
+ src = ./locale-binary-path.patch;
+ locale = "${if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale";
+ })
+
+ ] ++ lib.optionals stdenv'.hostPlatform.isMusl [
+ # Fixes for musl libc
+ # These patches are not properly guarded and should NOT be enabled everywhere
+ (fetchpatch {
+ url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/disable-test-collate.icu.utf8.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
+ hash = "sha256-pnl+wM3/IUyq5iJzk+h278MDA9R0GQXQX8d4wJcB2z4=";
+ })
+ (fetchpatch {
+ url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/icu-collations-hack.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
+ hash = "sha256-Yb6lMBDqeVP/BLMyIr5rmR6OkaVzo68cV/+cL2LOe/M=";
+ })
+
] ++ lib.optionals stdenv'.isLinux [
(if atLeast "13" then ./patches/socketdir-in-run-13.patch else ./patches/socketdir-in-run.patch)
];