Files
simplex-chat/scripts/nix/cabal-tool-overlay.nix
T
Moritz Angermann b0eab49f34 Fix hsc2hs option handling in Darwin archive builds
Cabal 3.17 deduplicates flattened compiler and linker argument lists,
which drops the second -framework from Security/CoreFoundation links.
Remove the two token-level deduplications while retaining framework
search-directory deduplication and registered framework metadata.

Patch the Cabal library in haskell.nix's v2 build tool only for Darwin
archive projects. Preserve the tool's existing patches and evalWith
variants, and leave native CLI and Linux/Android build tools unchanged.
2026-10-15 21:01:47 +09:00

19 lines
658 B
Nix

final: prev:
let
# Patch the Cabal library linked into the build tool, preserving the fork's
# existing patches, compiler, and per-evaluation-platform tool variants.
patchTool = tool:
(tool.project.appendModule {
modules = [{
packages.Cabal.patches = [ ./cabal-hsc2hs-preserve-options.patch ];
}];
}).hsPkgs.cabal-install.components.exes.cabal;
original = prev.haskell-nix.v2-cabal-install;
in prev.lib.optionalAttrs prev.stdenv.buildPlatform.isDarwin {
haskell-nix = prev.haskell-nix // {
v2-cabal-install = patchTool original // {
evalWith = prev.lib.mapAttrs (_: patchTool) original.evalWith;
};
};
}