Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Building sane-backends

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
plasticassius
Posts: 5
Joined: 2021-03-09 23:20

Building sane-backends

#1 Post by plasticassius »

Hello, I am trying to use a CanoScan LiDE 300, and it is not supported in version 1.0.27 of sane-backends, so I am trying to build version debian/1.0.29-1_experimental4.

I followed the make instructions:

Code: Select all

git clone https://jff.email/cgit/sane-backends.git
git checkout debian/1.0.29-1_experimental4
./autogen.sh
./configure
make
...
make[2]: Entering directory '/mnt/hdd/zaloh/make/sane/sane-backends/backend'
/bin/bash ../libtool --silent  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include/sane  -D_REENTRANT -DPATH_SANE_CONFIG_DIR=/usr/local/etc/sane.d 	  -DPATH_SANE_DATA_DIR=/usr/local/share 	  -DPATH_SANE_LOCK_DIR=/usr/local/var/lock/sane 	  -DV_MAJOR=debian/1 -DV_MINOR=0 -I. -I. -I../include -I../include -I/usr/include/libusb-1.0 -DLIBDIR="\"/usr/local/lib/sane\"" -DBACKEND_NAME=dll -DENABLE_PRELOAD  -Wall -Wextra -pedantic -g -O2 -MT libdll_preload_la-dll.lo -MD -MP -MF .deps/libdll_preload_la-dll.Tpo -c -o libdll_preload_la-dll.lo `test -f 'dll.c' || echo './'`dll.c
dll.c: In function ‘load’:
<command-line>: error: ‘debian’ undeclared (first use in this function)
dll.c:503:18: note: in expansion of macro ‘V_MAJOR’
   dir, be->name, V_MAJOR);
                  ^~~~~~~
<command-line>: note: each undeclared identifier is reported only once for each function it appears in
dll.c:503:18: note: in expansion of macro ‘V_MAJOR’
   dir, be->name, V_MAJOR);
                  ^~~~~~~
In file included from dll.c:135:
dll.c: In function ‘sane_dll_init’:
./../include/sane/config.h:504:26: error: ‘debian’ undeclared (first use in this function)
 #define SANE_DLL_V_MAJOR debian/1
                          ^~~~~~
