Subject: simple-scan can't use hpaio
From: Danny Milosavljevic <[email-masked]>
To: <[email-masked]>
Date: Sat, 3 Dec 2016 19:41:13 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

simple-scan can't use hpaio as scanner. That means that HP scanners don't work at all.

That's because:

(1) sane-backends installs a hard-coded dll.conf . In itself, that's not so bad. However, this file doesn't contain a line "hpaio". 
    To workaround this, I set environment variable SANE_CONFIG_DIR to point to a directory which contains a dll.conf which contains (only) a line "hpaio".
(2) sane-backends tries to load /gnu/store/f4kmkdf8s0kpwia9wgiw5a35xljh4a77-sane-backends-1.0.25/lib/sane/libsane-hpaio.so.1 - which won't work. 
    I checked the source code of sane-backends - and it searches many locations for loadable dynamic libraries, for example the ones specified in environment variables LD_LIBRARY_PATH, SHLIB_PATH LIBPATH (see backend/dll.c load()). 
(3) dll.conf has no support for absolute paths. Whatever you put there it will just blindly put after a hard-coded directory prefix.

This is on GuixSD.

How to proceed? Add support for absolute paths and a service which merges multiple dll.conf into one file ?

Or just add hplip as a hard dependency of sane-backends and make it link libsane-hpaio (that's possible in sane)?

Also, should we also amend simple-scan to propagate-input hplip? Otherwise it will come up with a "Install Driver" dialog which won't work either.