Files
simplex-chat/scripts/nix/cabal-hsc2hs-preserve-options.patch
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

28 lines
918 B
Diff

Preserve ordered compiler/linker arguments when invoking hsc2hs.
Deduplicating individual tokens corrupts repeated option/argument pairs:
-framework Security -framework CoreFoundation
becomes:
-framework Security CoreFoundation
The same applies to compiler options such as repeated -include. Leave
deduplication of framework directory values in place.
--- a/src/Distribution/Simple/PreProcess.hs
+++ b/src/Distribution/Simple/PreProcess.hs
@@ -525,7 +525,6 @@
where
ldflags =
map ("--lflag=" ++) $
- ordNub $
concat
[ programDefaultArgs gccProg ++ programOverrideArgs gccProg
, osxFrameworkDirs
@@ -574,7 +573,6 @@
cflags =
map ("--cflag=" ++) $
- ordNub $
concat
[ programDefaultArgs gccProg ++ programOverrideArgs gccProg
, osxFrameworkDirs