|
24 | 24 | url = "github:IntersectMBO/cardano-haskell-packages?ref=repo";
|
25 | 25 | flake = false;
|
26 | 26 | };
|
27 |
| - # Note[PostgreSQL 17]: This is a workaround to get postgresql_17 from nixpkgs. It's |
28 |
| - # available in nixpkgs unstable, but has not been updated in haskell.nix yet. Remove |
29 |
| - # this after the next time haskell.nix updates nixpkgs. |
30 |
| - nixpkgsUpstream.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
31 | 27 | };
|
32 | 28 |
|
33 | 29 | outputs = { self, ... }@inputs:
|
|
40 | 36 | in
|
41 | 37 | inputs.utils.lib.eachSystem supportedSystems (system:
|
42 | 38 | let
|
43 |
| - # TODO: Remove me (See Note[PostgreSQL 17]). |
44 |
| - nixpkgsUpstream = import inputs.nixpkgsUpstream { |
45 |
| - inherit system; |
46 |
| - inherit (inputs.haskellNix) config; |
47 |
| - }; |
48 |
| - |
49 | 39 | nixpkgs = import inputs.nixpkgs {
|
50 | 40 | inherit system;
|
51 | 41 | inherit (inputs.haskellNix) config;
|
|
54 | 44 | builtins.attrValues inputs.iohkNix.overlays ++
|
55 | 45 | [ inputs.haskellNix.overlay
|
56 | 46 |
|
| 47 | + (final: prev: { |
| 48 | + haskell-nix = prev.haskell-nix // { |
| 49 | + extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings // { |
| 50 | + "libpq" = [ "libpq" ]; |
| 51 | + }; |
| 52 | + }; |
| 53 | + }) |
| 54 | + |
57 | 55 | (final: prev: {
|
58 | 56 | inherit (project.hsPkgs.cardano-node.components.exes) cardano-node;
|
59 | 57 | inherit (project.hsPkgs.cardano-cli.components.exes) cardano-cli;
|
|
88 | 86 | })
|
89 | 87 |
|
90 | 88 | (final: prev: {
|
91 |
| - postgresql = prev.postgresql.overrideAttrs (_: |
92 |
| - final.lib.optionalAttrs (final.stdenv.hostPlatform.isMusl) { |
93 |
| - NIX_LDFLAGS = "--push-state --as-needed -lstdc++ --pop-state"; |
94 |
| - LC_CTYPE = "C"; |
95 |
| - |
96 |
| - doCheck = false; |
97 |
| - }); |
98 |
| - }) |
99 |
| - |
100 |
| - # TODO: Remove me (See Note[PostgreSQL 17]) |
101 |
| - (final: prev: { |
102 |
| - postgresql_17 = nixpkgsUpstream.postgresql_17; |
| 89 | + libpq = |
| 90 | + final.lib.pipe prev.libpq [ |
| 91 | + (p: p.override { |
| 92 | + gssSupport = false; |
| 93 | + }) |
| 94 | + |
| 95 | + (p: p.overrideAttrs (old: |
| 96 | + final.lib.optionalAttrs (final.stdenv.hostPlatform.isMusl) { |
| 97 | + dontDisableStatic = true; |
| 98 | + NIX_LDFLAGS = "--push-state --as-needed -lstdc++ --pop-state"; |
| 99 | + # without this collate.icu.utf8, and foreign_data will fail. |
| 100 | + LC_CTYPE = "C"; |
| 101 | + # libpq from nixpkgs will either remove static or dynamic |
| 102 | + # libs, but we need to keep them both |
| 103 | + postInstall = ""; |
| 104 | + })) |
| 105 | + ]; |
103 | 106 | })
|
104 | 107 | ];
|
105 | 108 | };
|
|
165 | 168 | crossPlatforms = p:
|
166 | 169 | lib.optional (system == "x86_64-linux") p.musl64 ++
|
167 | 170 | lib.optional
|
168 |
| - (system == "x86_64-linux" && config.compiler-nix-name == "ghc966") |
| 171 | + (system == "x86_64-linux" && config.compiler-nix-name == "ghc967") |
169 | 172 | p.aarch64-multiplatform-musl;
|
170 | 173 |
|
171 | 174 | inputMap = {
|
|
179 | 182 | src = nixpkgs.haskell-nix.sources."hls-2.11";
|
180 | 183 | };
|
181 | 184 | hlint = "latest";
|
182 |
| - } // lib.optionalAttrs (config.compiler-nix-name == "ghc966") { |
| 185 | + } // lib.optionalAttrs (config.compiler-nix-name == "ghc967") { |
183 | 186 | weeder = "latest";
|
184 | 187 | };
|
185 | 188 | # Now we use pkgsBuildBuild, to make sure that even in the cross
|
|
242 | 245 | (pkgs.lib.mkIf pkgs.hostPlatform.isMusl
|
243 | 246 | (let
|
244 | 247 | ghcOptions = [
|
245 |
| - # Postgresql static is pretty broken in nixpkgs. We can't rely on the |
| 248 | + # libpq static is pretty broken in nixpkgs. We can't rely on the |
246 | 249 | # pkg-config, so we have to add the correct libraries ourselves
|
247 |
| - "-L${pkgs.postgresql}/lib" |
248 |
| - "-optl-Wl,-lpgport" |
249 | 250 | "-optl-Wl,-lpgcommon"
|
| 251 | + "-optl-Wl,-lpgport" |
| 252 | + "-optl-Wl,-lm" |
250 | 253 |
|
251 |
| - # Since we aren't using the postgresql pkg-config, it won't |
252 |
| - # automatically include OpenSSL |
| 254 | + # Since we aren't using pkg-config, it won't automatically include |
| 255 | + # OpenSSL |
253 | 256 | "-L${pkgs.openssl.out}/lib"
|
254 | 257 |
|
255 | 258 | # The ordering of -lssl and -lcrypto below is important. Otherwise,
|
|
0 commit comments