11 let cg3 = stdenv.mkDerivation rec {
15 src = fetchFromGitHub {
16 owner = "GrammarSoft";
19 sha256 = "sha256-TiEhhk90w5GibGZ4yalIf+4qLA8NoU6+GIPN6QNTz2A=";
34 substituteInPlace "$out"/lib/pkgconfig/cg3.pc \
35 --replace '=''${prefix}//' '=/'
38 passthru.tests.minimal = runCommand "${pname}-test" {
44 echo 'DELIMITERS = "."; ADD (tag) (*);' >grammar.cg3
45 printf '"<a>"\n\t"a" tag\n\n' >want.txt
46 printf '"<a>"\n\t"a"\n\n' | vislcg3 -g grammar.cg3 >got.txt
47 diff -s want.txt got.txt || die "Grammar application did not produce expected parse"
52 # TODO, consider optionals:
53 # - Enable tcmalloc unless darwin?
54 # - Enable python bindings?
57 homepage = "https://github.com/GrammarSoft/cg3";
58 description = "Constraint Grammar interpreter, compiler and applicator vislcg3";
59 maintainers = with maintainers; [ unhammer ];
60 license = licenses.gpl3Plus;
61 platforms = platforms.all;