GNU bug report logs - #78732
[PATCH] gnu: simple-scan: enable scanning over network for eSCL/WSD scanners

Previous Next

Package: guix-patches;

Reported by: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>

Date: Mon, 9 Jun 2025 13:23:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 78732 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, noelopez <at> free.fr, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#78732; Package guix-patches. (Mon, 09 Jun 2025 13:23:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rostislav Svoboda <rostislav.svoboda <at> gmail.com>:
New bug report received and forwarded. Copy sent to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, noelopez <at> free.fr, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org. (Mon, 09 Jun 2025 13:23:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>
To: guix-patches <at> gnu.org,
	38929 <at> debbugs.gnu.org
Cc: Rostislav Svoboda <Rostislav.Svoboda <at> gmail.com>
Subject: [PATCH] gnu: simple-scan: enable scanning over network for eSCL/WSD
 scanners
Date: Mon,  9 Jun 2025 15:21:03 +0200
* gnu/packages/gnome.scm (simple-scan)[inputs]: Add sane-airscan.
<#:phases>: Wrap simple-scan to set
  - LD_LIBRARY_PATH to sane-airscan's lib/sane
  - SANE_CONFIG_DIR to sane-airscan's etc/sane.d

This change allows simple-scan to automatically detect and use eSCL or WSD
(AirScan) backends over the network.

Change-Id: Id1d95c77c3fc549b7baf91d31049541a687bce2d
---
 gnu/packages/gnome.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 56236013a7..3bc26192ff 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -7330,7 +7330,19 @@ (define-public simple-scan
         (base32 "1aghnkvjdyj73kv55nd9gl5b1xjkpcxjn4j3a6z67r9g2j86avn1"))))
     (build-system meson-build-system)
     (arguments
-     '(#:glib-or-gtk? #t))
+     (list
+      #:glib-or-gtk? #t
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'install 'wrap-flatpak
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((simple-scan (string-append #$output "/bin/simple-scan"))
+                    (sane-airscan-inputs (assoc-ref inputs "sane-airscan")))
+                (wrap-program simple-scan
+                  `("LD_LIBRARY_PATH" =
+                    (,(string-append sane-airscan-inputs "/lib/sane")))
+                  `("SANE_CONFIG_DIR" prefix
+                    (,(string-append sane-airscan-inputs "/etc/sane.d"))))))))))
     (native-inputs
      (list gettext-minimal
            itstool
@@ -7347,6 +7359,7 @@ (define-public simple-scan
            gdk-pixbuf
            gusb
            libadwaita
+           sane-airscan
            sane-backends))
     (home-page "https://gitlab.gnome.org/GNOME/simple-scan")
     (synopsis "Document and image scanner")

base-commit: 03ce76718c41b32d174713c945d269d6fcdd8bf1
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78732; Package guix-patches. (Mon, 09 Jun 2025 18:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 78732 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>, 78732 <at> debbugs.gnu.org, 
 38929 <at> debbugs.gnu.org
Cc: Noé Lopez <noelopez <at> free.fr>,
 Vivien Kraus <vivien <at> planete-kraus.eu>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#78732] [PATCH] gnu: simple-scan: enable scanning over
 network for eSCL/WSD scanners
Date: Mon, 09 Jun 2025 20:34:02 +0200
Am Montag, dem 09.06.2025 um 15:21 +0200 schrieb Rostislav Svoboda:
> * gnu/packages/gnome.scm (simple-scan)[inputs]: Add sane-airscan.
> <#:phases>: Wrap simple-scan to set
>   - LD_LIBRARY_PATH to sane-airscan's lib/sane
>   - SANE_CONFIG_DIR to sane-airscan's etc/sane.d
> 
> This change allows simple-scan to automatically detect and use eSCL
> or WSD (AirScan) backends over the network.
> 
> Change-Id: Id1d95c77c3fc549b7baf91d31049541a687bce2d
The LD_LIBRARY_PATH looks suspicious.  Is there any way around it using
other SANE tooling?

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#78732; Package guix-patches. (Mon, 09 Jun 2025 19:39:03 GMT) Full text and rfc822 format available.

Message #11 received at 78732 <at> debbugs.gnu.org (full text, mbox):

From: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: Vivien Kraus <vivien <at> planete-kraus.eu>, 38929 <at> debbugs.gnu.org,
 78732 <at> debbugs.gnu.org, Noé Lopez <noelopez <at> free.fr>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#78732] [PATCH] gnu: simple-scan: enable scanning over
 network for eSCL/WSD scanners
Date: Mon, 9 Jun 2025 21:38:10 +0200
[Message part 1 (text/plain, inline)]
Hello

> The LD_LIBRARY_PATH looks suspicious.

What exactly is suspicious?

>  Is there any way around it using other SANE tooling?

AFAIK there's no simpler runtime-only solution:
- You could use patchelf to prepend the store's lib/sane directory
onto the binary's RPATH, but that's as even even more fiddly as
setting LD_LIBRARY_PATH
- sane-config only spits out compile-time flags (-I..., -L...,
-lsane); it doesn't tell the loader where to find backends at runtime.

BTW, I've polished the patch. Please ignore the previous one - the
phase name was wrong ("wrap-flatpak" instead of "wrap-simple-scan").


Cheers
[0001-gnu-simple-scan-enable-scanning-over-network-for-eSC.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#78732; Package guix-patches. (Thu, 12 Jun 2025 11:05:02 GMT) Full text and rfc822 format available.

Message #14 received at 78732 <at> debbugs.gnu.org (full text, mbox):

From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>
Cc: Vivien Kraus <vivien <at> planete-kraus.eu>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>, 38929 <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>, 78732 <at> debbugs.gnu.org,
 Noé Lopez <noelopez <at> free.fr>
Subject: Re: [bug#78732] [PATCH] gnu: simple-scan: enable scanning over
 network for eSCL/WSD scanners
Date: Thu, 12 Jun 2025 13:04:02 +0200
Hi,

Rostislav Svoboda <rostislav.svoboda <at> gmail.com> writes:

> Hello
>
>> The LD_LIBRARY_PATH looks suspicious.
>
> What exactly is suspicious?
>
>>  Is there any way around it using other SANE tooling?
>
> AFAIK there's no simpler runtime-only solution:
> - You could use patchelf to prepend the store's lib/sane directory
> onto the binary's RPATH, but that's as even even more fiddly as
> setting LD_LIBRARY_PATH
> - sane-config only spits out compile-time flags (-I..., -L...,
> -lsane); it doesn't tell the loader where to find backends at runtime.
>

I've proposed another solution on codeberg, please take a look
https://codeberg.org/guix/guix/pulls/541




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.