Skip to content

Commit 4521a44

Browse files
committed
survey: statify: Remove need for zlib hardcode.
Linking Haskell programs doesn't generally need zlib. Now that (with the previous commits) the system `zlib` library has `.a` files, we can just override the Haskell `zlib` library to use those. Then the library paths will automatically be propagated.
1 parent f9bdfa0 commit 4521a44

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

survey/default.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,12 @@ let
786786
# If we unconditionally add packages here, we will override
787787
# whatever packages they've passed us in.
788788

789+
# Override zlib Haskell package to use the system zlib package
790+
# that has `.a` files added.
791+
# This is because the system zlib package can't be overridden accordingly,
792+
# see note [Packages that can't be overridden by overlays].
793+
zlib = super.zlib.override { zlib = final.zlib_both; };
794+
789795
# `criterion`'s test suite fails with a timeout if its dependent
790796
# libraries (apparently `bytestring`) are compiled with `-O0`.
791797
# Even increasing the timeout 5x did not help!
@@ -1093,8 +1099,6 @@ let
10931099
# obviously doesn' thave our patches.
10941100
statify = drv: with final.haskell.lib; final.lib.foldl appendConfigureFlag (disableLibraryProfiling (disableSharedExecutables (useFixedCabal drv))) ([
10951101
"--enable-executable-static" # requires `useFixedCabal`
1096-
# TODO These probably shouldn't be here but only for packages that actually need them
1097-
"--extra-lib-dirs=${if approach == "pkgsMusl" then final.zlib_both else final.zlib}/lib"
10981102
"--extra-lib-dirs=${final.ncurses.override { enableStatic = true; }}/lib"
10991103
# TODO Figure out why this and the below libffi are necessary.
11001104
# `working` and `workingStackageExecutables` don't seem to need that,

0 commit comments

Comments
 (0)