[Mod] First commit

This commit is contained in:
2022-10-31 22:18:58 +08:00
commit 1c8a3d9709
13090 changed files with 526733 additions and 0 deletions

View File

@ -0,0 +1,49 @@
From 13aadf79659dd238b618c8be7c1de44960bd5d50 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Fri, 11 Nov 2016 22:20:03 +0100
Subject: [PATCH] sane_backend: add missing config.h
We should include config.h from sanei_backend.h in order to use the
correct if/else HAVE_FOO.
For some reason with Glibc or uClibc there is no problem but with musl
we have the following weird issue:
In file included from epsonds.h:41:0,
from epsonds-jpeg.c:18:
../include/sane/sanei_backend.h:99:33: error: expected ';', identifier or '(' before 'int'
# define sigset_t int
^
../include/sane/sanei_backend.h:99:33: warning: useless type name in empty declaration
That's because HAVE_SIGPROCMASK is not defined although it's correctly
detected by the configure script.
$ grep config.log
config.log:#define HAVE_SIGPROCMASK 1
So, include config.h to avoid to redefine sigset_t.
Fixes:
http://autobuild.buildroot.net/results/9f1/9f1f1cb727b5c5407e69172280a3dee880e55cdf
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
include/sane/sanei_backend.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h
index 1b5afe2..2a96532 100644
--- a/include/sane/sanei_backend.h
+++ b/include/sane/sanei_backend.h
@@ -8,6 +8,7 @@
* @sa sanei.h sanei_thread.h
*/
+#include "../include/sane/config.h"
/*
* Compiler related options
--
2.5.5

View File

@ -0,0 +1,50 @@
From f67cfd6a534e9faaca83afebd61a6d77d7837174 Mon Sep 17 00:00:00 2001
From: Peter Seiderer <ps.report@gmx.net>
Date: Mon, 15 Mar 2021 20:53:55 +0100
Subject: [PATCH] genesys: fix gcc-4.8 compile
Fixes:
genesys/utilities.h:229:23: error: invalid initialization of non-const reference of type 'std::basic_ios<char>&' from an rvalue of type '<brace-enclosed initializer list>'
stream_{stream}
^
genesys/image_pipeline.cpp:715:19: error: invalid initialization of non-const reference of type 'genesys::ImagePipelineNode&' from an rvalue of type '<brace-enclosed initializer list>'
source_{source}
^
[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/609]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
backend/genesys/image_pipeline.cpp | 2 +-
backend/genesys/utilities.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/backend/genesys/image_pipeline.cpp b/backend/genesys/image_pipeline.cpp
index 4161e95..14e2f8d 100644
--- a/backend/genesys/image_pipeline.cpp
+++ b/backend/genesys/image_pipeline.cpp
@@ -712,7 +712,7 @@ ImagePipelineNodeCalibrate::ImagePipelineNodeCalibrate(ImagePipelineNode& source
const std::vector<std::uint16_t>& bottom,
const std::vector<std::uint16_t>& top,
std::size_t x_start) :
- source_{source}
+ source_(source)
{
std::size_t size = 0;
if (bottom.size() >= x_start && top.size() >= x_start) {
diff --git a/backend/genesys/utilities.h b/backend/genesys/utilities.h
index 6e637d0..2ef2ddd 100644
--- a/backend/genesys/utilities.h
+++ b/backend/genesys/utilities.h
@@ -226,7 +226,7 @@ class BasicStreamStateSaver
{
public:
explicit BasicStreamStateSaver(std::basic_ios<Char, Traits>& stream) :
- stream_{stream}
+ stream_(stream)
{
flags_ = stream_.flags();
width_ = stream_.width();
--
2.30.1

View File

@ -0,0 +1,46 @@
From b6e21e3cd0825e7ec2b3b7e6401d25b901deeed2 Mon Sep 17 00:00:00 2001
From: Peter Seiderer <ps.report@gmx.net>
Date: Wed, 31 Mar 2021 22:51:03 +0200
Subject: [PATCH] genesys: use usleep instead of std::this_thread::sleep_for to
re-enable thread less compile
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes:
genesys/scanner_interface_usb.cpp: In member function virtual void genesys::ScannerInterfaceUsb::sleep_us(unsigned int):
genesys/scanner_interface_usb.cpp:484:10: error: std::this_thread has not been declared
484 | std::this_thread::sleep_for(std::chrono::microseconds{microseconds});
| ^~~~~~~~~~~
[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/619]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
backend/genesys/scanner_interface_usb.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/backend/genesys/scanner_interface_usb.cpp b/backend/genesys/scanner_interface_usb.cpp
index 117297c..2ca78ab 100644
--- a/backend/genesys/scanner_interface_usb.cpp
+++ b/backend/genesys/scanner_interface_usb.cpp
@@ -43,7 +43,6 @@
#include "scanner_interface_usb.h"
#include "low.h"
-#include <thread>
namespace genesys {
@@ -481,7 +480,7 @@ void ScannerInterfaceUsb::sleep_us(unsigned microseconds)
if (sanei_usb_is_replay_mode_enabled()) {
return;
}
- std::this_thread::sleep_for(std::chrono::microseconds{microseconds});
+ usleep(microseconds);
}
void ScannerInterfaceUsb::record_progress_message(const char* msg)
--
2.30.2

View File

@ -0,0 +1,58 @@
From 145e16008e7479ea58278e55f71d6dfcd4db714b Mon Sep 17 00:00:00 2001
From: Peter Seiderer <ps.report@gmx.net>
Date: Fri, 18 Jun 2021 19:51:45 +0200
Subject: [PATCH] backend/microtek: fix uclibc compile (include stdarg.h for
va_list/va_start/va_end)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes:
microtek.c: In function MDBG_INIT:
microtek.c:163:3: error: unknown type name va_list
163 | va_list ap;
| ^~~~~~~
microtek.c:78:1: note: va_list is defined in header <stdarg.h>; did you forget to #include <stdarg.h>?
77 | #include "microtek.h"
+++ |+#include <stdarg.h>
78 |
microtek.c:164:3: warning: implicit declaration of function va_start; did you mean sane_start? [-Wimplicit-function-declaration]
164 | va_start(ap, format);
| ^~~~~~~~
| sane_start
microtek.c:165:54: warning: passing argument 4 of vsnprintf makes pointer from integer without a cast [-Wint-conversion]
165 | vsnprintf(_mdebug_string, MAX_MDBG_LENGTH, format, ap);
| ^~
| |
| int
In file included from ../include/sane/sanei_config.h:50,
from microtek.c:70:
.../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:359:57: note: expected __va_list_tag * but argument is of type int
359 | const char *__restrict __format, __gnuc_va_list __arg)
| ~~~~~~~~~~~~~~~^~~~~
microtek.c:166:3: warning: implicit declaration of function va_end [-Wimplicit-function-declaration]
166 | va_end(ap);
| ^~~~~~
[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/638]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
backend/microtek.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/backend/microtek.c b/backend/microtek.c
index 200a69c1a..63560179c 100644
--- a/backend/microtek.c
+++ b/backend/microtek.c
@@ -57,6 +57,7 @@
#include "../include/sane/config.h"
+#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
--
2.31.1

View File

@ -0,0 +1,59 @@
From 7dafc52dda96fa68f39058b10eec3d822fd5ea9d Mon Sep 17 00:00:00 2001
From: Peter Seiderer <ps.report@gmx.net>
Date: Fri, 18 Jun 2021 19:56:56 +0200
Subject: [PATCH] backend/sm3600-scanutil: fix uclibc compile (include stdarg.h
for va_list/va_start/va_end)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes:
sm3600-scanutil.c: In function debug_printf:
sm3600-scanutil.c:69:3: error: unknown type name va_list
69 | va_list ap;
| ^~~~~~~
sm3600-scanutil.c:48:1: note: va_list is defined in header <stdarg.h>; did you forget to #include <stdarg.h>?
47 | #include "sm3600-scantool.h"
+++ |+#include <stdarg.h>
48 |
sm3600-scanutil.c:75:3: warning: implicit declaration of function va_start; did you mean sane_start? [-Wimplicit-function-declaration]
75 | va_start(ap,szFormat);
| ^~~~~~~~
| sane_start
sm3600-scanutil.c:76:28: warning: passing argument 3 of vfprintf makes pointer from integer without a cast [-Wint-conversion]
76 | vfprintf(stderr,szFormat,ap);
| ^~
| |
| int
In file included from ../include/sane/sanei_config.h:50,
from sm3600.c:70:
.../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:339:23: note: expected __va_list_tag * but argument is of type int
339 | __gnuc_va_list __arg);
| ~~~~~~~~~~~~~~~^~~~~
In file included from sm3600.c:94:
sm3600-scanutil.c:77:3: warning: implicit declaration of function va_end [-Wimplicit-function-declaration]
77 | va_end(ap);
| ^~~~~~
[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/638]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
backend/sm3600-scanutil.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/backend/sm3600-scanutil.c b/backend/sm3600-scanutil.c
index 6fe67ed0c..616bf3f4c 100644
--- a/backend/sm3600-scanutil.c
+++ b/backend/sm3600-scanutil.c
@@ -43,6 +43,7 @@ Userspace scan tool for the Microtek 3600 scanner
====================================================================== */
+#include <stdarg.h>
#include <unistd.h>
#include "sm3600-scantool.h"
--
2.31.1

