2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, python3, sqlite, libedit, zlib, runCommand, dieHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
link-grammar = stdenv.mkDerivation rec {
|
|
|
|
version = "5.8.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "link-grammar";
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" "man" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.abisource.com/downloads/${pname}/${version}/${pname}-${version}.tar.gz";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "sha256-EcT/VR+lFpJX2sxXUIDGOwdceQ7awpmEqUZBoJk7UFs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ sqlite libedit zlib ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-java-bindings"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Grammar Checking library";
|
|
|
|
homepage = "https://www.abisource.com/projects/link-grammar/";
|
2021-02-05 17:12:51 +00:00
|
|
|
changelog = "https://github.com/opencog/link-grammar/blob/link-grammar-${version}/ChangeLog";
|
|
|
|
license = licenses.lgpl21Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
link-grammar
|