|
1 | 1 | # editorconfig-checker-disable-file
|
2 |
| -{ inputs, pkgs, lib, agda-with-stdlib, r-with-packages }: |
| 2 | +{ inputs, pkgs, lib, agda-with-stdlib, r-with-packages, utils }: |
3 | 3 |
|
4 | 4 | let
|
5 |
| - cabalProject = pkgs.haskell-nix.cabalProject' ({ config, pkgs, ... }: { |
6 |
| - name = "plutus"; |
7 |
| - |
8 |
| - # We need the mkDefault here since compiler-nix-name will be overridden |
9 |
| - # in the flake variants. |
10 |
| - compiler-nix-name = lib.mkDefault "ghc96"; |
11 |
| - |
12 |
| - src = ../.; |
13 |
| - |
14 |
| - flake.variants = { |
15 |
| - ghc96 = { }; # Alias for the default project |
16 |
| - profiled.modules = [{ |
17 |
| - enableProfiling = true; |
18 |
| - enableLibraryProfiling = true; |
19 |
| - }]; |
20 |
| - ghc810.compiler-nix-name = "ghc810"; |
21 |
| - ghc98.compiler-nix-name = "ghc98"; |
22 |
| - ghc910.compiler-nix-name = "ghc910"; |
23 |
| - }; |
24 |
| - |
25 |
| - inputMap = { "https://chap.intersectmbo.org/" = inputs.CHaP; }; |
26 |
| - |
27 |
| - sha256map = { |
28 |
| - "https://github.com/jaccokrijnen/plutus-cert"."e814b9171398cbdfecdc6823067156a7e9fc76a3" = |
29 |
| - "0srqvx0b819b5crrbsa9hz2fnr50ahqizvvm0wdmyq2bbpk2rka7"; |
30 |
| - }; |
31 |
| - |
32 |
| - modules = [ |
33 |
| - # Common |
34 |
| - { |
35 |
| - packages = { |
36 |
| - # plutus-metatheory needs agda with the stdlib around for the custom setup |
37 |
| - # I can't figure out a way to apply this as a blanket change for all the |
38 |
| - # components in the package, oh well |
39 |
| - plutus-metatheory.components.library.build-tools = |
40 |
| - [ agda-with-stdlib ]; |
41 |
| - plutus-metatheory.components.exes.plc-agda.build-tools = |
42 |
| - [ agda-with-stdlib ]; |
43 |
| - plutus-metatheory.components.tests.test-NEAT.build-tools = |
44 |
| - [ agda-with-stdlib ]; |
45 |
| - |
46 |
| - plutus-executables.components.exes.uplc.build-tools = |
47 |
| - [ agda-with-stdlib ]; |
48 |
| - |
49 |
| - plutus-executables.components.tests.test-simple.build-tools = |
50 |
| - [ agda-with-stdlib ]; |
51 |
| - plutus-executables.components.tests.test-detailed.build-tools = |
52 |
| - [ agda-with-stdlib ]; |
53 |
| - |
54 |
| - plutus-core.components.benchmarks.update-cost-model = { |
55 |
| - build-tools = [ r-with-packages ]; |
56 |
| - }; |
57 |
| - |
58 |
| - plutus-core.components.benchmarks.cost-model-test = { |
59 |
| - build-tools = [ r-with-packages ]; |
60 |
| - }; |
61 |
| - |
62 |
| - plutus-cert.components.library.build-tools = |
63 |
| - # Needs to build both itself and its bundled deps. |
64 |
| - # This needs both coq and ocaml packages, and only |
65 |
| - # works with particular versions. Fortunately |
66 |
| - # they're in nixpkgs. |
67 |
| - let |
68 |
| - ocamlPkgs = pkgs.ocaml-ng.ocamlPackages_4_10; |
69 |
| - coqPkgs = pkgs.coqPackages_8_13; |
70 |
| - in |
71 |
| - with ocamlPkgs; |
72 |
| - with coqPkgs; [ |
| 5 | + cabalProject = pkgs.haskell-nix.cabalProject' ({ config, pkgs, ... }: |
| 6 | + let |
| 7 | + ghc-options-for-static-exe = |
| 8 | + lib.optionals pkgs.stdenv.hostPlatform.isMusl [ "-fexternal-interpreter" ]; |
| 9 | + in |
| 10 | + { |
| 11 | + name = "plutus"; |
| 12 | + |
| 13 | + # We need the mkDefault here since compiler-nix-name will be overridden |
| 14 | + # in flake.variants. |
| 15 | + compiler-nix-name = lib.mkDefault "ghc96"; |
| 16 | + |
| 17 | + src = ../.; |
| 18 | + |
| 19 | + flake.variants = { |
| 20 | + ghc96 = { }; # Alias for the default project |
| 21 | + profiled.modules = [{ |
| 22 | + enableProfiling = true; |
| 23 | + enableLibraryProfiling = true; |
| 24 | + }]; |
| 25 | + ghc810.compiler-nix-name = "ghc810"; |
| 26 | + ghc98.compiler-nix-name = "ghc98"; |
| 27 | + ghc910.compiler-nix-name = "ghc910"; |
| 28 | + }; |
| 29 | + |
| 30 | + inputMap = { "https://chap.intersectmbo.org/" = inputs.CHaP; }; |
| 31 | + |
| 32 | + sha256map = { |
| 33 | + "https://github.com/jaccokrijnen/plutus-cert"."e814b9171398cbdfecdc6823067156a7e9fc76a3" = |
| 34 | + "0srqvx0b819b5crrbsa9hz2fnr50ahqizvvm0wdmyq2bbpk2rka7"; |
| 35 | + }; |
| 36 | + |
| 37 | + modules = [ |
| 38 | + { |
| 39 | + packages = { |
| 40 | + |
| 41 | + plutus-metatheory.components.library.build-tools = |
| 42 | + [ agda-with-stdlib ]; |
| 43 | + |
| 44 | + plutus-metatheory.components.exes.plc-agda.build-tools = |
| 45 | + [ agda-with-stdlib ]; |
| 46 | + |
| 47 | + plutus-metatheory.components.tests.test-NEAT.build-tools = |
| 48 | + [ agda-with-stdlib ]; |
| 49 | + |
| 50 | + plutus-executables.components.exes.pir = { |
| 51 | + preBuild = utils.exportGitHashAndGitCommitDateEnvVars inputs.self; |
| 52 | + ghcOptions = ghc-options-for-static-exe; |
| 53 | + }; |
| 54 | + |
| 55 | + plutus-executables.components.exes.plc = { |
| 56 | + preBuild = utils.exportGitHashAndGitCommitDateEnvVars inputs.self; |
| 57 | + ghcOptions = ghc-options-for-static-exe; |
| 58 | + }; |
| 59 | + |
| 60 | + plutus-executables.components.exes.uplc = { |
| 61 | + preBuild = utils.exportGitHashAndGitCommitDateEnvVars inputs.self; |
| 62 | + ghcOptions = ghc-options-for-static-exe; |
| 63 | + build-tools = [ agda-with-stdlib ]; |
| 64 | + }; |
| 65 | + |
| 66 | + plutus-executables.components.tests.test-simple.build-tools = |
| 67 | + [ agda-with-stdlib ]; |
| 68 | + |
| 69 | + plutus-executables.components.tests.test-detailed.build-tools = |
| 70 | + [ agda-with-stdlib ]; |
| 71 | + |
| 72 | + plutus-core.components.benchmarks.update-cost-model.build-tools = |
| 73 | + [ r-with-packages ]; |
| 74 | + |
| 75 | + plutus-core.components.benchmarks.cost-model-test.build-tools = |
| 76 | + [ r-with-packages ]; |
| 77 | + |
| 78 | + plutus-core.components.tests.plutus-core-test.postInstall = '' |
| 79 | + wrapProgram $out/bin/plutus-core-test --set PATH ${ |
| 80 | + lib.makeBinPath [ pkgs.diffutils ] |
| 81 | + } |
| 82 | + ''; |
| 83 | + |
| 84 | + plutus-core.components.tests.plutus-ir-test.postInstall = '' |
| 85 | + wrapProgram $out/bin/plutus-ir-test --set PATH ${ |
| 86 | + lib.makeBinPath [ pkgs.diffutils ] |
| 87 | + } |
| 88 | + ''; |
| 89 | + |
| 90 | + plutus-core.components.exes.plutus = { |
| 91 | + preBuild = utils.exportGitHashAndGitCommitDateEnvVars inputs.self; |
| 92 | + ghcOptions = ghc-options-for-static-exe; |
| 93 | + }; |
| 94 | + |
| 95 | + plutus-cert.components.library.build-tools = [ |
73 | 96 | pkgs.perl
|
74 |
| - ocaml |
75 |
| - ocamlbuild |
76 |
| - findlib |
77 |
| - coq |
78 |
| - mathcomp |
79 |
| - coq-ext-lib |
80 |
| - ssreflect |
81 |
| - equations |
| 97 | + pkgs.ocaml-ng.ocamlPackages_4_10.ocaml |
| 98 | + pkgs.ocaml-ng.ocamlPackages_4_10.ocamlbuild |
| 99 | + pkgs.ocaml-ng.ocamlPackages_4_10.findlib |
| 100 | + pkgs.coqPackages_8_13.coq |
| 101 | + pkgs.coqPackages_8_13.mathcomp |
| 102 | + pkgs.coqPackages_8_13.coq-ext-lib |
| 103 | + pkgs.coqPackages_8_13.ssreflect |
| 104 | + pkgs.coqPackages_8_13.equations |
82 | 105 | ];
|
83 |
| - |
84 |
| - plutus-core.components.tests.plutus-core-test.postInstall = '' |
85 |
| - wrapProgram $out/bin/plutus-core-test --set PATH ${ |
86 |
| - lib.makeBinPath [ pkgs.diffutils ] |
87 |
| - } |
88 |
| - ''; |
89 |
| - |
90 |
| - plutus-core.components.tests.plutus-ir-test.postInstall = '' |
91 |
| - wrapProgram $out/bin/plutus-ir-test --set PATH ${ |
92 |
| - lib.makeBinPath [ pkgs.diffutils ] |
93 |
| - } |
94 |
| - ''; |
95 |
| - }; |
96 |
| - } |
97 |
| - |
98 |
| - { |
99 |
| - packages = { |
100 |
| - cardano-constitution.ghcOptions = [ "-Werror" ]; |
101 |
| - plutus-benchmark.ghcOptions = [ "-Werror" ]; |
102 |
| - plutus-conformance.ghcOptions = [ "-Werror" ]; |
103 |
| - plutus-core.ghcOptions = [ "-Werror" ]; |
104 |
| - plutus-executables.ghcOptions = [ "-Werror" ]; |
105 |
| - plutus-ledger-api.ghcOptions = [ "-Werror" ]; |
106 |
| - plutus-metatheory.ghcOptions = [ "-Werror" ]; |
107 |
| - plutus-tx.ghcOptions = [ "-Werror" ]; |
108 |
| - plutus-tx-plugin.ghcOptions = [ "-Werror" ]; |
109 |
| - plutus-tx-test-util.ghcOptions = [ "-Werror" ]; |
110 |
| - }; |
111 |
| - } |
112 |
| - ]; |
113 |
| - }); |
114 |
| - |
| 106 | + }; |
| 107 | + } |
| 108 | + |
| 109 | + { |
| 110 | + packages = { |
| 111 | + cardano-constitution.ghcOptions = [ "-Werror" ]; |
| 112 | + plutus-benchmark.ghcOptions = [ "-Werror" ]; |
| 113 | + plutus-conformance.ghcOptions = [ "-Werror" ]; |
| 114 | + plutus-core.ghcOptions = [ "-Werror" ]; |
| 115 | + plutus-executables.ghcOptions = [ "-Werror" ]; |
| 116 | + plutus-ledger-api.ghcOptions = [ "-Werror" ]; |
| 117 | + plutus-metatheory.ghcOptions = [ "-Werror" ]; |
| 118 | + plutus-tx.ghcOptions = [ "-Werror" ]; |
| 119 | + plutus-tx-plugin.ghcOptions = [ "-Werror" ]; |
| 120 | + plutus-tx-test-util.ghcOptions = [ "-Werror" ]; |
| 121 | + }; |
| 122 | + } |
| 123 | + ]; |
| 124 | + }); |
115 | 125 | in
|
116 | 126 | cabalProject
|
0 commit comments