|
1 | 1 | { |
2 | 2 | inputs = { |
3 | 3 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; |
| 4 | + nixpkgs-old.url = "github:nixos/nixpkgs/7f50d4b33363d3948543f6a02b90a2c66852a453"; |
4 | 5 | flake-utils.url = "github:numtide/flake-utils"; |
5 | 6 | melange = { |
6 | | - url = "github:melange-re/melange/refs/tags/5.1.0-53"; |
| 7 | + url = "github:melange-re/melange/refs/tags/6.0.0-54"; |
7 | 8 | inputs.nixpkgs.follows = "nixpkgs"; |
8 | 9 | }; |
9 | 10 | ocaml-overlays = { |
|
24 | 25 | self, |
25 | 26 | flake-utils, |
26 | 27 | nixpkgs, |
| 28 | + nixpkgs-old, |
27 | 29 | melange, |
28 | 30 | ocaml-overlays, |
29 | 31 | oxcaml, |
|
35 | 37 | pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [ |
36 | 38 | ocaml-overlays.overlays.default |
37 | 39 | (self: super: { |
38 | | - ocamlPackages = super.ocaml-ng.ocamlPackages_5_3.overrideScope ( |
| 40 | + ocamlPackages = super.ocaml-ng.ocamlPackages_5_4.overrideScope ( |
39 | 41 | oself: osuper: { |
40 | 42 | mdx = osuper.mdx.override { |
41 | 43 | logs = oself.logs; |
|
63 | 65 | oxcamlOpamRepo = oxcaml-opam-repository; |
64 | 66 | }; |
65 | 67 |
|
| 68 | + # Older nixpkgs for OCaml 4.02 support |
| 69 | + pkgs-old = nixpkgs-old.legacyPackages.${system}.appendOverlays [ |
| 70 | + ocaml-overlays.overlays.default |
| 71 | + ]; |
| 72 | + |
66 | 73 | dune-static-overlay = self: super: { |
67 | | - ocamlPackages = super.ocaml-ng.ocamlPackages_5_3.overrideScope ( |
| 74 | + ocamlPackages = super.ocaml-ng.ocamlPackages_5_4.overrideScope ( |
68 | 75 | oself: osuper: { |
69 | 76 | dune_3 = osuper.dune_3.overrideAttrs (a: { |
70 | 77 | src = ./.; |
|
80 | 87 |
|
81 | 88 | ocamlformat = |
82 | 89 | let |
83 | | - ocamlformat_version = |
84 | | - let |
85 | | - lists = pkgs.lib.lists; |
86 | | - strings = pkgs.lib.strings; |
87 | | - ocamlformat_config = strings.splitString "\n" (builtins.readFile ./.ocamlformat); |
88 | | - prefix = "version="; |
89 | | - ocamlformat_version_pred = line: strings.hasPrefix prefix line; |
90 | | - version_line = lists.findFirst ocamlformat_version_pred "not_found" ocamlformat_config; |
91 | | - version = strings.removePrefix prefix version_line; |
92 | | - in |
93 | | - builtins.replaceStrings [ "." ] [ "_" ] version; |
| 90 | + lists = pkgs.lib.lists; |
| 91 | + strings = pkgs.lib.strings; |
| 92 | + ocamlformat_config = strings.splitString "\n" (builtins.readFile ./.ocamlformat); |
| 93 | + prefix = "version="; |
| 94 | + ocamlformat_version_pred = line: strings.hasPrefix prefix line; |
| 95 | + version_line = lists.findFirst ocamlformat_version_pred "not_found" ocamlformat_config; |
| 96 | + version_string = strings.removePrefix prefix version_line; |
| 97 | + ocamlformat_attr = builtins.replaceStrings [ "." ] [ "_" ] version_string; |
94 | 98 | in |
95 | | - builtins.getAttr ("ocamlformat_" + ocamlformat_version) pkgs; |
| 99 | + builtins.getAttr ("ocamlformat_" + ocamlformat_attr) nixpkgs.legacyPackages.${system}; |
96 | 100 |
|
97 | 101 | testBuildInputs = |
98 | 102 | with pkgs; |
|
274 | 278 | fmt = pkgs.mkShell { |
275 | 279 | inherit INSIDE_NIX; |
276 | 280 | nativeBuildInputs = [ ocamlformat ]; |
277 | | - # re shouldn't be needed. this is an issue with the fmt rules |
278 | 281 | inputsFrom = [ |
279 | 282 | pkgs.dune_3 |
280 | 283 | ]; |
281 | 284 | buildInputs = with pkgs.ocamlPackages; [ |
282 | 285 | csexp |
283 | 286 | pp |
| 287 | + # re shouldn't be needed. this is an issue with the fmt rules |
284 | 288 | re |
285 | 289 | spawn |
286 | 290 | uutf |
|
342 | 346 |
|
343 | 347 | bootstrap-check = pkgs.mkShell { |
344 | 348 | inherit INSIDE_NIX; |
345 | | - buildInputs = with pkgs; [ |
346 | | - gnumake |
347 | | - ocaml-ng.ocamlPackages_4_02.ocaml |
| 349 | + buildInputs = [ |
| 350 | + pkgs.gnumake |
| 351 | + pkgs-old.ocaml-ng.ocamlPackages_4_02.ocaml |
348 | 352 | ]; |
349 | 353 | meta.description = '' |
350 | 354 | Provides a minimal shell environment with OCaml 4.02 in order |
|
354 | 358 |
|
355 | 359 | bootstrap-check_4_08 = pkgs.mkShell { |
356 | 360 | inherit INSIDE_NIX; |
357 | | - buildInputs = with pkgs; [ |
358 | | - gnumake |
359 | | - ocaml-ng.ocamlPackages_4_08.ocaml |
| 361 | + buildInputs = [ |
| 362 | + pkgs.gnumake |
| 363 | + pkgs-old.ocaml-ng.ocamlPackages_4_08.ocaml |
360 | 364 | ]; |
361 | 365 | meta.description = '' |
362 | 366 | Provides a minimal shell environment with OCaml 4.08 in order |
|
0 commit comments