From patchwork Wed Feb 24 01:59:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Tai X-Patchwork-Id: 27229 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4338427BC4A; Wed, 24 Feb 2021 02:01:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0F30327BC4B for ; Wed, 24 Feb 2021 02:01:22 +0000 (GMT) Received: from localhost ([::1]:35658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEjUP-00089j-4T for patchwork@mira.cbaines.net; Tue, 23 Feb 2021 21:01:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEjUA-00089P-1B for guix-patches@gnu.org; Tue, 23 Feb 2021 21:01:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEjU6-00016v-0o for guix-patches@gnu.org; Tue, 23 Feb 2021 21:01:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lEjU5-0007jo-UT for guix-patches@gnu.org; Tue, 23 Feb 2021 21:01:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46393] [PATCH] gnu: Add ocrfeeder Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Feb 2021 02:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46393 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo Famulari Cc: 46393@debbugs.gnu.org Received: via spool by 46393-submit@debbugs.gnu.org id=B46393.161413204629712 (code B ref 46393); Wed, 24 Feb 2021 02:01:01 +0000 Received: (at 46393) by debbugs.gnu.org; 24 Feb 2021 02:00:46 +0000 Received: from localhost ([127.0.0.1]:32875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEjTl-0007j2-PS for submit@debbugs.gnu.org; Tue, 23 Feb 2021 21:00:46 -0500 Received: from mail-il1-f173.google.com ([209.85.166.173]:37396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEjTk-0007io-DF for 46393@debbugs.gnu.org; Tue, 23 Feb 2021 21:00:41 -0500 Received: by mail-il1-f173.google.com with SMTP id k2so364779ili.4 for <46393@debbugs.gnu.org>; Tue, 23 Feb 2021 18:00:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atai-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5gzQDrKjSvfATWoXqqUUQU42vz5n1Vzs/YnWH+ZcBog=; b=SuQ5x3BFW5UyedkgBd+6bDJJ4iCC1nhoNL8sJKkgDrb9/EBSJ43pHBW1hiwFawqkg4 CuBJUdAxi4rWXZrmcpsaQE2czd7HEVSOs4Uqw2G/pju0CPzg7orqeG5ucoBGUDBdyMRW m9SWF8ZzFwg1M32jOmOvpsLEDx09J5AppftXZi87ucKYLBTKyynMi6h9goiPmufJCmA2 422/AeW8+XAwMCXuq7dhdXGkcRffmVay0qGaUyivlqCCzNUFbHqiPEIHXqSmvrXFJ2TM aGxuOaNTZzgQprAWbiI3tL+MFSdYafaTVyEcSuFqCqAViZI/kIMZFLy6rHkoTEjWdIk+ iyyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5gzQDrKjSvfATWoXqqUUQU42vz5n1Vzs/YnWH+ZcBog=; b=heQKE7UNK3Ezb7d0OLOrM2WY8eBpwQ9Cmxu3JcxoYPipusjE/iS4VsLwy9C6mvwEJa p4KZHKKaKgy4NqOSJbgIiLajUgYKhDBfwofn0XOvJwdwitfDOumGRtuL1J/L7yNiRu2W DdRvbi5Dnvybzd36Y0ZU0JV02V3a5d6GsZopIOK1FgA+g8lztpDCd+vkdnFmJfAL2npH yMckmNqP4jQEb5cjCde+JOtjo0uHarB2Zi9S+kMYT0pn6Oa6uiyotIH3zfHtJ/KhC15y LuvTiP7UiQ0tcm7BwP+QjCYQ/VolrpIAsnS3i9fmtWrNgglXXRMBr5yj/3RsH1w87kPB B4cw== X-Gm-Message-State: AOAM530GmjlZLQA9oxu9C58kfu87XFFKnCVGPMcWPiFh9AqSm065bc5D ZomFmCvkvwNmrX3JbY/ayI/z4U62HmWIRqNsJ2/0HPFVXyY= X-Google-Smtp-Source: ABdhPJyAKlovCanlLNM2+VXYATwpbeIm61zhmjMp+yaUJ0Srabah3+NkL0vhnpVIAJSYXPEIapaJOwWtC+1NLqoScm4= X-Received: by 2002:a92:290e:: with SMTP id l14mr1400333ilg.36.1614132034713; Tue, 23 Feb 2021 18:00:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andy Tai Date: Tue, 23 Feb 2021 17:59:58 -0800 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches as attached > On Tue, Feb 23, 2021 at 12:06 PM Leo Famulari wrote: > > Can you send a revised patch? From ee945305828750c4bf6e1ee010444d705eb9334b Mon Sep 17 00:00:00 2001 From: Andy Tai Date: Sat, 20 Feb 2021 22:58:07 -0800 Subject: [PATCH] gnu: Add ocrfeeder * gnu/packages/gnome.scm (ocrfeeder): New variable --- gnu/packages/gnome.scm | 67 ++++++++++++++++++++++++++++++++++++- gnu/packages/ocr.scm | 32 +++++++++--------- gnu/packages/python-xyz.scm | 24 +++++++++++++ 3 files changed, 106 insertions(+), 17 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 0b46e2719b..b1defb7208 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -56,7 +56,7 @@ ;;; Copyright © 2020 Arun Isaac ;;; Copyright © 2020 Michael Rohleder ;;; Copyright © 2020 Tim Gesthuizen -;;; Copyright © 2020 Andy Tai +;;; Copyright © 2020, 2021 Andy Tai ;;; ;;; This file is part of GNU Guix. ;;; @@ -149,6 +149,7 @@ #:use-module (gnu packages ninja) #:use-module (gnu packages node) #:use-module (gnu packages nss) + #:use-module (gnu packages ocr) #:use-module (gnu packages openldap) #:use-module (gnu packages package-management) #:use-module (gnu packages password-utils) @@ -12095,3 +12096,67 @@ for the GNOME 3.x platform with many features. It aims to be a very complete editing environment for translation issues within the GNU gettext/GNOME desktop world.") (license license:gpl3+))) + + +(define-public ocrfeeder + (package + (name "ocrfeeder") + (version "0.8.3") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/ocrfeeder/" + (version-major+minor version) "/" + "ocrfeeder-" version ".tar.xz")) + (sha256 + (base32 + "12f5gnq92ffnd5zaj04df7jrnsdz1zn4zcgpbf5p9qnd21i2y529")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after + 'install 'wrap-program + (lambda* (#:key outputs #:allow-other-keys) + (let ((prog (string-append (assoc-ref outputs "out") + "/bin/" "ocrfeeder")) + (pylib (string-append (assoc-ref outputs "out") + "/lib/python" + ,(version-major+minor + (package-version python)) + "/site-packages"))) + (wrap-program prog + `("PYTHONPATH" = (,(getenv "PYTHONPATH") ,pylib)) + `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))) + #t)))))) + (native-inputs + `(("glib:bin" ,glib "bin") ; for glib-compile-resources + ("gobject-introspection" ,gobject-introspection) + ("gtk+:bin" ,gtk+ "bin") ; for gtk-update-icon-cache + ("intltool" ,intltool) + ("itstool" ,itstool) + ("pkg-config" ,pkg-config) + ("xmllint" ,libxml2))) + (inputs + `(("enchant" ,enchant) + ("glib" ,glib) + ("goocanvas" ,goocanvas) + ("gtk" ,gtk+) + ("gtkspell3" ,gtkspell3) + ("libjpeg" ,libjpeg-turbo) + ("libtiff" ,libtiff) + ("libraw" ,libraw) + ("ocrad" ,ocrad) + ("python" ,python-wrapper) + ("python-pygobject" ,python-pygobject) + ("python-odfpy" ,python-odfpy) + ("python-pillow" ,python-pillow) + ("python-pyenchant" ,python-pyenchant) + ("python-reportlab" ,python-reportlab) + ("python-sane" ,python-sane) + ("sane-backends" ,sane-backends) + ("tesseract-ocr" ,tesseract-ocr))) + (home-page "https://wiki.gnome.org/Apps/OCRFeeder") + (synopsis "Complete OCR Suite") + (description "OCRFeeder is a complete Optical Character Recognition and +Document Analysis and Recognition program.") + (license license:gpl3+))) diff --git a/gnu/packages/ocr.scm b/gnu/packages/ocr.scm index c4e965941a..0b46f979ce 100644 --- a/gnu/packages/ocr.scm +++ b/gnu/packages/ocr.scm @@ -67,21 +67,21 @@ it produces text in 8-bit or UTF-8 formats.") ;; There are useful commits beyond the last official stable release. (let ((commit "97079fa353557af6df86fd20b5d2e0dff5d8d5df") (revision "1")) - (package - (name "tesseract-ocr") + (package + (name "tesseract-ocr") (version (git-version "4.1.1" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/tesseract-ocr/tesseract") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tesseract-ocr/tesseract") (commit commit))) (file-name (git-file-name name version)) - (sha256 + (sha256 (base32 "11137a4aaay7qp64vdjd83hz1l089nzi5a0ql0qgk8gn79pyhi98")))) - (build-system gnu-build-system) - (inputs + (build-system gnu-build-system) + (inputs `(("cairo" ,cairo) ("icu" ,icu4c) ("leptonica" ,leptonica) @@ -98,9 +98,9 @@ it produces text in 8-bit or UTF-8 formats.") ("libtiff" ,libtiff) ("pkg-config" ,pkg-config) ("xsltproc" ,libxslt))) - (arguments + (arguments `(#:configure-flags - (let ((leptonica (assoc-ref %build-inputs "leptonica"))) + (let ((leptonica (assoc-ref %build-inputs "leptonica"))) (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include"))) #:tests? #f ; Tests currently result in a segfault #:phases @@ -120,10 +120,10 @@ it produces text in 8-bit or UTF-8 formats.") (add-after 'build-training 'install-training (lambda _ (invoke "make" "training-install")))))) - (home-page "https://github.com/tesseract-ocr/tesseract") - (synopsis "Optical character recognition engine") - (description - "Tesseract is an optical character recognition (OCR) engine with very + (home-page "https://github.com/tesseract-ocr/tesseract") + (synopsis "Optical character recognition engine") + (description + "Tesseract is an optical character recognition (OCR) engine with very high accuracy. It supports many languages, output text formatting, hOCR positional information and page layout analysis. Several image formats are supported through the Leptonica library. It can also detect whether text is diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index b26fce72a9..1fb9ff60b4 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -180,6 +180,7 @@ #:use-module (gnu packages readline) #:use-module (gnu packages sdl) #:use-module (gnu packages search) + #:use-module (gnu packages scanner) #:use-module (gnu packages shells) #:use-module (gnu packages sphinx) #:use-module (gnu packages ssh) @@ -23906,3 +23907,26 @@ Application Programming Interface based on the Open Inventor 2.1 API.") Crayons automatically wraps a given string in the foreground color and restores the original state after the string is printed.") (license license:expat))) + +(define-public python-sane + (package + (name "python-sane") + (version "2.9.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri name version)) + (sha256 + (base32 + "1pi597z94n2mkd821ln52fq0g727n2jxfskf280ip3kf7jw8w294")))) + (build-system python-build-system) + (native-inputs + `(("python-pytest" ,python-pytest))) + (inputs + `(("sane-backends" ,sane-backends))) + (home-page "https://github.com/python-pillow/Sane") + (synopsis "Python interface to the SANE scanner") + (description "This package provides Python interface to the SANE scanner and +frame grabber interface for Linux.") + ;; MIT license; FSF directory refers to this as expat licene + (license license:expat))) -- 2.30.0