forked from dhall-lang/dhall-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
67 lines (53 loc) · 1.78 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ src, ... }:
let
fetchNixpkgs = import ./nix/fetchNixpkgs.nix;
nixpkgs = fetchNixpkgs {
rev = "804060ff9a79ceb0925fe9ef79ddbf564a225d47";
sha256 = "01pb6p07xawi60kshsxxq1bzn8a0y4s5jjqvhkwps4f5xjmmwav3";
outputSha256 = "0ga345hgw6v2kzyhvf5kw96hf60mx5pbd9c4qj5q4nan4lr7nkxn";
};
overlay = pkgsNew: pkgsOld: {
instaparse-check = pkgsNew.writeText "build.boot" ''
(require '[instaparse.core :refer [parser]])
(def grammar (slurp "${./standard/dhall.abnf}"))
(def dhall-parser
(parser grammar
:input-format :abnf
:start :complete-expression
:output-format :hiccup))
(deftask check []
(println "Grammar is syntactically correct."))
'';
dhall-grammar =
pkgsNew.runCommand
"instaparse-accepts-grammar"
{ nativeBuildInputs = [
pkgsNew.boot
];
}
''
export _JAVA_OPTIONS=-Duser.home="''${PWD}"
export BOOT_CLOJURE_VERSION=1.8.0
export BOOT_VERSION=2.7.2
export BOOT_HOME="''${PWD}"
cp ${pkgsNew.instaparse-check} build.boot
boot -d instaparse:1.4.9 check
touch $out
'';
};
pkgs = import nixpkgs { config = {}; overlays = [ overlay ]; };
# Derivation that trivially depends on the input source code revision.
# As this is included in the "dhall-lang" aggregate, it forces every
# commit to have a corresponding GitHub status check, even if the
# commit doesn't make any changes (which can happen when merging
# master in).
rev = pkgs.runCommand "rev" {} ''echo "${src.rev}" > $out'';
in
{ dhall-lang = pkgs.releaseTools.aggregate {
name = "dhall-lang";
constituents = [
pkgs.dhall-grammar
rev
];
};
}