|
80 | 80 | testBuildInputs = with pkgs;
|
81 | 81 | [ file mercurial unzip ]
|
82 | 82 | ++ lib.optionals stdenv.isLinux [ strace ];
|
83 |
| - testNativeBuildInputs = with pkgs; [ nodejs-slim pkg-config opam ocamlformat ]; |
| 83 | + testNativeBuildInputs = pkgs: with pkgs; [ |
| 84 | + nodejs-slim |
| 85 | + pkg-config |
| 86 | + opam |
| 87 | + ocamlformat |
| 88 | + ]; |
84 | 89 |
|
85 | 90 | docInputs = with pkgs.python3.pkgs; [
|
86 | 91 | sphinx-autobuild
|
|
97 | 102 | default = with pkgs; stdenv.mkDerivation {
|
98 | 103 | pname = "dune";
|
99 | 104 | version = "n/a";
|
100 |
| - src = ./.; |
| 105 | + src = |
| 106 | + let fs = lib.fileset; in |
| 107 | + fs.toSource { |
| 108 | + root = ./.; |
| 109 | + fileset = fs.unions [ |
| 110 | + ./bin |
| 111 | + ./boot |
| 112 | + ./configure |
| 113 | + ./dune-project |
| 114 | + ./dune-file |
| 115 | + ./src |
| 116 | + ./plugin |
| 117 | + ./vendor |
| 118 | + ./otherlibs |
| 119 | + ./Makefile |
| 120 | + (fs.fileFilter (file: file.hasExt "opam" || file.hasExt "template") ./.) |
| 121 | + ]; |
| 122 | + }; |
101 | 123 | nativeBuildInputs = with ocamlPackages; [ ocaml findlib ];
|
102 | 124 | buildInputs = lib.optionals stdenv.isDarwin [
|
103 | 125 | darwin.apple_sdk.frameworks.CoreServices
|
|
118 | 140 | devShells =
|
119 | 141 | let
|
120 | 142 | makeDuneDevShell =
|
121 |
| - { extraBuildInputs ? [ ] |
| 143 | + { extraBuildInputs ? (pkgs: [ ]) |
122 | 144 | , meta ? null
|
123 | 145 | , duneFromScope ? false
|
124 | 146 | }:
|
|
134 | 156 | else pkgs;
|
135 | 157 |
|
136 | 158 | inherit (pkgs') writeScriptBin stdenv;
|
137 |
| - inherit docInputs; |
138 | 159 |
|
139 | 160 | duneScript =
|
140 | 161 | writeScriptBin "dune" ''
|
|
148 | 169 | export DUNE_SOURCE_ROOT=$PWD
|
149 | 170 | '';
|
150 | 171 | inherit meta;
|
151 |
| - nativeBuildInputs = testNativeBuildInputs |
| 172 | + nativeBuildInputs = (testNativeBuildInputs pkgs') |
152 | 173 | ++ docInputs
|
153 | 174 | ++ [ duneScript ];
|
154 | 175 | inputsFrom = [ pkgs'.ocamlPackages.dune_3 ];
|
|
166 | 187 | odoc
|
167 | 188 | lwt
|
168 | 189 | patdiff
|
169 |
| - ] ++ extraBuildInputs); |
| 190 | + ] ++ (extraBuildInputs pkgs')); |
170 | 191 | };
|
171 | 192 | in
|
172 | 193 | {
|
|
196 | 217 | '';
|
197 | 218 | };
|
198 | 219 | slim-melange = makeDuneDevShell {
|
199 |
| - extraBuildInputs = [ |
| 220 | + extraBuildInputs = pkgs: [ |
200 | 221 | pkgs.ocamlPackages.melange
|
201 | 222 | ];
|
202 | 223 | meta.description = ''
|
|
205 | 226 | '';
|
206 | 227 | };
|
207 | 228 | slim-opam = with pkgs; mkShell {
|
208 |
| - nativeBuildInputs = lib.remove pkgs.ocamlformat testNativeBuildInputs; |
| 229 | + nativeBuildInputs = lib.remove pkgs.ocamlformat (testNativeBuildInputs pkgs); |
209 | 230 | buildInputs = lib.optionals stdenv.isDarwin [
|
210 | 231 | darwin.apple_sdk.frameworks.CoreServices
|
211 | 232 | ];
|
|
217 | 238 |
|
218 | 239 | coq =
|
219 | 240 | pkgs.mkShell {
|
220 |
| - nativeBuildInputs = testNativeBuildInputs; |
| 241 | + nativeBuildInputs = (testNativeBuildInputs pkgs); |
221 | 242 | # Coq requires OCaml 4.x
|
222 | 243 | inputsFrom = [ pkgs.ocaml-ng.ocamlPackages_4_14.dune_3 ];
|
223 | 244 | buildInputs = with pkgs; [
|
|
230 | 251 | '';
|
231 | 252 | };
|
232 | 253 | microbench = makeDuneDevShell {
|
233 |
| - extraBuildInputs = with pkgs.ocamlPackages; [ |
234 |
| - core_bench |
| 254 | + extraBuildInputs = pkgs: [ |
| 255 | + pkgs.ocamlPackages.core_bench |
235 | 256 | ];
|
236 | 257 | meta.description = ''
|
237 | 258 | Provides a minimal shell environment that can build the
|
|
249 | 270 | };
|
250 | 271 | default =
|
251 | 272 | makeDuneDevShell {
|
252 |
| - extraBuildInputs = (with pkgs; [ |
| 273 | + extraBuildInputs = pkgs: (with pkgs; [ |
253 | 274 | # dev tools
|
254 | 275 | ccls
|
255 | 276 | ]) ++ (with pkgs.ocamlPackages; [
|
|
0 commit comments