From patchwork Sun Feb 21 07:09:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Tai X-Patchwork-Id: 27177 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 3702A27BC48; Sun, 21 Feb 2021 07:11:11 +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 3150327BC49 for ; Sun, 21 Feb 2021 07:11:10 +0000 (GMT) Received: from localhost ([::1]:35504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDitZ-0002LO-9k for patchwork@mira.cbaines.net; Sun, 21 Feb 2021 02:11:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDitS-0002L1-Gc for guix-patches@gnu.org; Sun, 21 Feb 2021 02:11:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDitS-0001gp-7x for guix-patches@gnu.org; Sun, 21 Feb 2021 02:11:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDitS-0006M1-2o for guix-patches@gnu.org; Sun, 21 Feb 2021 02:11:02 -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: Sun, 21 Feb 2021 07:11:02 +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.161389141024350 (code B ref 46393); Sun, 21 Feb 2021 07:11:02 +0000 Received: (at 46393) by debbugs.gnu.org; 21 Feb 2021 07:10:10 +0000 Received: from localhost ([127.0.0.1]:53451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDisW-0006KV-Ng for submit@debbugs.gnu.org; Sun, 21 Feb 2021 02:10:10 -0500 Received: from mail-il1-f172.google.com ([209.85.166.172]:40785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDisT-0006Ju-Ew for 46393@debbugs.gnu.org; Sun, 21 Feb 2021 02:10:02 -0500 Received: by mail-il1-f172.google.com with SMTP id e7so8172176ile.7 for <46393@debbugs.gnu.org>; Sat, 20 Feb 2021 23:10:01 -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=xrFMATliBs5vlt/SgMAo/6vFwM05AAiU1CKvMDuufMQ=; b=rXqflgGwoiWvohdaBM9q1VpsA2e6osIO7AYSqKwIU39vyCcdJlhM4jKED9VAVZkYTa zmtOeNi8mpmHY2CUwCcP2wFjUYb3jZ4oF8y0fVjl0EvPZZAF5CplFk7G9fnKY03Pqf61 iedrv4ESEKo4TrmCJxPe5s1ktlAOAM2Ru6IYuKS+1AIS8vK9Lq+ScNPbNS+3vcT8MrKV Ttkq0wKZnoz/W1tDRoPYrdb0XQ/j7kqv4ZPF/2ftA3SiUhvbxhgHvIJrrD/eV65/WP7i aUx2+Wnv2qh1Zr43wp8rlEn9mXENvR6UQwXPNYzt9ZRFJiGm7UGl3UbY9+EmtkN+z40n Gp6A== 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=xrFMATliBs5vlt/SgMAo/6vFwM05AAiU1CKvMDuufMQ=; b=pL+p8ZOmRvwyqk2koRS/G/GsseEPFxjRzpJN/NSSyT0Tcu923/DXuI5ouoRghNaZs7 OWPdPGgP9ehsgGRWgpuHIVwtgmoVcSS2zRcYPXcE7JTVtedwj2OMcNR4DXmnyR1B0TJT +Gpz/OSZElcnpjnbhOTxiQ07OtrGfZ5lyjkFtDwxLt1C7pFfQIiwK1An1k2QiNsO6Qd+ WcnvHST+S5sgBlFhzCLQQ63xvegQ98UnaVcMFw1LWoQyYV9ZT+BgU5dKnkScBB8+ZhLO fXJhMSf/xP6BjsGHuq/UkhwFzhfcAvIBPGDgAtBx5pi6R4WvX+td6j3MLxAjccglZYlx HgKQ== X-Gm-Message-State: AOAM530eHCFSJzzS7XtbcUnRUNc0ryHp/ifQZfqZ6LzZIdvV+GWIeNg8 NB3B+oJzJdzR96oUqt2e5End7gWe18plF8hM3FQ= X-Google-Smtp-Source: ABdhPJx8HCJRTjz08noTszJ305PNx+FVtn8thQjwXNjgqwZPxJNhG/JmYpHv7ZCbnns1wJE+2MQkiHxem6RJ6kSh13U= X-Received: by 2002:a05:6e02:13cb:: with SMTP id v11mr1795761ilj.105.1613891395921; Sat, 20 Feb 2021 23:09:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andy Tai Date: Sat, 20 Feb 2021 23:09:19 -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 On Sat, Feb 20, 2021 at 4:34 PM Leo Famulari wrote: > > * gnu/packages/gnome.scm (ocrfeeder): New variable > > * gnu/packages/python-xyz.scm (python-sane): New variable > > In general, we add packages one commit at a time, so we prefer to > receive this as two patches. First, a patch that adds python-sane, and > then a second patch adding ocrfeeder. > Thus this bug now depends on the separate python-sane patch https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46675 Not sure if GNU Debbugs has a way to show dependency > > + (synopsis "A Complete OCR Suite") > > I would write, simply, "Complete OCR Suite". For some reason, the linter > doesn't complain for me, but it should recommend against starting > synopses with an article. That is, with "a", "an", or "the". > changed as suggested > https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.html > > > + (description "OCRFeeder is a complete Optical Character > > Recognition and Document Analysis and Recognition program") > > And make sure to end the sentence with a period "." > > added 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