Browse Source

sane-backends: update to 1.0.29

- Migrate libusb dependency back to libsane
  (virtually all useful backends for OpenWrt would need it anyway)
- Disabled new usb-record-replay feature (avoid libxml2 dep)
- Disabled new escl backend (network-only backend are not too useful
  for OpenWrt and it requires libcurl, libnetsnmp, libavahi and libxml2)
- Workaround sane-daemon/postinst installation on Imagebuild
- Enabled backends kvs40xx and mustek_usb2 (fixed upstream)
- Fix bigendian compilation
  (https://gitlab.com/sane-project/backends/-/merge_requests/329)
- Fix missing std::round() for uclibc
  (https://gitlab.com/sane-project/backends/issues/237)
- Fixes FS#2685: coldplug was running before usblp was loaded. Now
  it grants access do usblp when a device using it is plugged.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
lilik-openwrt-22.03
Luiz Angelo Daros de Luca 5 years ago
parent
commit
0a85579e45
5 changed files with 70 additions and 26 deletions
  1. +16
    -10
      utils/sane-backends/Makefile
  2. +14
    -13
      utils/sane-backends/files/saned.hotplug
  3. +3
    -3
      utils/sane-backends/patches/002-remove-uneeded.patch
  4. +21
    -0
      utils/sane-backends/patches/100-fix-bigendian.patch
  5. +16
    -0
      utils/sane-backends/patches/101-fix_uclibc_std_rand.patch

+ 16
- 10
utils/sane-backends/Makefile View File

@ -1,6 +1,6 @@
# #
# Copyright (C) 2006-2016 OpenWrt.org # Copyright (C) 2006-2016 OpenWrt.org
# Copyright (C) 2017-2019 Luiz Angelo Daros de Luca <luizluca@gmail.com>
# Copyright (C) 2017-2020 Luiz Angelo Daros de Luca <luizluca@gmail.com>
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -9,11 +9,11 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=sane-backends PKG_NAME:=sane-backends
PKG_VERSION:=1.0.28
PKG_RELEASE:=2
PKG_VERSION:=1.0.29
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://gitlab.com/sane-project/backends/uploads/9e718daff347826f4cfe21126c8d5091/
PKG_HASH:=31260f3f72d82ac1661c62c5a4468410b89fb2b4a811dabbfcc0350c1346de03
PKG_SOURCE_URL:=https://gitlab.com/sane-project/backends/uploads/54f858b20a364fc35d820df935a86478
PKG_HASH:=aa027b4e5f59849cd41b8c26d54584cf31fffd986049019be6ad4140e11ea8ed
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com> PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
PKG_LICENSE:=GPL-2.0 GPL-2.0-or-later PKG_LICENSE:=GPL-2.0 GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING LICENSE PKG_LICENSE_FILES:=COPYING LICENSE
@ -136,13 +136,19 @@ endef
# Run hotplug to grant access to existing scanners # Run hotplug to grant access to existing scanners
define Package/sane-daemon/postinst define Package/sane-daemon/postinst
#!/bin/sh #!/bin/sh
udevtrigger
# We only need udevtrigger to have the magic work without
# rebooting on a real system. In ImageBuilder or
# the like, the boot process will call udevtrigger.
if [ -z "$${IPKG_INSTROOT}" ]; then
udevtrigger
fi
endef endef
define Package/libsane define Package/libsane
$(call Package/sane-backends/Default) $(call Package/sane-backends/Default)
SECTION:=libs SECTION:=libs
CATEGORY:=Libraries CATEGORY:=Libraries
DEPENDS+=+libusb-1.0
TITLE+= (libraries) TITLE+= (libraries)
endef endef
@ -171,6 +177,7 @@ CONFIGURE_ARGS+= \
--without-snmp \ --without-snmp \
--disable-avahi \ --disable-avahi \
--disable-locking \ --disable-locking \
--without-usb-record-replay \
# ./configure does not even try to detect mmap if crosscompiling # ./configure does not even try to detect mmap if crosscompiling
CONFIGURE_VARS+= \ CONFIGURE_VARS+= \
@ -314,6 +321,7 @@ $(eval $(call SaneBackend,epjitsu,Epson-based Fujitsu USB scanners,+libusb-1.0))
$(eval $(call SaneBackend,epson,EPSON scanners,+libusb-1.0)) $(eval $(call SaneBackend,epson,EPSON scanners,+libusb-1.0))
$(eval $(call SaneBackend,epsonds,EPSON scanners,+libjpeg +libusb-1.0)) #### $(eval $(call SaneBackend,epsonds,EPSON scanners,+libjpeg +libusb-1.0)) ####
$(eval $(call SaneBackend,epson2,EPSON scanners,+libusb-1.0)) $(eval $(call SaneBackend,epson2,EPSON scanners,+libusb-1.0))
#$(eval $(call SaneBackend,escl,AirScan/eSCL devices,+libcurl +libxml2 +libnetsnmp +libavahi))
$(eval $(call SaneBackend,fujitsu,Fujitsu flatbed and ADF scanners,+libusb-1.0)) $(eval $(call SaneBackend,fujitsu,Fujitsu flatbed and ADF scanners,+libusb-1.0))
$(eval $(call SaneBackend,genesys,GL646 GL841 GL843 GL847 and GL124 based USB flatbed scanners,+libstdcpp +libusb-1.0)) $(eval $(call SaneBackend,genesys,GL646 GL841 GL843 GL847 and GL124 based USB flatbed scanners,+libstdcpp +libusb-1.0))
$(eval $(call SaneBackend,gphoto2,digital cameras supported by gphoto2,+libjpeg +libgphoto2)) $(eval $(call SaneBackend,gphoto2,digital cameras supported by gphoto2,+libjpeg +libgphoto2))
@ -333,8 +341,7 @@ $(eval $(call SaneBackend,kodak,big Kodak flatbed and ADF scanners,+libusb-1.0))
$(eval $(call SaneBackend,kodakaio,Kodak aio printer / scanners,+libusb-1.0)) $(eval $(call SaneBackend,kodakaio,Kodak aio printer / scanners,+libusb-1.0))
$(eval $(call SaneBackend,kvs1025,Panasonic KV-S102xC USB ADF scanners,+libusb-1.0)) $(eval $(call SaneBackend,kvs1025,Panasonic KV-S102xC USB ADF scanners,+libusb-1.0))
$(eval $(call SaneBackend,kvs20xx,Panasonic KV-S20xxC USB/SCSI ADF scanners,+libusb-1.0)) $(eval $(call SaneBackend,kvs20xx,Panasonic KV-S20xxC USB/SCSI ADF scanners,+libusb-1.0))
# https://gitlab.com/sane-project/backends/issues/153
#$(eval $(call SaneBackend,kvs40xx,Panasonic KV-S40xxC USB/SCSI ADF scanners,+libpthread +libusb-1.0))
$(eval $(call SaneBackend,kvs40xx,Panasonic KV-S40xxC USB/SCSI ADF scanners,+libpthread +libusb-1.0))
$(eval $(call SaneBackend,leo,LEO Technologies scanners)) $(eval $(call SaneBackend,leo,LEO Technologies scanners))
$(eval $(call SaneBackend,lexmark,Lexmark X1100/X1200 Series scanners,+libusb-1.0)) $(eval $(call SaneBackend,lexmark,Lexmark X1100/X1200 Series scanners,+libusb-1.0))
$(eval $(call SaneBackend,ma1509,Mustek BearPaw 1200F USB scanner,+libusb-1.0)) $(eval $(call SaneBackend,ma1509,Mustek BearPaw 1200F USB scanner,+libusb-1.0))
@ -346,8 +353,7 @@ $(eval $(call SaneBackend,mustek,Mustek SCSI flatbed scanners and some other dev
# Depends on libieee1284 # Depends on libieee1284
#$(eval $(call SaneBackend,mustek_pp,Mustek parallel port flatbed scanners,+libieee1284)) #$(eval $(call SaneBackend,mustek_pp,Mustek parallel port flatbed scanners,+libieee1284))
$(eval $(call SaneBackend,mustek_usb,Mustek USB flatbed scanners,+libusb-1.0)) $(eval $(call SaneBackend,mustek_usb,Mustek USB flatbed scanners,+libusb-1.0))
# https://gitlab.com/sane-project/backends/issues/153
#$(eval $(call SaneBackend,mustek_usb2,SQ113 based USB flatbed scanners,+libpthread +libusb-1.0))
$(eval $(call SaneBackend,mustek_usb2,SQ113 based USB flatbed scanners,+libpthread +libusb-1.0))
$(eval $(call SaneBackend,nec,NEC scanners)) $(eval $(call SaneBackend,nec,NEC scanners))
$(eval $(call SaneBackend,net,network backend)) $(eval $(call SaneBackend,net,network backend))
$(eval $(call SaneBackend,niash,scanners based on the NIASH chipset,+libusb-1.0)) $(eval $(call SaneBackend,niash,scanners based on the NIASH chipset,+libusb-1.0))


+ 14
- 13
utils/sane-backends/files/saned.hotplug View File

@ -1,27 +1,28 @@
#!/bin/sh #!/bin/sh
[ "$ACTION" = "add" ] || exit 0
[ "$DEVTYPE" = "usb_device" ] || exit 0
[ "$ACTION" != "remove" ] || exit 0
SANE_GROUP=scanner SANE_GROUP=scanner
grep -q -E "^$SANE_GROUP:" /etc/group || exit 0 grep -q -E "^$SANE_GROUP:" /etc/group || exit 0
# Filter SANE known devices
vendor_product="${PRODUCT%/*}"
vendorid="$(printf '%04x' "0x0${vendor_product%/*}")"
productid="$(printf '%04x' "0x0${vendor_product#*/}")"
grep -s -x -F -q "$productid" "/usr/share/sane/$vendorid"-*.usbid || exit 0
grant() { grant() {
logger -t "hotplug(usb/20-saned)" "Granting $1 to '$2' for group '$SANE_GROUP'"
echo "hotplug(usb/20-saned): Granting $1 to '$2' for group '$SANE_GROUP'" >/dev/kmsg
chgrp "$SANE_GROUP" "$2" chgrp "$SANE_GROUP" "$2"
chmod "$1" "$2" chmod "$1" "$2"
} }
# Needed by script /usr/bin/saned to rebind USB devices back to usblp after use
usblp_bind="/sys/bus/usb/drivers/usblp/bind" usblp_bind="/sys/bus/usb/drivers/usblp/bind"
if [ -e "$usblp_bind" ]; then
grant g+w "$usblp_bind"
if [ "$DEVTYPE" = "usb_device" ]; then
# Filter SANE known devices
vendor_product="${PRODUCT%/*}"
vendorid="$(printf '%04x' "0x0${vendor_product%/*}")"
productid="$(printf '%04x' "0x0${vendor_product#*/}")"
grep -s -x -F -q "$productid" "/usr/share/sane/$vendorid"-*.usbid || exit 0
grant g+rw "/dev/$DEVNAME"
elif [ "$DEVTYPE" = "usb_interface" ] && [ "$DRIVER" = 'usblp' ]; then
# Needed by script /usr/bin/saned to rebind USB devices back to usblp after use
if [ -e "$usblp_bind" ]; then
grant g+w "$usblp_bind"
fi
fi fi
grant g+rw "/dev/$DEVNAME"

+ 3
- 3
utils/sane-backends/patches/002-remove-uneeded.patch View File

@ -1,11 +1,11 @@
--- a/Makefile.in --- a/Makefile.in
+++ b/Makefile.in +++ b/Makefile.in
@@ -442,7 +442,7 @@ target_alias = @target_alias@
@@ -448,7 +448,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
-SUBDIRS = include lib sanei backend frontend tools doc po testsuite -SUBDIRS = include lib sanei backend frontend tools doc po testsuite
+SUBDIRS = include lib sanei backend frontend +SUBDIRS = include lib sanei backend frontend
DIST_SUBDIRS = include lib sanei backend frontend tools doc po japi testsuite DIST_SUBDIRS = include lib sanei backend frontend tools doc po japi testsuite
dist_doc_DATA = AUTHORS ChangeLog COPYING LICENSE NEWS PROBLEMS PROJECTS \
README README.aix README.beos README.darwin README.djpeg README.freebsd \
dist_doc_DATA = AUTHORS COPYING LICENSE NEWS PROBLEMS PROJECTS README \
README.aix README.beos README.darwin README.djpeg \

+ 21
- 0
utils/sane-backends/patches/100-fix-bigendian.patch View File

@ -0,0 +1,21 @@
From e1934720c687ed8c6125c75ac658f55b4e1513ce Mon Sep 17 00:00:00 2001
From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date: Sun, 2 Feb 2020 21:19:15 -0300
Subject: [PATCH] genesys: fix bigendian build
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
backend/genesys/low.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/backend/genesys/low.cpp
+++ b/backend/genesys/low.cpp
@@ -539,7 +539,7 @@ Image read_unshuffled_image_from_scanner
}
#ifdef WORDS_BIGENDIAN
- if (depth == 16) {
+ if (session.params.depth == 16) {
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
}
#endif

+ 16
- 0
utils/sane-backends/patches/101-fix_uclibc_std_rand.patch View File

@ -0,0 +1,16 @@
https://gitlab.com/sane-project/backends/issues/237
--- a/backend/genesys/image_pipeline.cpp
+++ b/backend/genesys/image_pipeline.cpp
@@ -703,7 +703,11 @@ bool ImagePipelineNodeCalibrate::get_nex
float value_f = static_cast<float>(value) / max_value;
value_f = (value_f - offset_[curr_calib_i]) * multiplier_[curr_calib_i];
+#if defined(__UCLIBC__)
+ value_f = round(value_f * max_value);
+#else
value_f = std::round(value_f * max_value);
+#endif
value = clamp<std::int32_t>(static_cast<std::int32_t>(value_f), 0, max_value);
set_raw_channel_to_row(out_data, x, ch, value, format);

Loading…
Cancel
Save