3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/text/link-grammar/default.nix

66 lines
1.4 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, pkg-config
, python3
, sqlite
, libedit
, runCommand
, dieHook
}:
2018-09-18 20:43:34 +01:00
let
link-grammar = stdenv.mkDerivation rec {
2018-09-18 20:43:34 +01:00
pname = "link-grammar";
2021-12-09 19:42:34 +00:00
version = "5.10.2";
2018-09-18 20:43:34 +01:00
outputs = [ "bin" "out" "dev" "man" ];
src = fetchurl {
url = "http://www.abisource.com/downloads/${pname}/${version}/${pname}-${version}.tar.gz";
2021-12-09 19:42:34 +00:00
sha256 = "sha256-KM7HUuqg44l66WEzO2knRZ+Laf7+aMKqUnKYPX24abY=";
2018-09-18 20:43:34 +01:00
};
nativeBuildInputs = [
pkg-config
python3
];
buildInputs = [
sqlite
libedit
];
2018-09-18 20:43:34 +01:00
configureFlags = [
"--disable-java-bindings"
];
doCheck = true;
passthru.tests = {
quick = runCommand "link-grammar-quick-test" {
buildInputs = [
link-grammar
dieHook
];
} ''
echo "Furiously sleep ideas green colorless." | link-parser en | grep "No complete linkages found." || die "Grammaticaly invalid sentence was parsed."
echo "Colorless green ideas sleep furiously." | link-parser en | grep "Found .* linkages." || die "Grammaticaly valid sentence was not parsed."
touch $out
'';
};
meta = with lib; {
2018-09-18 20:43:34 +01:00
description = "A Grammar Checking library";
2020-03-05 08:05:02 +00:00
homepage = "https://www.abisource.com/projects/link-grammar/";
changelog = "https://github.com/opencog/link-grammar/blob/link-grammar-${version}/ChangeLog";
license = licenses.lgpl21Only;
2018-09-18 20:43:34 +01:00
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.unix;
};
};
in
link-grammar