guix-mirrors/gnu/packages/patches/sane-look-for-plugins-in-SANE_BACKEND_LIB_PATH.patch
Sergey Trofimov d186087f96
gnu: sane-backends-minimal: Respect backend search paths.
SANE's dynamic loading mechanism looks for configs in SANE_CONFIG_DIR,
and the libraries are expected to be either in LD_LIBRARY_PATH or in the
LIBDIR, which is set during the build to $PREFIX/lib/sane. A small patch
is necessary to make SANE respect backend search paths set by Guix.

* gnu/local.mk: Register sane-look-for-plugins-in-SANE_BACKEND_LIB_PATH.patch
* gnu/packages/scanner.scm (sane-backends-minimal): Patch dynamic
loading mechanism to look for libraries in SANE_BACKEND_LIB_PATH.

Change-Id: I132a709d171331d249acfe2fd1242dae43867ae8
2025-09-27 16:55:01 -04:00

25 lines
673 B
Diff

From 324ad2e5b5d4b08fb682fa05d5baaaf087d13f5c Mon Sep 17 00:00:00 2001
From: Sergey Trofimov <sarg@sarg.org.ru>
Date: Sat, 20 Sep 2025 18:26:44 +0200
Subject: [PATCH] Look for plugins in SANE_BACKEND_LIB_PATH.
---
backend/dll.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/backend/dll.c b/backend/dll.c
index bf34c4f6d..d52e81206 100644
--- a/backend/dll.c
+++ b/backend/dll.c
@@ -461,6 +461,8 @@ load (struct backend *be)
be->op[i] = op_unsupported;
path = getenv ("LD_LIBRARY_PATH");
+ if (!path)
+ path = getenv ("SANE_BACKEND_LIB_PATH"); /* for guix */
if (!path)
path = getenv ("SHLIB_PATH"); /* for HP-UX */
if (!path)
--
2.51.0