2021-05-02 12:26:58 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2022-05-15 06:35:59 +00:00
|
|
|
, flex
|
2021-05-02 12:26:58 +00:00
|
|
|
, sqlite
|
|
|
|
, libedit
|
|
|
|
, runCommand
|
|
|
|
, dieHook
|
|
|
|
}:
|
2018-09-18 19:43:34 +00:00
|
|
|
|
2021-01-20 09:24:43 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
link-grammar = stdenv.mkDerivation rec {
|
2018-09-18 19:43:34 +00:00
|
|
|
pname = "link-grammar";
|
2022-07-31 19:41:01 +00:00
|
|
|
version = "5.10.5";
|
2018-09-18 19:43:34 +00:00
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" "man" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "http://www.abisource.com/downloads/${pname}/${version}/${pname}-${version}.tar.gz";
|
2022-07-31 19:41:01 +00:00
|
|
|
sha256 = "sha256-MkcQzYEyl1/5zLU1CXMvdVhHOxwZ8XiSAAo97bhhiu0=";
|
2018-09-18 19:43:34 +00:00
|
|
|
};
|
|
|
|
|
2021-05-02 12:26:58 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
python3
|
2022-05-15 06:35:59 +00:00
|
|
|
flex
|
2021-05-02 12:26:58 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
sqlite
|
|
|
|
libedit
|
|
|
|
];
|
2018-09-18 19:43:34 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-java-bindings"
|
|
|
|
];
|
|
|
|
|
2021-01-20 09:24:43 +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-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-09-18 19:43:34 +00:00
|
|
|
description = "A Grammar Checking library";
|
2020-03-05 08:05:02 +00:00
|
|
|
homepage = "https://www.abisource.com/projects/link-grammar/";
|
2021-01-20 09:24:43 +00:00
|
|
|
changelog = "https://github.com/opencog/link-grammar/blob/link-grammar-${version}/ChangeLog";
|
|
|
|
license = licenses.lgpl21Only;
|
2018-09-18 19:43:34 +00:00
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2021-01-20 09:24:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
link-grammar
|