-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
50 lines (40 loc) · 981 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
50
{
stdenv,
lib,
cmake,
doxygen,
graphviz,
enableStatic ? false,
enableShared ? !enableStatic,
enaleTests ? true,
enableDoc ? true,
}:
assert enableShared || enableStatic;
stdenv.mkDerivation (finalAttrs: {
pname = "tinyhash";
version = "0.0.1";
src = ./.;
cmakeFlags =
lib.optional enaleTests "-DBUILD_TESTS=ON"
++ lib.optional enableStatic "-DBUILD_STATIC=ON"
++ lib.optional enableDoc ''
-DBUILD_DOC=ON
-DDOT_BIN_PATH=${graphviz}/bin/dot
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ doxygen ];
postBuild = lib.optionals enaleTests ''
make test
'';
postInstall = lib.optionals enaleTests ''
mkdir $out/doc
for dir in "html" "latex"; do
mv doc/$dir $out/doc/$dir
done
'';
meta = {
description = "This is a library containing multiple C implementations of hashmap.";
homepage = "https://github.com/theobori/${finalAttrs.pname}";
license = lib.licenses.mit;
};
})