Skip to content

Commit 573ef4e

Browse files
authored
Update README.md with zlib fix notes
1 parent 8c28526 commit 573ef4e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,24 @@ For non-Haskell dependencies that are linkable libraries, add them to:
146146
```yaml
147147
extra-libraries:
148148
- mnl
149+
- z
149150
```
150151

151-
The name of these libraries is the suffix of the C linking option `-lmnl` giving you `mnl`.
152+
The name of these libraries is the suffix of the `gcc` linking option:
153+
154+
* `-lmnl` giving you `mnl`
155+
* `-lz` giving you `z` for the zlib library.
152156

153157
They will be will available to `nix-build` and `nix-shell`. The `cabal configure` will automatically find them and link them during compilation.
154158

155-
Sometimes these non-Haskell dependencies have names that conflict with Haskell dependencies of the same name.
159+
These non-Haskell dependencies must be explicitly named when using `callPackage`.
156160

157-
To resolve this, override explicitly when using `callPackage`. This is done in both `shell.nix` and `release.nix`.
161+
This is done in both `shell.nix` and `release.nix`.
158162

159163
For example:
160164

161165
```nix
162-
haskellPackages.callPackage ./cabal.nix { hello = pkgs.hello; mnl = pkgs.libmnl; }
166+
haskellPackages.callPackage ./cabal.nix { hello = pkgs.hello; mnl = pkgs.libmnl; z = pkgs.zlib; }
163167
```
164168

165169
## Using GHCi (or `cabal repl` or `stack ghci`)

0 commit comments

Comments
 (0)