-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
50 lines (40 loc) · 1.09 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
{ stdenv, lib, fetchFromGitHub, cmake, cjson, version, commitHash }:
let
vsclib = fetchFromGitHub {
owner = "vs49688";
repo = "vsclib";
rev = "7c4b67f89ecbeb0899da9bbadbf3a1fcb0a2fc36";
sha256 = "sha256-Aw4iJUW2T5irrFWCvRxKzbkiDEbEEe4eMq9Eh/cLu3k=";
};
in
stdenv.mkDerivation {
inherit version;
pname = "crocutils";
nativeBuildInputs = [ cmake ];
enableParallelBuilding = true;
src = builtins.filterSource (path: type: baseNameOf path != ".git") ./.;
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=MinSizeRel"
"-DCROCTOOL_VERSION_STRING=${version}"
"-DCROCTOOL_COMMIT_HASH=${commitHash}"
];
preConfigure = ''
rm -rf vsclib
ln -s ${vsclib} vsclib
rm -rf cJSON
ln -s ${cjson.src} cJSON
'';
doCheck = true;
checkPhase = ''
pushd ../tests
../build/tests/libcroc_tests
popd
'';
passthru.commitHash = commitHash;
meta = with lib; {
description = "A small collection of utilities for Croc.";
homepage = "https://github.com/vs49688/CrocUtils";
platforms = platforms.all;
license = licenses.gpl2;
};
}