-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdefault.nix
69 lines (58 loc) · 1.37 KB
/
default.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
68
69
{ pkgs, version, bundleName, updateUrl, kioskUrl }:
with pkgs;
ocamlPackages.buildDunePackage rec {
pname = "playos_controller";
inherit version;
minimumOcamlVersion = "4.06";
src = ./.;
preConfigure = let
subs = {
"@PLAYOS_VERSION@" = version;
"@PLAYOS_UPDATE_URL@" = updateUrl;
"@PLAYOS_KIOSK_URL@" = kioskUrl;
"@PLAYOS_BUNDLE_NAME@" = bundleName;
};
in
''
markdown Changelog.md > Changelog.html
${lib.strings.toShellVar "subs_arr" subs}
for name in "''${!subs_arr[@]}"; do
# check that the specified template variables are used
grep -q $name ./config/config.ml || \
(echo "$name is missing in ./config/config.ml"; exit 1)
sed -i -e "s,$name,''${subs_arr[$name]},g" ./config/config.ml
done
'';
postFixup = ''
for prog in "$out"/bin/*; do
wrapProgram $prog \
--prefix PATH ":" ${lib.makeBinPath [ curl ]}
done
'';
useDune2 = true;
nativeBuildInputs = [
pkgs.makeWrapper
discount # Transform Markdown to HTML
ocamlPackages.obus
];
buildInputs = with ocamlPackages; [
opium
ocaml_lwt
logs
fpath
tyxml
cohttp-lwt-unix
obus
semver
sexplib
ezjsonm
containers
fieldslib
ppx_protocol_conv
ppx_protocol_conv_jsonm
alcotest
alcotest-lwt
qcheck
qcheck-alcotest
];
}