Skip to content

Commit 9083061

Browse files
authored
Add library-specific dependency settings (#469)
1 parent 2af0ef0 commit 9083061

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- #427: Add `generateOptparseApplicativeCompletions`
1313
- #455: Add `drvAttrs` option for setting arbitrary derivation attributes
1414
- #459: Apply `custom` ahead of other settings.
15+
- #469: Add `libraryHaskellDepends`, `librarySystemDepends`, `libraryToolDepends`, and `libraryPkgconfigDepends`
1516

1617
## 0.5.0 (Jun 24, 2024)
1718

doc/settings.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ haskellProjects.default = {
2222
# Extra non-Haskell dependencies
2323
extraBuildDepends = [ pkgs.stork ];
2424
25+
# Library-specific dependencies
26+
librarySystemDepends = [ pkgs.zlib ];
27+
libraryPkgconfigDepends = [ pkgs.openssl ];
28+
2529
# Source patches
2630
patches = [ ./patches/ema-bug-fix.patch ];
2731

nix/modules/project/settings/all.nix

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,42 @@ in
173173
'';
174174
impl = addSetupDepends;
175175
};
176+
libraryHaskellDepends = {
177+
type = types.listOf types.package;
178+
description = ''
179+
Haskell library dependencies for the package.
180+
'';
181+
impl = deps: overrideCabal (drv: {
182+
libraryHaskellDepends = (drv.libraryHaskellDepends or [ ]) ++ deps;
183+
});
184+
};
185+
librarySystemDepends = {
186+
type = types.listOf types.package;
187+
description = ''
188+
System library dependencies for the package.
189+
'';
190+
impl = deps: overrideCabal (drv: {
191+
librarySystemDepends = (drv.librarySystemDepends or [ ]) ++ deps;
192+
});
193+
};
194+
libraryToolDepends = {
195+
type = types.listOf types.package;
196+
description = ''
197+
Tool dependencies for the library.
198+
'';
199+
impl = deps: overrideCabal (drv: {
200+
libraryToolDepends = (drv.libraryToolDepends or [ ]) ++ deps;
201+
});
202+
};
203+
libraryPkgconfigDepends = {
204+
type = types.listOf types.package;
205+
description = ''
206+
Pkgconfig dependencies for the library.
207+
'';
208+
impl = deps: overrideCabal (drv: {
209+
libraryPkgconfigDepends = (drv.libraryPkgconfigDepends or [ ]) ++ deps;
210+
});
211+
};
176212
extraConfigureFlags = {
177213
type = types.listOf types.str;
178214
description = ''

0 commit comments

Comments
 (0)