about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/link-grammar/default.nix
blob: b5cfdcbfc0c9c485a54f6872014cc4fec0efc529 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib, stdenv, fetchurl, pkg-config, python3, sqlite, libedit, zlib, runCommand, dieHook }:

let

link-grammar = stdenv.mkDerivation rec {
  version = "5.8.1";
  pname = "link-grammar";

  outputs = [ "bin" "out" "dev" "man" ];

  src = fetchurl {
    url = "http://www.abisource.com/downloads/${pname}/${version}/${pname}-${version}.tar.gz";
    sha256 = "sha256-EcT/VR+lFpJX2sxXUIDGOwdceQ7awpmEqUZBoJk7UFs=";
  };

  nativeBuildInputs = [ pkg-config python3 ];
  buildInputs = [ sqlite libedit zlib ];

  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; {
    description = "A Grammar Checking library";
    homepage = "https://www.abisource.com/projects/link-grammar/";
    changelog = "https://github.com/opencog/link-grammar/blob/link-grammar-${version}/ChangeLog";
    license = licenses.lgpl21Only;
    maintainers = with maintainers; [ jtojnar ];
    platforms = platforms.unix;
  };
};

in
  link-grammar