about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/link-grammar/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/text/link-grammar/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/text/link-grammar/default.nix37
1 files changed, 29 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/tools/text/link-grammar/default.nix b/nixpkgs/pkgs/tools/text/link-grammar/default.nix
index 25a5d129c81b..b5cfdcbfc0c9 100644
--- a/nixpkgs/pkgs/tools/text/link-grammar/default.nix
+++ b/nixpkgs/pkgs/tools/text/link-grammar/default.nix
@@ -1,28 +1,49 @@
-{ stdenv, fetchurl, pkgconfig, python3, sqlite, libedit, zlib }:
+{ lib, stdenv, fetchurl, pkg-config, python3, sqlite, libedit, zlib, runCommand, dieHook }:
 
-stdenv.mkDerivation rec {
-  version = "5.8.0";
+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 = "1v8ngx77nachxln68xpvyw2lh7z59pzsi99h8j0mnrm0gjsacrdd";
+    sha256 = "sha256-EcT/VR+lFpJX2sxXUIDGOwdceQ7awpmEqUZBoJk7UFs=";
   };
 
-  nativeBuildInputs = [ pkgconfig python3 ];
+  nativeBuildInputs = [ pkg-config python3 ];
   buildInputs = [ sqlite libedit zlib ];
 
   configureFlags = [
     "--disable-java-bindings"
   ];
 
-  meta = with stdenv.lib; {
+  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/";
-    license = licenses.lgpl21;
+    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