-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
36 lines (36 loc) · 905 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
{ stdenv, lib, autoreconfHook, jq, bats, doCheck ? false }: let
batsWith = bats.withLibraries (p: [
p.bats-assert
p.bats-file
p.bats-support
]);
in stdenv.mkDerivation {
pname = "ccdb";
src = builtins.path {
path = ./.;
filter = path: type: let
bname = baseNameOf path;
ignoredBNames = [
"Makefile"
"configure"
"config.status"
"result"
"out"
"autom4te.cache"
".github"
];
bNameOkay = ! ( builtins.elem bname ignoredBNames );
ignoredPatterns = [
".*~" ".*\\.log"
];
test = patt: str: ( builtins.match patt str ) != null;
patternsOkay =
builtins.all ( patt: ! ( test patt path ) ) ignoredPatterns;
in bNameOkay && patternsOkay;
};
version = "0.1.0";
nativeBuildInputs = [autoreconfHook batsWith];
buildInputs = [jq];
inherit doCheck;
meta.license = lib.licenses.gpl3;
}