+51
-51
pkgs/by-name/cg/cg3/package.nix
+51
-51
pkgs/by-name/cg/cg3/package.nix
···
7
7
cmake,
8
8
icu,
9
9
boost,
10
+
pkg-config,
11
+
sqlite,
12
+
cg3,
10
13
}:
11
14
12
-
let
13
-
cg3 = stdenv.mkDerivation rec {
14
-
pname = "cg3";
15
-
version = "1.3.9";
15
+
stdenv.mkDerivation (finalAttrs: {
16
+
pname = "cg3";
17
+
version = "1.5.1";
16
18
17
-
src = fetchFromGitHub {
18
-
owner = "GrammarSoft";
19
-
repo = "cg3";
20
-
rev = "v${version}";
21
-
sha256 = "sha256-TiEhhk90w5GibGZ4yalIf+4qLA8NoU6+GIPN6QNTz2A=";
22
-
};
19
+
src = fetchFromGitHub {
20
+
owner = "GrammarSoft";
21
+
repo = "cg3";
22
+
tag = "v${finalAttrs.version}";
23
+
hash = "sha256-R3ePghkr4m6FmiHfhPVdLRAJaipIBhGLOX0Hz1nNPv4=";
24
+
};
23
25
24
-
nativeBuildInputs = [
25
-
cmake
26
-
];
26
+
nativeBuildInputs = [
27
+
cmake
28
+
pkg-config
29
+
];
27
30
28
-
buildInputs = [
29
-
icu
30
-
boost
31
-
];
31
+
buildInputs = [
32
+
icu
33
+
boost
34
+
sqlite
35
+
];
32
36
33
-
doCheck = true;
37
+
doCheck = true;
34
38
35
-
postFixup = ''
36
-
substituteInPlace "$out"/lib/pkgconfig/cg3.pc \
37
-
--replace '=''${prefix}//' '=/'
38
-
'';
39
-
40
-
passthru.tests.minimal =
41
-
runCommand "${pname}-test"
42
-
{
43
-
buildInputs = [
44
-
cg3
45
-
dieHook
46
-
];
47
-
}
48
-
''
49
-
echo 'DELIMITERS = "."; ADD (tag) (*);' >grammar.cg3
50
-
printf '"<a>"\n\t"a" tag\n\n' >want.txt
51
-
printf '"<a>"\n\t"a"\n\n' | vislcg3 -g grammar.cg3 >got.txt
52
-
diff -s want.txt got.txt || die "Grammar application did not produce expected parse"
53
-
touch $out
54
-
'';
39
+
postFixup = ''
40
+
substituteInPlace "$out"/lib/pkgconfig/cg3.pc \
41
+
--replace-fail '=''${prefix}//' '=/'
42
+
'';
55
43
56
-
# TODO, consider optionals:
57
-
# - Enable tcmalloc unless darwin?
58
-
# - Enable python bindings?
44
+
passthru.tests.minimal =
45
+
runCommand "cg3-test"
46
+
{
47
+
buildInputs = [
48
+
cg3
49
+
dieHook
50
+
];
51
+
}
52
+
''
53
+
echo 'DELIMITERS = "."; ADD (tag) (*);' >grammar.cg3
54
+
printf '"<a>"\n\t"a" tag\n\n' >want.txt
55
+
printf '"<a>"\n\t"a"\n\n' | vislcg3 -g grammar.cg3 >got.txt
56
+
diff -s want.txt got.txt || die "Grammar application did not produce expected parse"
57
+
touch $out
58
+
'';
59
59
60
-
meta = with lib; {
61
-
homepage = "https://github.com/GrammarSoft/cg3";
62
-
description = "Constraint Grammar interpreter, compiler and applicator vislcg3";
63
-
maintainers = with maintainers; [ unhammer ];
64
-
license = licenses.gpl3Plus;
65
-
platforms = platforms.all;
66
-
};
60
+
# TODO, consider optionals:
61
+
# - Enable tcmalloc unless darwin?
62
+
# - Enable python bindings?
63
+
meta = {
64
+
homepage = "https://github.com/GrammarSoft/cg3";
65
+
description = "Constraint Grammar interpreter, compiler and applicator vislcg3";
66
+
maintainers = with lib.maintainers; [ unhammer ];
67
+
license = lib.licenses.gpl3Plus;
68
+
platforms = lib.platforms.all;
67
69
};
68
-
69
-
in
70
-
cg3
70
+
})