113
113
( { lib , pkgs , ... } : {
114
114
packages . cardano-tracer . package . buildable = with pkgs . stdenv . hostPlatform ; lib . mkForce ( ! isMusl ) ;
115
115
packages . cardano-node-chairman . components . tests . chairman-tests . buildable = lib . mkForce pkgs . stdenv . hostPlatform . isUnix ;
116
+ package-keys = [ "plutus-tx-plugin" ] ;
116
117
packages . plutus-tx-plugin . components . library . platforms = with lib . platforms ; [ linux darwin ] ;
117
118
packages . tx-generator . package . buildable = with pkgs . stdenv . hostPlatform ; ! isMusl ;
118
119
139
140
packages . unix-time . postPatch = ''
140
141
sed -i 's/mingwex//g' unix-time.cabal
141
142
'' ;
142
- # For these two packages the custom setups fail, as we end up with multiple instances of
143
- # lib:Cabal. Likely a haskell.nix bug.
144
- packages . entropy . package . buildType = lib . mkForce "Simple" ;
145
- packages . HsOpenSSL . package . buildType = lib . mkForce "Simple" ;
146
143
#packages.plutus-core.components.library.preBuild = ''
147
144
# export ISERV_ARGS="-v +RTS -Dl"
148
145
# export PROXY_ARGS=-v
@@ -312,17 +309,18 @@ let
312
309
# <no location info>: error: ghc: ghc-iserv terminated (-11)
313
310
packages . plutus-core . components . library . ghcOptions = [ "-fexternal-interpreter" ] ;
314
311
} )
315
- ( { lib , ... } @args : {
316
- options . packages = lib . mkOption {
317
- type = lib . types . attrsOf ( lib . types . submodule (
318
- { config , lib , ... } :
319
- lib . mkIf config . package . isLocal
320
- {
321
- configureFlags = [ "--ghc-option=-Werror" ]
322
- ++ lib . optional ( args . config . compiler . version == "8.10.7" ) "--ghc-option=-Wwarn=unused-packages" ;
323
- }
324
- ) ) ;
325
- } ;
312
+ ( { config , lib , ... } @args : {
313
+ options . packages = lib . genAttrs config . package-keys ( _ :
314
+ lib . mkOption {
315
+ type = lib . types . submodule (
316
+ { config , lib , ... } :
317
+ lib . mkIf config . package . isLocal
318
+ {
319
+ configureFlags = [ "--ghc-option=-Werror" ]
320
+ ++ lib . optional ( args . config . compiler . version == "8.10.7" ) "--ghc-option=-Wwarn=unused-packages" ;
321
+ }
322
+ ) ;
323
+ } ) ;
326
324
} )
327
325
( { lib , pkgs , ... } : lib . mkIf pkgs . stdenv . hostPlatform . isLinux {
328
326
# systemd can't be statically linked
@@ -332,18 +330,19 @@ let
332
330
} )
333
331
# disable haddock
334
332
# Musl libc fully static build
335
- ( { lib , ... } : {
336
- options . packages = lib . mkOption {
337
- type = lib . types . attrsOf ( lib . types . submodule (
338
- { config , lib , pkgs , ...} :
339
- lib . mkIf ( pkgs . stdenv . hostPlatform . isMusl && config . package . isLocal )
340
- {
341
- # Module options which adds GHC flags and libraries for a fully static build
342
- enableShared = true ; # TH code breaks if this is false.
343
- enableStatic = true ;
344
- }
345
- ) ) ;
346
- } ;
333
+ ( { config , lib , ... } : {
334
+ options . packages = lib . genAttrs config . package-keys ( _ :
335
+ lib . mkOption {
336
+ type = lib . types . submodule (
337
+ { config , lib , pkgs , ...} :
338
+ lib . mkIf ( pkgs . stdenv . hostPlatform . isMusl && config . package . isLocal )
339
+ {
340
+ # Module options which adds GHC flags and libraries for a fully static build
341
+ enableShared = true ; # TH code breaks if this is false.
342
+ enableStatic = true ;
343
+ }
344
+ ) ;
345
+ } ) ;
347
346
config =
348
347
lib . mkIf pkgs . stdenv . hostPlatform . isMusl
349
348
{
@@ -413,20 +412,20 @@ project.appendOverlays (with haskellLib.projectOverlays; [
413
412
} ) ] ;
414
413
} ;
415
414
# add passthru and gitrev to hsPkgs:
416
- hsPkgs = lib . mapAttrsRecursiveCond ( v : ! ( lib . isDerivation v ) )
417
- ( path : value :
418
- if ( lib . isAttrs value ) then
419
- lib . recursiveUpdate
420
- value
421
- {
422
- # Also add convenient passthru to some alternative compilation configurations:
423
- passthru = {
424
- profiled = lib . getAttrFromPath path final . profiled . hsPkgs ;
425
- asserted = lib . getAttrFromPath path final . asserted . hsPkgs ;
426
- eventlogged = lib . getAttrFromPath path final . eventlogged . hsPkgs ;
427
- } ;
428
- }
429
- else value )
430
- prev . hsPkgs ;
415
+ # hsPkgs = lib.mapAttrsRecursiveCond (v: !(lib.isDerivation v))
416
+ # (path: value:
417
+ # if (lib.isAttrs value) then
418
+ # lib.recursiveUpdate
419
+ # value
420
+ # {
421
+ # # Also add convenient passthru to some alternative compilation configurations:
422
+ # passthru = {
423
+ # profiled = lib.getAttrFromPath path final.profiled.hsPkgs;
424
+ # asserted = lib.getAttrFromPath path final.asserted.hsPkgs;
425
+ # eventlogged = lib.getAttrFromPath path final.eventlogged.hsPkgs;
426
+ # };
427
+ # }
428
+ # else value)
429
+ # prev.hsPkgs;
431
430
} )
432
431
] )
0 commit comments