From a0c70e72d91c215b11749e1503bfc1313521371d Mon Sep 17 00:00:00 2001 From: Rmys Date: Thu, 1 Apr 2021 13:18:59 +0300 Subject: [PATCH] sane-backends ver. bump --- hardware/scannner/sane-backends/actions.py | 8 ++- .../files/sane-backends-1.0.25-udev.patch | 72 +++++++++++++++++++ .../files/sane-epson2-disable-focus.patch | 36 ++++++++++ hardware/scannner/sane-backends/pspec.xml | 16 +++-- 4 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 hardware/scannner/sane-backends/files/sane-backends-1.0.25-udev.patch create mode 100644 hardware/scannner/sane-backends/files/sane-epson2-disable-focus.patch diff --git a/hardware/scannner/sane-backends/actions.py b/hardware/scannner/sane-backends/actions.py index 294d3a11d4..0c061e360f 100644 --- a/hardware/scannner/sane-backends/actions.py +++ b/hardware/scannner/sane-backends/actions.py @@ -14,8 +14,14 @@ def setup(): # I couldn't find in docs, some comment would be helpful here -gurer shelltools.export("SANEI_JPEG", "sanei_jpeg.o") shelltools.export("SANEI_JPEG_LO", "sanei_jpeg.lo") + + pisitools.cflags.add("-fPIC -fno-strict-aliasing") + pisitools.ldflags.add("-pie") + + shelltools.echo(".tarball-version", get.srcVERSION()) + shelltools.echo(".version", get.srcVERSION()) - #autotools.autoreconf("-fi") + autotools.autoreconf("-fiv") autotools.configure("--enable-ipv6 \ --enable-avahi \ diff --git a/hardware/scannner/sane-backends/files/sane-backends-1.0.25-udev.patch b/hardware/scannner/sane-backends/files/sane-backends-1.0.25-udev.patch new file mode 100644 index 0000000000..6a648120bd --- /dev/null +++ b/hardware/scannner/sane-backends/files/sane-backends-1.0.25-udev.patch @@ -0,0 +1,72 @@ +From 252f347d59fff3ab1877f77a36613b318651725e Mon Sep 17 00:00:00 2001 +From: Nils Philippsen +Date: Tue, 8 Oct 2013 16:29:13 +0200 +Subject: [PATCH] patch: udev + +Squashed commit of the following: + +commit fb6d1f4c0d17f1df33429bf03a64cd4fbb819ea5 +Author: Nils Philippsen +Date: Tue Oct 8 16:24:49 2013 +0200 + + adapt generated udev rules for Fedora + +commit 8bffaccc1eeb19ecbaddb4ac9da73954af4c5d4f +Author: Nils Philippsen +Date: Mon Sep 10 12:20:43 2012 +0200 + + use group and mode macros consistently +--- + tools/sane-desc.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/tools/sane-desc.c b/tools/sane-desc.c +index badc8ce..f992bf5 100644 +--- a/tools/sane-desc.c ++++ b/tools/sane-desc.c +@@ -57,9 +57,9 @@ + #define COLOR_NEW "\"#F00000\"" + #define COLOR_UNKNOWN "\"#000000\"" + +-#define DEVMODE "0664" ++#define DEVMODE "0644" + #define DEVOWNER "root" +-#define DEVGROUP "scanner" ++#define DEVGROUP "root" + + #ifndef PATH_MAX + # define PATH_MAX 1024 +@@ -3564,7 +3564,8 @@ print_udev (void) + } + + printf("\n# The following rule will disable USB autosuspend for the device\n"); +- printf("ENV{libsane_matched}==\"yes\", RUN+=\"/bin/sh -c 'if test -e /sys/$env{DEVPATH}/power/control; then echo on > /sys/$env{DEVPATH}/power/control; elif test -e /sys/$env{DEVPATH}/power/level; then echo on > /sys/$env{DEVPATH}/power/level; fi'\"\n"); ++ printf("ENV{libsane_matched}==\"yes\", TEST==\"power/control\", ATTR{power/control}=\"on\"\n"); ++ printf("ENV{libsane_matched}==\"yes\", TEST!=\"power/control\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n"); + + printf ("\nLABEL=\"libsane_usb_rules_end\"\n\n"); + +@@ -3641,10 +3642,8 @@ print_udev (void) + } + printf ("LABEL=\"libsane_scsi_rules_end\"\n"); + +- if (mode == output_mode_udevacl) +- printf("\nENV{libsane_matched}==\"yes\", RUN+=\"/bin/setfacl -m g:%s:rw $env{DEVNAME}\"\n", DEVGROUP); +- else +- printf ("\nENV{libsane_matched}==\"yes\", MODE=\"664\", GROUP=\"scanner\"\n"); ++ if (mode != output_mode_udevacl) ++ printf ("\nENV{libsane_matched}==\"yes\", MODE=\"%s\", GROUP=\"%s\"\n", DEVMODE, DEVGROUP); + + printf ("\nLABEL=\"libsane_rules_end\"\n"); + } +@@ -3695,6 +3694,7 @@ print_udevhwdb (void) + + printf("# The following rule will disable USB autosuspend for the device\n"); + printf("ENV{DEVTYPE}==\"usb_device\", ENV{libsane_matched}==\"yes\", TEST==\"power/control\", ATTR{power/control}=\"on\"\n\n"); ++ printf("ENV{DEVTYPE}==\"usb_device\", ENV{libsane_matched}==\"yes\", TEST!=\"power/control\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n"); + + printf ("SUBSYSTEMS==\"scsi\", GOTO=\"libsane_scsi_rules_begin\"\n"); + printf ("GOTO=\"libsane_rules_end\"\n\n"); +-- +2.5.0 + diff --git a/hardware/scannner/sane-backends/files/sane-epson2-disable-focus.patch b/hardware/scannner/sane-backends/files/sane-epson2-disable-focus.patch new file mode 100644 index 0000000000..c1e86be2be --- /dev/null +++ b/hardware/scannner/sane-backends/files/sane-epson2-disable-focus.patch @@ -0,0 +1,36 @@ +diff --git a/backend/epson2-ops.c b/backend/epson2-ops.c +index 83a0169..573ebcf 100644 +--- a/backend/epson2-ops.c ++++ b/backend/epson2-ops.c +@@ -291,14 +291,14 @@ e2_dev_post_init(struct Epson_Device *dev) + dev->need_reset_on_source_change = SANE_FALSE; + + if (e2_dev_model(dev, "ES-9000H") || e2_dev_model(dev, "GT-30000")) { +- dev->cmd->set_focus_position = 0; + dev->cmd->feed = 0x19; ++ dev->focusSupport = SANE_FALSE; + } + + if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650") + || e2_dev_model(dev, "Perfection1640") || e2_dev_model(dev, "GT-8700")) { + dev->cmd->feed = 0; +- dev->cmd->set_focus_position = 0; ++ dev->focusSupport = SANE_FALSE; + dev->need_reset_on_source_change = SANE_TRUE; + } + +@@ -825,12 +825,12 @@ e2_discover_capabilities(Epson_Scanner *s) + + if (esci_request_focus_position(s, &s->currentFocusPosition) == + SANE_STATUS_GOOD) { +- DBG(1, "setting focus is supported, current focus: %u\n", s->currentFocusPosition); ++ DBG(1, "getting focus is supported, current focus: %u\n", s->currentFocusPosition); + dev->focusSupport = SANE_TRUE; + s->opt[OPT_FOCUS_POS].cap &= ~SANE_CAP_INACTIVE; + s->val[OPT_FOCUS_POS].w = s->currentFocusPosition; + } else { +- DBG(1, "setting focus is not supported\n"); ++ DBG(1, "getting focus is not supported\n"); + dev->focusSupport = SANE_FALSE; + s->opt[OPT_FOCUS_POS].cap |= SANE_CAP_INACTIVE; + s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; /* just in case */ diff --git a/hardware/scannner/sane-backends/pspec.xml b/hardware/scannner/sane-backends/pspec.xml index f19ce9daca..3f172333d2 100644 --- a/hardware/scannner/sane-backends/pspec.xml +++ b/hardware/scannner/sane-backends/pspec.xml @@ -14,7 +14,7 @@ library Scanner access software Scanner Access Now Easy (SANE) is a universal scanner interface. The SANE application programming interface provides standardized access to any raster image scanner hardware. - https://gitlab.com/sane-project/backends/uploads/54f858b20a364fc35d820df935a86478/sane-backends-1.0.29.tar.gz + https://gitlab.com/sane-project/backends/-/archive/1.0.32/backends-1.0.32.tar.gz libieee1284-devel libusb-compat-devel @@ -32,10 +32,11 @@ - sane-backends-1.0.23-sane-config-multilib.patch + sane-backends-1.0.25-udev.patch - sane-backends-1.0.23-udev.patch - archlinux/network.patch + sane-backends-1.0.23-sane-config-multilib.patch + sane-epson2-disable-focus.patch + @@ -100,6 +101,13 @@ + + 2021-04-01 + 1.0.32 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2020-02-23 1.0.29