../include/sane/sane.h:31:21: note: in definition of macro ‘SANE_VERSION_CODE’
   (  (((SANE_Word) (major) &   0xff) << 24) \
                     ^~~~~
dll.c:926:40: note: in expansion of macro ‘SANE_DLL_V_MAJOR’
     *version_code = SANE_VERSION_CODE (SANE_DLL_V_MAJOR, SANE_DLL_V_MINOR,
                                        ^~~~~~~~~~~~~~~~
make[2]: *** [Makefile:4542: libdll_preload_la-dll.lo] Error 1
make[2]: Leaving directory '/mnt/hdd/zaloh/make/sane/sane-backends/backend'
make[1]: *** [Makefile:3275: all] Error 2
make[1]: Leaving directory '/mnt/hdd/zaloh/make/sane/sane-backends/backend'
make: *** [Makefile:597: all-recursive] Error 1
Apparently there is a symbol "debian" that is not defined. How do I define it?

I've tried this also for version debian/1.0.31-4 and have the same problem.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Building sane-backends

#2 Post by stevepusser »

I can see the Bullseye version has quite a few patches, which you are skipping by not using the Debian package build system:

Code: Select all

0035-trim-libraries-in-sane-backends.pc.in.patch
0040-remove_git.patch
0100-source_spelling.patch
0125-multiarch_dll_search_path.patch
0140-avahi.patch
0145-avahi.patch
0600-scanimage_manpage.patch
0705-kfreebsd.patch
0725-fix_link_60-libsane_rule.patch
0150-i386-test.patch
0155-hurd_PATH_MAX.patch
0045-disable_lock_test_at_build_time.patch
0050-Use-python3-shebang.patch
0055-Fix_build_error.patch
0060-cross.patch
0165-respect_local_only_parameter.patch
0170-return_empty_list_when_local_devices_requested.patch
The first thing to try is a backport instead of a manual build and install. https://wiki.debian.org/SimpleBackportCreation
MX Linux packager and developer

plasticassius
Posts: 5
Joined: 2021-03-09 23:20

Re: Building sane-backends

#3 Post by plasticassius »

I checked for several patches in the working directory after I ran

Code: Select all

./autogen.sh
./configure
and they were definitely applied.

But no matter, I will try backport creation. Thanks for the tip.

plasticassius
Posts: 5
Joined: 2021-03-09 23:20

Re: Building sane-backends

#4 Post by plasticassius »

I tried to follow https://wiki.debian.org/SimpleBackportCreation but got stuck on the build step:

Code: Select all

$sudo mk-build-deps --install --remove
dh_testdir
dh_testroot
dh_prep
dh_testdir
dh_testroot
dh_install
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package 'sane-backends-build-deps' in '../sane-backends-build-deps_1.0.31-4_amd64.deb'.

The package has been created.
Attention, the package has been created in the current directory,
not in ".." as indicated by the message above!
Selecting previously unselected package sane-backends-build-deps.
(Reading database ... 378574 files and directories currently installed.)
Preparing to unpack sane-backends-build-deps_1.0.31-4_amd64.deb ...
Unpacking sane-backends-build-deps (1.0.31-4) ...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies...Starting pkgProblemResolver with broken count: 1
Starting 2 pkgProblemResolver with broken count: 1
Investigating (0) sane-backends-build-deps:amd64 < 1.0.31-4 @iU mK Nb Ib >
Broken sane-backends-build-deps:amd64 Depends on debhelper-compat:amd64 < none @un H > (= 13)
  Considering debhelper:amd64 14 as a solution to sane-backends-build-deps:amd64 -2
  Removing sane-backends-build-deps:amd64 rather than change debhelper-compat:amd64
Done
 Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages will be REMOVED:
  sane-backends-build-deps
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 9,216 B disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 378578 files and directories currently installed.)
Removing sane-backends-build-deps (1.0.31-4) ...
mk-build-deps: Unable to install sane-backends-build-deps at /usr/bin/mk-build-deps line 416.
mk-build-deps: Unable to install all build-dep packages
Apparently I need the package debhelper, but I can't install it:

Code: Select all

$sudo apt install debhelper
Reading package lists... Done
Building dependency tree       
Reading state information... Done
debhelper is already the newest version (12.1.1).
debhelper set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 sane-backends-build-deps : Depends: chrpath
                            Depends: debhelper-compat (= 13)
                            Depends: libavahi-client-dev but it is not going to be installed
                            Depends: libcups2-dev but it is not going to be installed
                            Depends: libcurl4-gnutls-dev but it is not going to be installed
                            Depends: libgphoto2-dev but it is not going to be installed
                            Depends: libieee1284-3-dev but it is not going to be installed
                            Depends: libpoppler-glib-dev but it is not going to be installed
                            Depends: libsnmp-dev but it is not going to be installed
                            Depends: libsystemd-dev but it is not going to be installed
                            Depends: xutils-dev
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
$sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  sane-backends-build-deps
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 9,216 B disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 378578 files and directories currently installed.)
Removing sane-backends-build-deps (1.0.31-4) ...
Is there a straightforward way to resolve this? Or would I need to build a lot of dependencies from source?

Thanks in advance.

plasticassius
Posts: 5
Joined: 2021-03-09 23:20

Re: Building sane-backends

#5 Post by plasticassius »

Ok, I was able to install debhelper:

Code: Select all

sudo apt install debhelper/buster-backports
mk-build-deps is now successful.

plasticassius
Posts: 5
Joined: 2021-03-09 23:20

Re: Building sane-backends

#6 Post by plasticassius »

I got the rest to build, and it works great. Thanks!

Post Reply