From patchwork Sun Apr 17 00:31:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "joaog.bastos" X-Patchwork-Id: 38612 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 0610A27BBE9; Sun, 17 Apr 2022 01:37:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0D2B827BBEA for ; Sun, 17 Apr 2022 01:37:40 +0100 (BST) Received: from localhost ([::1]:43898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfsv5-0007sr-7R for patchwork@mira.cbaines.net; Sat, 16 Apr 2022 20:37:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfsra-0006AJ-Hi for guix-patches@gnu.org; Sat, 16 Apr 2022 20:34:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nfsra-0005Pv-8Y for guix-patches@gnu.org; Sat, 16 Apr 2022 20:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nfsra-0006Mp-6A for guix-patches@gnu.org; Sat, 16 Apr 2022 20:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54978] [PATCH] gnu: Add utsushi. Resent-From: "joaog.bastos" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Apr 2022 00:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54978 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54978@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.165015562624448 (code B ref -1); Sun, 17 Apr 2022 00:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Apr 2022 00:33:46 +0000 Received: from localhost ([127.0.0.1]:34622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfsrJ-0006MG-Hh for submit@debbugs.gnu.org; Sat, 16 Apr 2022 20:33:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:57360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfspT-0006JM-BM for submit@debbugs.gnu.org; Sat, 16 Apr 2022 20:31:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfspT-00061R-3m for guix-patches@gnu.org; Sat, 16 Apr 2022 20:31:51 -0400 Received: from mail-40138.protonmail.ch ([185.70.40.138]:52267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfspO-00058g-Ja for guix-patches@gnu.org; Sat, 16 Apr 2022 20:31:50 -0400 Date: Sun, 17 Apr 2022 00:31:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=protonmail2; t=1650155496; bh=wL9e7+S+GUkoi8EmXGsJOlgxt2lAqlx5pvBQCTIudiY=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc:Date:Subject: Reply-To:Feedback-ID:Message-ID; b=YtFOCkyXTLtPsOX1Sv5ba1uiMyDMqmq+9NF+iqN2i1yU7azuPwdkzSSBWTrEH8QfS m0LPz5t/moR6aHY1pqH4zubMa9gIbrjWSF+nDcf+NaC8+pyC2vIKVjhPav5202/i/e uJ2jUn0kCatuRY5u0vpfz4xmoU7UkjF+Exl2TFieF5t4FGYA0TCQaTvhszROpVEPvn 3MktGdc2Zn80owbR/LeptmysmZkqRjpo9ENRspVmqAT+Xta2/p5AveTTlWcs0YC4x6 nEISMOeY+cvL5c6oByi10Js+YNSWC8l8kh0P+507ezTcWeA6s8nw45PvEd9TyjsETZ +gLeONwKKj9WQ== Message-ID: <3MY0ehlE7xewDwCvykTXopJOZPSg8uCNjyYTE9cjMAOiIwQINoEjvE33V-jWz7RCYj625_LHFrLkZpVpJJkUlZr3vZTr_wvDzTi792LFFTo=@protonmail.ch> MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.40.138; envelope-from=joaog.bastos@protonmail.ch; helo=mail-40138.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 16 Apr 2022 20:33:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 16 Apr 2022 20:37:15 -0400 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" Reply-to: "joaog.bastos" X-ACL-Warn: , "joaog.bastos via Guix-patches" X-Patchwork-Original-From: "joaog.bastos via Guix-patches" via From: "joaog.bastos" X-getmail-retrieved-from-mailbox: Patches Empty Message From 9743540edfd9e87b7f8fc0057f9fb5acc6bd7917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gabriel?= Date: Sat, 16 Apr 2022 18:05:44 -0300 Subject: [PATCH] gnu: Add utsushi. * gnu/packages/scanner.scm (utsushi): New variable. (sane-backends)[inputs, arguments]: Add utsushi backend. --- gnu/packages/scanner.scm | 70 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/gnu/packages/scanner.scm b/gnu/packages/scanner.scm index e7a5a2b..582b201 100644 --- a/gnu/packages/scanner.scm +++ b/gnu/packages/scanner.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Andy Patterson ;;; Copyright © 2017, 2019, 2020, 2022 Tobias Geerinckx-Rice ;;; Copyright © 2018 Efraim Flashner +;;; Copyright © 2022 João Gabriel ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ (define-module (gnu packages scanner) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages avahi) + #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gettext) @@ -31,6 +33,7 @@ (define-module (gnu packages scanner) #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages image) + #:use-module (gnu packages imagemagick) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config) @@ -203,14 +206,16 @@ (define-public sane-backends-minimal package contains the library, but no drivers.") (license license:gpl2+))) ; plus linking exception -;; This variant links in the hpaio backend provided by hplip, which adds -;; support for HP scanners whose backends are not maintained by the SANE -;; project, and builds all of those backends. +;; This variant links in the hpaio backend provided by hplip and the +;; utsushi backend, which adds support for some HP and EPSON scanners, +;; respectively, whose backends are not maintained by the SANE project, +;; and builds all of those backends. (define-public sane-backends (package/inherit sane-backends-minimal (name "sane-backends") (inputs `(("hplip" ,(@ (gnu packages cups) hplip-minimal)) + ("utsushi" ,utsushi) ("libjpeg" ,libjpeg-turbo) ; for pixma/epsonds/other back ends ("libpng" ,libpng) ; support ‘scanimage --format=png’ ("libxml2" ,libxml2) ; for pixma back end @@ -230,7 +235,8 @@ (define-public sane-backends (add-after 'unpack 'add-backends (lambda _ (substitute* "backend/dll.conf.in" - (("hp5590" all) (format #f "~a~%~a" all "hpaio"))) + (("hp5590" all) (format #f "~a~%~a" all "hpaio")) + (("v4l" all) (format #f "~a~%~a" all "utsushi"))) #t)) (add-after 'install 'install-hpaio (lambda* (#:key inputs outputs #:allow-other-keys) @@ -242,6 +248,17 @@ (define out (string-append (assoc-ref outputs "out") (lambda (file) (symlink file (string-append out "/" (basename file)))) (find-files hplip)) + #t)) + (add-after 'install-hpaio 'install-utsushi + (lambda* (#:key inputs outputs #:allow-other-keys) + (define utsushi (string-append (assoc-ref inputs "utsushi") + "/lib/utsushi/sane")) + (define out (string-append (assoc-ref outputs "out") + "/lib/sane")) + (for-each + (lambda (file) + (symlink file (string-append out "/" (basename file)))) + (find-files utsushi)) #t)))))) (synopsis "Raster image scanner library and drivers, with scanner support") @@ -393,3 +410,48 @@ (define-public xsane XSane talks to scanners through the @acronym{SANE, Scanner Access Now Easy} back-end library, which supports almost all existing scanners.") (license license:gpl2+))) + +(define-public utsushi + (let ((commit "839d06a5a80b353cb604eb9f7d352a1648ab1fdf")) + (package + (name "utsushi") + (version (git-version "0.65.0" "1" commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.com/utsushi/utsushi") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0i6ipqy61abbsmqqqy5sii0vlib146snvp975sgjmv4nzy9mwf24")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f + #:configure-flags + (list (string-append "--with-boost-libdir=" + (assoc-ref %build-inputs "boost") + "/lib") + "CXXFLAGS=-Wno-error") + #:phases + (modify-phases %standard-phases + (add-before 'bootstrap 'zap-unnecessary-git-dependency + (lambda _ + (substitute* "configure.ac" + (("-m4_esyscmd_s\\(\\[git describe --always\\]\\)") "")))) + (add-after 'install 'install-udev-rules + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/lib/udev/rules.d")) + (install-file "drivers/esci/utsushi-esci.rules" + (string-append out "/lib/udev/rules.d")))))))) + (inputs (list boost eudev sane-backends-minimal libusb + libjpeg-turbo imagemagick libtiff zlib)) + (native-inputs (list util-linux autoconf autoconf-archive automake + gettext-minimal libtool libxslt pkg-config)) + (home-page "https://gitlab.com/utsushi/utsushi") + (synopsis "Image scanning software for EPSON devices") + (description "Utsushi is a set of applications for image scanning with +support for a number of EPSON scanners, including a compatibility driver to +interface with software built around the @acronym{SANE, Scanner Access Now Easy} +standard.") + (license license:gpl3)))) -- 2.35.1