mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
cg3: 1.3.9 -> 1.5.1
This commit is contained in:
@@ -7,64 +7,64 @@
|
||||
cmake,
|
||||
icu,
|
||||
boost,
|
||||
pkg-config,
|
||||
sqlite,
|
||||
cg3,
|
||||
}:
|
||||
|
||||
let
|
||||
cg3 = stdenv.mkDerivation rec {
|
||||
pname = "cg3";
|
||||
version = "1.3.9";
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "cg3";
|
||||
version = "1.5.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "GrammarSoft";
|
||||
repo = "cg3";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-TiEhhk90w5GibGZ4yalIf+4qLA8NoU6+GIPN6QNTz2A=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
icu
|
||||
boost
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
postFixup = ''
|
||||
substituteInPlace "$out"/lib/pkgconfig/cg3.pc \
|
||||
--replace '=''${prefix}//' '=/'
|
||||
'';
|
||||
|
||||
passthru.tests.minimal =
|
||||
runCommand "${pname}-test"
|
||||
{
|
||||
buildInputs = [
|
||||
cg3
|
||||
dieHook
|
||||
];
|
||||
}
|
||||
''
|
||||
echo 'DELIMITERS = "."; ADD (tag) (*);' >grammar.cg3
|
||||
printf '"<a>"\n\t"a" tag\n\n' >want.txt
|
||||
printf '"<a>"\n\t"a"\n\n' | vislcg3 -g grammar.cg3 >got.txt
|
||||
diff -s want.txt got.txt || die "Grammar application did not produce expected parse"
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# TODO, consider optionals:
|
||||
# - Enable tcmalloc unless darwin?
|
||||
# - Enable python bindings?
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/GrammarSoft/cg3";
|
||||
description = "Constraint Grammar interpreter, compiler and applicator vislcg3";
|
||||
maintainers = with maintainers; [ unhammer ];
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
src = fetchFromGitHub {
|
||||
owner = "GrammarSoft";
|
||||
repo = "cg3";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-R3ePghkr4m6FmiHfhPVdLRAJaipIBhGLOX0Hz1nNPv4=";
|
||||
};
|
||||
|
||||
in
|
||||
cg3
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
icu
|
||||
boost
|
||||
sqlite
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
postFixup = ''
|
||||
substituteInPlace "$out"/lib/pkgconfig/cg3.pc \
|
||||
--replace-fail '=''${prefix}//' '=/'
|
||||
'';
|
||||
|
||||
passthru.tests.minimal =
|
||||
runCommand "cg3-test"
|
||||
{
|
||||
buildInputs = [
|
||||
cg3
|
||||
dieHook
|
||||
];
|
||||
}
|
||||
''
|
||||
echo 'DELIMITERS = "."; ADD (tag) (*);' >grammar.cg3
|
||||
printf '"<a>"\n\t"a" tag\n\n' >want.txt
|
||||
printf '"<a>"\n\t"a"\n\n' | vislcg3 -g grammar.cg3 >got.txt
|
||||
diff -s want.txt got.txt || die "Grammar application did not produce expected parse"
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# TODO, consider optionals:
|
||||
# - Enable tcmalloc unless darwin?
|
||||
# - Enable python bindings?
|
||||
meta = {
|
||||
homepage = "https://github.com/GrammarSoft/cg3";
|
||||
description = "Constraint Grammar interpreter, compiler and applicator vislcg3";
|
||||
maintainers = with lib.maintainers; [ unhammer ];
|
||||
license = lib.licenses.gpl3Plus;
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user