|
123 | 123 |
|
124 | 124 | # We use cabalProject' to ensure we don't build the plan for |
125 | 125 | # all systems. |
126 | | - # Fetch proto-lens with submodules and fix symlinks for plan and build phases |
127 | | - protoLensSrc = nixpkgs.fetchgit { |
128 | | - url = "https://github.com/google/proto-lens"; |
129 | | - rev = "9b41fe0e10e8fe12ec508a3b361d0f0c2217c491"; |
130 | | - sha256 = "sha256-ruTbbUKVJBPANnm6puigtp26mmiVDd0jMpLfJLOuUpU="; |
131 | | - fetchSubmodules = true; |
132 | | - }; |
133 | | - fixProtoLensSrc = nixpkgs.runCommand "proto-lens-fixed" {} '' |
134 | | - mkdir -p $out |
135 | | - cp -a ${protoLensSrc}/. $out/ |
136 | | - chmod -R +w $out |
137 | | - # Fix proto-lens-imports symlink in proto-lens |
138 | | - rm -rf $out/proto-lens/proto-lens-imports/google |
139 | | - cp -r ${protoLensSrc}/google/protobuf/src/google $out/proto-lens/proto-lens-imports/ |
140 | | - # Fix proto-src symlink in proto-lens-protobuf-types |
141 | | - rm -rf $out/proto-lens-protobuf-types/proto-src |
142 | | - cp -r ${protoLensSrc}/google/protobuf/src $out/proto-lens-protobuf-types/proto-src |
143 | | - chmod -R -w $out |
144 | | - ''; |
145 | | - |
146 | 126 | cabalProject = nixpkgs.haskell-nix.cabalProject' ({config, ...}: { |
147 | 127 | src = ./.; |
148 | 128 | name = "cardano-api"; |
|
160 | 140 | # |
161 | 141 | inputMap = { |
162 | 142 | "https://chap.intersectmbo.org/" = inputs.CHaP; |
163 | | - "https://github.com/google/proto-lens/9b41fe0e10e8fe12ec508a3b361d0f0c2217c491" = protoLensSrc; |
164 | 143 | }; |
165 | 144 | # Also currently needed to make `nix flake lock --update-input CHaP` work. |
166 | 145 | cabalProjectLocal = '' |
|
209 | 188 | shellcheck |
210 | 189 | snappy |
211 | 190 | protobuf |
212 | | - buf |
| 191 | + # buf version must match `.github/workflows/haskell.yml` (buf is |
| 192 | + # not backwards-compatible across minor versions for |
| 193 | + # `buf generate` output). |
| 194 | + unstable.buf |
213 | 195 | blst |
214 | 196 | inputs.cardano-dev.packages.${system}.herald |
215 | 197 | (writeShellScriptBin "haskell-language-server-wrapper" ''exec haskell-language-server "$@"'') |
|
228 | 210 | # package customizations as needed. Where cabal.project is not |
229 | 211 | # specific enough, or doesn't allow setting these. |
230 | 212 | modules = [ |
231 | | - # TODO remove this module when removing proto-lens SRP |
232 | | - # Override proto-lens source to use fixed symlinks (inputMap provides the fixed |
233 | | - # source for plan computation; this module provides it for the build phase) |
234 | | - ({ |
235 | | - lib, |
236 | | - config, |
237 | | - ... |
238 | | - }: let |
239 | | - protoLensPackages = [ |
240 | | - "proto-lens" |
241 | | - "proto-lens-arbitrary" |
242 | | - "proto-lens-discrimination" |
243 | | - "proto-lens-optparse" |
244 | | - "proto-lens-protobuf-types" |
245 | | - "proto-lens-protoc" |
246 | | - "proto-lens-runtime" |
247 | | - "proto-lens-setup" |
248 | | - "proto-lens-tests-dep" |
249 | | - "proto-lens-tests" |
250 | | - "discrimination-ieee754" |
251 | | - "proto-lens-benchmarks" |
252 | | - ]; |
253 | | - in { |
254 | | - packages = |
255 | | - lib.genAttrs |
256 | | - (builtins.filter (p: config.packages ? ${p}) protoLensPackages) |
257 | | - (p: {src = lib.mkForce (fixProtoLensSrc + "/${p}");}); |
258 | | - }) |
259 | 213 | ({...}: { |
260 | 214 | packages.cardano-api = { |
261 | 215 | configureFlags = ["--ghc-option=-Werror"]; |
|
0 commit comments