about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/gocr/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/graphics/gocr/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/graphics/gocr/default.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/graphics/gocr/default.nix b/nixpkgs/pkgs/applications/graphics/gocr/default.nix
new file mode 100644
index 000000000000..7c586374ec51
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gocr/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, tk }:
+
+stdenv.mkDerivation rec {
+  name = "gocr-0.52";
+
+  src = fetchurl {
+    url = "https://www-e.uni-magdeburg.de/jschulen/ocr/${name}.tar.gz";
+    sha256 = "11l6gds1lrm8lwrrsxnm5fjlwz8q1xbh896cprrl4psz21in946z";
+  };
+
+  buildFlags = [ "all" "libs" ];
+  installFlags = [ "libdir=/lib/" ]; # Specify libdir so Makefile will also install library.
+
+  preInstall = "mkdir -p $out/lib";
+
+  postInstall = ''
+    for i in pgm2asc.h gocr.h; do
+      install -D -m644 src/$i $out/include/gocr/$i
+    done
+  '';
+
+  preFixup = ''
+    sed -i -e 's|exec wish|exec ${tk}/bin/wish|' $out/bin/gocr.tcl
+  '';
+
+  meta = {
+    homepage = "http://jocr.sourceforge.net/";
+    description = "GPL Optical Character Recognition";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}