View File

@ -0,0 +1,16 @@
config BR2_PACKAGE_SANE_BACKENDS
bool "sane-backends"
depends on BR2_USE_MMU # fork()
depends on !BR2_STATIC_LIBS
help
SANE - Scanner Access Now Easy
http://www.sane-project.org
Backends are included automatically based on the libraries
that have been selected: libusb, jpeg, tiff, avahi (with
dbus and libglib2), and netsnmp.
comment "sane-backends needs a toolchain w/ dynamic library"
depends on BR2_USE_MMU
depends on BR2_STATIC_LIBS

View File

@ -0,0 +1,5 @@
# From https://gitlab.com/sane-project/backends/uploads/a705aadf854ca0dc8bf66df937308861/sane-backends-1.0.32.sha256.txt
sha256 3a28c237c0a72767086202379f6dc92dbb63ec08dfbab22312cba80e238bb114 sane-backends-1.0.32.tar.gz
# Hash for license file
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING

View File

@ -0,0 +1,95 @@
################################################################################
#
# sane-backends
#
################################################################################
SANE_BACKENDS_VERSION = 1.0.32
SANE_BACKENDS_SITE = \
https://gitlab.com/sane-project/backends/uploads/104f09c07d35519cc8e72e604f11643f
SANE_BACKENDS_CONFIG_SCRIPTS = sane-config
SANE_BACKENDS_LICENSE = GPL-2.0+
SANE_BACKENDS_LICENSE_FILES = COPYING
SANE_BACKENDS_CPE_ID_VENDOR = sane-backends_project
SANE_BACKENDS_INSTALL_STAGING = YES
SANE_BACKENDS_CONF_OPTS = \
$(if $(BR2_TOOLCHAIN_HAS_THREADS),--enable-pthread,--disable-pthread)
ifeq ($(BR2_INIT_SYSTEMD),y)
SANE_BACKENDS_CONF_OPTS += --with-systemd
SANE_BACKENDS_DEPENDENCIES += systemd
else
SANE_BACKENDS_CONF_OPTS += --without-systemd
endif
ifeq ($(BR2_PACKAGE_LIBUSB),y)
SANE_BACKENDS_DEPENDENCIES += libusb
SANE_BACKENDS_CONF_OPTS += --with-usb
else
SANE_BACKENDS_CONF_OPTS += --without-usb
endif
ifeq ($(BR2_PACKAGE_JPEG),y)
SANE_BACKENDS_DEPENDENCIES += jpeg
endif
ifeq ($(BR2_PACKAGE_TIFF),y)
SANE_BACKENDS_DEPENDENCIES += tiff
endif
ifeq ($(BR2_PACKAGE_LIBV4L),y)
SANE_BACKENDS_DEPENDENCIES += libv4l
endif
ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_DBUS)$(BR2_PACKAGE_LIBGLIB2),yyy)
SANE_BACKENDS_DEPENDENCIES += avahi
SANE_BACKENDS_CONF_OPTS += --with-avahi
endif
ifeq ($(BR2_PACKAGE_NETSNMP),y)
SANE_BACKENDS_CONF_ENV += ac_cv_path_SNMP_CONFIG_PATH=$(STAGING_DIR)/usr/bin/net-snmp-config
SANE_BACKENDS_DEPENDENCIES += netsnmp
else
SANE_BACKENDS_CONF_OPTS += --without-snmp
endif
ifeq ($(BR2_PACKAGE_LIBCURL),y)
SANE_BACKENDS_DEPENDENCIES += libcurl
SANE_BACKENDS_CONF_OPTS += --with-libcurl
else
SANE_BACKENDS_CONF_OPTS += --without-libcurl
endif
ifeq ($(BR2_PACKAGE_POPPLER)$(BR2_PACKAGE_CAIRO)$(BR2_PACKAGE_LIBGLIB2),yyy)
SANE_BACKENDS_DEPENDENCIES += poppler libglib2
SANE_BACKENDS_CONF_OPTS += --with-poppler-glib
else
SANE_BACKENDS_CONF_OPTS += --without-poppler-glib
endif
ifeq ($(BR2_PACKAGE_LIBXML2),y)
SANE_BACKENDS_DEPENDENCIES += libxml2
SANE_BACKENDS_CONF_OPTS += --with-usb-record-replay
else
SANE_BACKENDS_CONF_OPTS += --without-usb-record-replay
endif
define SANE_BACKENDS_DISABLE_DOCS
$(SED) 's/ doc//' $(@D)/Makefile
endef
SANE_BACKENDS_POST_CONFIGURE_HOOKS += SANE_BACKENDS_DISABLE_DOCS
define SANE_BACKENDS_USERS
saned -1 saned -1 * /etc/sane.d - - Saned User
endef
define SANE_BACKENDS_INSTALL_INIT_SYSTEMD
$(INSTALL) -m 0644 -D package/sane-backends/saned.socket \
$(TARGET_DIR)/usr/lib/systemd/system/saned.socket
$(INSTALL) -m 0644 -D package/sane-backends/saned@.service \
$(TARGET_DIR)/usr/lib/systemd/system/saned@.service
endef
$(eval $(autotools-package))

View File

@ -0,0 +1,10 @@
[Unit]
Description=saned incoming socket
[Socket]
ListenStream=6566
Accept=yes
MaxConnections=1
[Install]
WantedBy=sockets.target

View File

@ -0,0 +1,18 @@
[Unit]
Description=Scanner Service
Requires=saned.socket
[Service]
ExecStart=/usr/sbin/saned
User=saned
Group=saned
StandardInput=null
StandardOutput=syslog
StandardError=syslog
Environment=SANE_CONFIG_DIR=/etc/sane.d
# If you need to debug your configuration uncomment the next line and
# change it as appropriate to set the desired debug options
# Environment=SANE_DEBUG_DLL=255 SANE_DEBUG_BJNP=5
[Install]
Also=saned.socket