-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdefault.nix
49 lines (44 loc) · 889 Bytes
/
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
{ stdenv
, lib
, ocamlPackages
, static ? false
, nix-filter
, crossName ? null
}:
with ocamlPackages;
buildDunePackage {
pname = "doi2bib";
version = "n/a";
src = with nix-filter; filter {
root = ./..;
include = [
"dune-project"
"doi2bib.opam"
"dune-project"
"bin"
"lib"
];
};
OCAMLFIND_TOOLCHAIN = crossName;
propagatedBuildInputs = [
astring
cohttp-lwt-unix
cmdliner
clz
ezxmlm
lwt
bigstringaf
tls
re
];
buildPhase = ''
echo "running\
${if static then "static" else "release"} build\
${if crossName != null then "for ${crossName}" else ""}"
dune build bin/doi2bib.exe -j $NIX_BUILD_CORES --display=short --profile=${if static then "static" else "release"}
'';
installPhase = ''
mkdir -p $out/bin
mv _build/default/bin/doi2bib.exe $out/bin/doi2bib
'';
}