Browse Source

sane-backends: import from oldpackages and update

Changes since oldpackages:
- updated to 1.0.25
  * most of openwrt patches are upstreamed now
- cups dependency was completely removed
- small musl patch
- small uclibc patch
- removed link to extra libraries in libsane (used only
  for preload backends)
- sane-libs and sane-backends merged and exploded into
  individual packages for each backend:
  * libsane for sane library (which backends should dep on)
  * sane-daemon for saned daemon
  * sane-xxx for sane backend for xxx
  ** each backend has its own custom dep libraries
  * sane-backends-all (with no files) that deps on all backends
  * sane-qcam is only available for x86/x86_64
  ** other archs does not implement inb/outb (at least in musl)

Now it is possible to use SANE with much less FS space (KB
instead of MB).

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Luiz Angelo Daros de Luca 9 years ago
parent
commit
e8e9196a30

+ 356
- 0
utils/sane-backends/Makefile View File

@@ -0,0 +1,356 @@
1
+#
2
+# Copyright (C) 2006-2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=sane-backends
11
+PKG_VERSION:=1.0.25
12
+PKG_RELEASE:=1
13
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14
+PKG_SOURCE_URL:=http://fossies.org/linux/misc \
15
+    https://alioth.debian.org/frs/download.php/file/4146/
16
+PKG_MD5SUM:=f9ed5405b3c12f07c6ca51ee60225fe7
17
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
18
+PKG_LICENSE:=GPL-2.0 GPL-2.0+
19
+PKG_LICENSE_FILES:=COPYING LICENSE
20
+
21
+PKG_FIXUP:=autoreconf
22
+PKG_REMOVE_FILES:=aclocal.m4
23
+
24
+PKG_INSTALL:=1
25
+
26
+include $(INCLUDE_DIR)/package.mk
27
+
28
+SANE_BACKENDS:=
29
+
30
+define Package/sane-backends/Default
31
+  TITLE:=Scanner Access Now Easy
32
+  URL:=http://www.sane-project.org/
33
+endef
34
+
35
+define Package/sane-backends/Default/description
36
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
37
+endef
38
+
39
+define Package/sane-backends
40
+$(call Package/sane-backends/Default)
41
+  SECTION:=utils
42
+  CATEGORY:=Utilities
43
+  TITLE+= (drivers)
44
+endef
45
+
46
+define Package/sane-backends/description
47
+$(call Package/sane-backends/Default/description)
48
+.
49
+This
50
+endef
51
+
52
+define Package/sane-backends/config
53
+    menu "Select SANE backends"
54
+      depends on PACKAGE_sane-backends
55
+
56
+
57
+    config PACKAGE_sane-backends-all
58
+      depends on PACKAGE_sane-backends
59
+      prompt "Include all SANE backends (sane-backends-all)"
60
+
61
+    comment "Modules"
62
+
63
+$(foreach backend,$(SANE_BACKENDS), \
64
+    $(eval \
65
+      $(call Package/Default)
66
+      $(call Package/sane-$(backend))
67
+    )\
68
+    config PACKAGE_sane-$(backend)
69
+      prompt "$(TITLE)"
70
+     $(foreach config_dep,\
71
+       $(filter @%,
72
+         $(foreach v, $(DEPENDS), $(if $(findstring :,$v),,$v))
73
+       ),\
74
+      depends on $(strip $(subst @,,$(config_dep)))
75
+     )
76
+)
77
+  endmenu
78
+
79
+endef
80
+
81
+# returns conditional dependency on sane backend
82
+# 1: backend name
83
+#
84
+# If there is no config deps on $(1), returns +sane-$(1).
85
+# Otherwise, +(CONFIG1&&CONFIG2&&..):sane-$(1)
86
+define SaneBackendDependency
87
+    $(eval \
88
+        $(call Package/Default)
89
+        $(call Package/sane-$(1))
90
+        FILTER_CONFIG:=$$(strip \
91
+            $$(foreach config_dep, \
92
+                $$(filter @%, \
93
+                    $$(foreach v, \
94
+                        $$(DEPENDS), \
95
+                        $$(if $$(findstring :,$$v),,$$v) \
96
+                    ) \
97
+                ), \
98
+                $$(subst @,,$$(config_dep)) \
99
+            ) \
100
+        )
101
+        ifneq (,$$(FILTER_CONFIG))
102
+           FILTER_CONFIG:=($$(subst $$(space),&&,$$(FILTER_CONFIG))):
103
+        endif
104
+    ) \
105
+    +$(FILTER_CONFIG)sane-$(1)
106
+endef
107
+
108
+define Package/sane-backends-all
109
+$(call Package/sane-backends/Default)
110
+  SECTION:=utils
111
+  CATEGORY:=Utilities
112
+  TITLE+= (all backends)
113
+  DEPENDS:=$(foreach backend,$(SANE_BACKENDS),$(strip $(call SaneBackendDependency,$(backend))))
114
+  HIDDEN:=1
115
+endef
116
+
117
+define Package/sane-backends/description
118
+$(call Package/sane-backends/Default/description)
119
+.
120
+Metapackage for selecting all SANE Backends
121
+endef
122
+
123
+define Package/sane-daemon
124
+$(call Package/sane-backends/Default)
125
+  SECTION:=utils
126
+  CATEGORY:=Utilities
127
+  DEPENDS:=+libsane
128
+  TITLE+= (network daemon)
129
+endef
130
+
131
+define Package/sane-daemon/description
132
+$(call Package/sane-backends/Default/description)
133
+This package contains the SANE daemon.
134
+endef
135
+
136
+define Package/libsane
137
+  $(call Package/sane-backends/Default)
138
+  SECTION:=libs
139
+  CATEGORY:=Libraries
140
+  DEPENDS:=+libusb-compat
141
+  TITLE+= (libraries)
142
+endef
143
+
144
+define Package/libsane/description
145
+$(call Package/sane-backends/Default/description)
146
+This package contains the SANE shared libraries.
147
+endef
148
+
149
+define Package/sane-frontends
150
+  $(call Package/sane-backends/Default)
151
+  SECTION:=utils
152
+  CATEGORY:=Utilities
153
+  DEPENDS:=+libsane +libjpeg +libpng
154
+  TITLE+= (frontends)
155
+endef
156
+
157
+define Package/sane-frontends/description
158
+$(call Package/sane-backends/Default/description)
159
+This package contains the SANE frontends.
160
+endef
161
+
162
+TARGET_LDFLAGS += \
163
+	-Wl,-rpath-link $(STAGING_DIR)/usr/lib \
164
+	-Wl,-rpath-link $(PKG_BUILD_DIR)/backend/.libs
165
+
166
+CONFIGURE_ARGS+= \
167
+	--enable-shared \
168
+	--enable-static \
169
+	--disable-translations \
170
+	--disable-latex \
171
+	--without-gphoto2 \
172
+	--without-snmp
173
+
174
+CONFIGURE_VARS+= \
175
+    ac_cv_func_mmap_fixed_mapped="yes" \
176
+
177
+define Build/Configure
178
+	mkdir -p $(PKG_BUILD_DIR)/backend/.libs
179
+	$(Build/Configure/Default)
180
+endef
181
+
182
+define Package/libsane/install
183
+	$(INSTALL_DIR) $(1)/usr/lib/sane/
184
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.so.* $(1)/usr/lib/
185
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/sane/libsane-dll.so.* $(1)/usr/lib/sane/
186
+	$(INSTALL_DIR) $(1)/etc/sane.d/dll.d
187
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/dll.conf $(1)/etc/sane.d/
188
+endef
189
+
190
+define Package/libsane/conffiles
191
+/etc/sane.d/dll.conf
192
+endef
193
+
194
+define Package/sane-daemon/install
195
+	$(INSTALL_DIR) $(1)/etc/sane.d
196
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/saned.conf $(1)/etc/sane.d/
197
+	$(INSTALL_DIR) $(1)/usr/sbin
198
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
199
+	$(INSTALL_DIR) $(1)/etc/xinetd.d
200
+	$(CP) ./files/xinet.d_sane-port $(1)/etc/xinetd.d/sane-port
201
+endef
202
+
203
+define Package/sane-daemon/conffiles
204
+/etc/sane.d/saned.conf
205
+endef
206
+
207
+define Package/sane-frontends/install
208
+	$(INSTALL_DIR) $(1)/usr/bin
209
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
210
+endef
211
+
212
+define Package/sane-backends-all/install
213
+	/bin/true
214
+endef
215
+
216
+define Build/InstallDev
217
+	$(INSTALL_DIR) $(1)/usr/include
218
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/sane $(1)/usr/include/
219
+	$(INSTALL_DIR) $(1)/usr/lib
220
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.{a,so*} $(1)/usr/lib/
221
+endef
222
+
223
+# 1: short name
224
+# 2: description
225
+# 3: dependencies on other packages
226
+define SaneBackend
227
+  SANE_BACKENDS+= $(1)
228
+
229
+  define Package/sane-$(1)
230
+    $(call Package/sane-backends/Default)
231
+    TITLE:=SANE backend (sane-$(1)) for $(2)
232
+    DEPENDS+= +libsane $(3)
233
+    HIDDEN:=1
234
+  endef
235
+
236
+  define Package/sane-$(1)/description
237
+   $(call Package/sane-backends/Default/description)
238
+.
239
+This package contains the SANE backend for $(2).
240
+  endef
241
+
242
+  define Package/sane-$(1)/install
243
+	if [ -f "$(PKG_INSTALL_DIR)/etc/sane.d/$(1).conf" ]; then \
244
+	  $(INSTALL_DIR) $$(1)/etc/sane.d ; \
245
+	  $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/$(1).conf $$(1)/etc/sane.d/; \
246
+	fi
247
+	$(INSTALL_DIR) $$(1)/usr/lib/sane
248
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/sane/libsane-$(1).so.* $$(1)/usr/lib/sane/
249
+	if [ -d "$(PKG_INSTALL_DIR)/usr/share/sane/$(1)" ]; then \
250
+		$(INSTALL_DIR) $$(1)/usr/share/sane/ ; \
251
+		$(CP) -a $(PKG_INSTALL_DIR)/usr/share/sane/$(1) $$(1)/usr/share/sane/ ; \
252
+	fi
253
+  endef
254
+
255
+  define Package/sane-$(1)/conffiles
256
+	/etc/sane.d/$(1).conf
257
+  endef
258
+
259
+  $$(eval $$(call BuildPackage,sane-$(1)))
260
+endef
261
+
262
+$(eval $(call BuildPackage,libsane))
263
+$(eval $(call BuildPackage,sane-daemon))
264
+$(eval $(call SaneBackend,abaton,Abaton flatbed scanners))
265
+$(eval $(call SaneBackend,agfafocus,AGFA Focus flatbed scanners))
266
+$(eval $(call SaneBackend,apple,Apple flatbed scanners))
267
+$(eval $(call SaneBackend,artec,Artec flatbed scanners))
268
+$(eval $(call SaneBackend,artec_eplus48u,Artec E+ 48U and re-badged models))
269
+$(eval $(call SaneBackend,as6e,Artec AS6E parallel port interface scanner))
270
+$(eval $(call SaneBackend,avision,Avision and Avision OEM scanners and possibly more flatbed and film scanners))
271
+$(eval $(call SaneBackend,bh,Bell+Howell Copiscan II series document scanners))
272
+$(eval $(call SaneBackend,canon,Canon SCSI scanners))
273
+$(eval $(call SaneBackend,canon630u,the Canon 630u USB flatbed scanner))
274
+$(eval $(call SaneBackend,canon_dr,Canon DR-series scanners))
275
+# Depends on libieee1284
276
+#$(eval $(call SaneBackend,canon_pp,Canon CanoScan Parallel Port flatbed scanners,+libieee1284))
277
+$(eval $(call SaneBackend,cardscan,Corex CardScan usb scanners))
278
+$(eval $(call SaneBackend,coolscan,Nikon film-scanners))
279
+$(eval $(call SaneBackend,coolscan2,Nikon Coolscan film scanners))
280
+$(eval $(call SaneBackend,coolscan3,Nikon Coolscan film scanners))
281
+$(eval $(call SaneBackend,dc210,Kodak DC210 Digital Camera,+libjpeg))
282
+$(eval $(call SaneBackend,dc240,Kodak DC240 Digital Camera,+libjpeg))
283
+$(eval $(call SaneBackend,dc25,Kodak DC20/DC25 Digital Cameras))
284
+$(eval $(call SaneBackend,dell1600n_net,Dell 1600n,+libtiff))
285
+$(eval $(call SaneBackend,dmc,Polaroid Digital Microscope Camera))
286
+$(eval $(call SaneBackend,epjitsu,Epson-based Fujitsu USB scanners))
287
+$(eval $(call SaneBackend,epson,EPSON scanners))
288
+$(eval $(call SaneBackend,epsonds,EPSON scanners,+libjpeg)) ####
289
+$(eval $(call SaneBackend,epson2,EPSON scanners))
290
+$(eval $(call SaneBackend,fujitsu,Fujitsu flatbed and ADF scanners))
291
+$(eval $(call SaneBackend,genesys,GL646 GL841 GL843 GL847 and GL124 based USB flatbed scanners))
292
+#$(eval $(call SaneBackend,gphoto2,digital cameras supported by gphoto2,+libjpeg))
293
+$(eval $(call SaneBackend,gt68xx,GT-68XX based USB flatbed scanners))
294
+$(eval $(call SaneBackend,hp,HP ScanJet scanners))
295
+$(eval $(call SaneBackend,hp3500,Hewlett-Packard ScanJet 3500 series scanners))
296
+$(eval $(call SaneBackend,hp3900,RTS8822 chipset based scanners,+libtiff))
297
+$(eval $(call SaneBackend,hp4200,Hewlett-Packard 4200 scanners))
298
+$(eval $(call SaneBackend,hp5400,Hewlett-Packard 54XX scanners))
299
+$(eval $(call SaneBackend,hp5590,Hewlett-Packard 4500C/4570C/5500C/5550C/5590/7650 Workgroup/Document scanners))
300
+$(eval $(call SaneBackend,hpljm1005,Hewlett-Packard LaserJet M1005 MFP Scanner))
301
+# Depends on libieee1284
302
+#$(eval $(call SaneBackend,hpsj5s,HP ScanJet 5S sheet-fed scanner,+libieee1284))
303
+$(eval $(call SaneBackend,hs2p,Ricoh SCSI flatbed/ADF scanners))
304
+$(eval $(call SaneBackend,ibm,IBM and Ricoh SCSI flatbed scanners))
305
+$(eval $(call SaneBackend,kodak,big Kodak flatbed and ADF scanners))
306
+$(eval $(call SaneBackend,kodakaio,Kodak aio printer / scanners))
307
+$(eval $(call SaneBackend,kvs20xx,Panasonic KV-S20xxC USB/SCSI ADF scanners))
308
+$(eval $(call SaneBackend,kvs40xx,Panasonic KV-S40xxC USB/SCSI ADF scanners))
309
+$(eval $(call SaneBackend,kvs1025,Panasonic KV-S102xC USB ADF scanners))
310
+$(eval $(call SaneBackend,leo,LEO Technologies scanners))
311
+$(eval $(call SaneBackend,lexmark,Lexmark X1100/X1200 Series scanners))
312
+$(eval $(call SaneBackend,ma1509,Mustek BearPaw 1200F USB scanner))
313
+$(eval $(call SaneBackend,magicolor,KONICA MINOLTA magicolor scanners))
314
+$(eval $(call SaneBackend,matsushita,Panasonic KV-SS high speed scanners))
315
+$(eval $(call SaneBackend,microtek,Microtek scanners))
316
+$(eval $(call SaneBackend,microtek2,Microtek scanners with SCSI-2 command set))
317
+$(eval $(call SaneBackend,mustek,Mustek SCSI flatbed scanners and some other devices))
318
+# Depends on libieee1284
319
+#$(eval $(call SaneBackend,mustek_pp,Mustek parallel port flatbed scanners,+libieee1284))
320
+$(eval $(call SaneBackend,mustek_usb,Mustek USB flatbed scanners))
321
+$(eval $(call SaneBackend,mustek_usb2,SQ113 based USB flatbed scanners))
322
+$(eval $(call SaneBackend,nec,NEC scanners))
323
+$(eval $(call SaneBackend,net,network backend))
324
+$(eval $(call SaneBackend,niash,scanners based on the NIASH chipset))
325
+$(eval $(call SaneBackend,p5,the Primax PagePartner))
326
+$(eval $(call SaneBackend,pie,PIE Devcom and AdLib SCSI flatbed scanners))
327
+$(eval $(call SaneBackend,pieusb,PIE Devcom and AdLib SCSI flatbed scanners)) #####
328
+$(eval $(call SaneBackend,pixma,Canon Multi-Function Printers and CanoScan Scanners))
329
+$(eval $(call SaneBackend,plustek,LM983[1/2/3] based USB flatbed scanners))
330
+$(eval $(call SaneBackend,plustek_pp,Plustek parallel port flatbed scanners))
331
+$(eval $(call SaneBackend,qcam,Connectix QuickCam cameras,@(TARGET_x86||TARGET_x86_64)))
332
+$(eval $(call SaneBackend,ricoh,Ricoh flatbed scanners))
333
+$(eval $(call SaneBackend,rts8891,rts8891 based scanners))
334
+$(eval $(call SaneBackend,s9036,Siemens 9036 flatbed scanners))
335
+$(eval $(call SaneBackend,sceptre,SCEPTRE scanners))
336
+$(eval $(call SaneBackend,sharp,SHARP scanners))
337
+$(eval $(call SaneBackend,sm3600,Microtek scanners with M011 USB chip))
338
+$(eval $(call SaneBackend,sm3840,Microtek scanners with SCAN08 USB chip))
339
+$(eval $(call SaneBackend,snapscan,AGFA SnapScan flatbed scanners))
340
+$(eval $(call SaneBackend,sp15c,Fujitsu ScanPartner 15C flatbed scanner))
341
+$(eval $(call SaneBackend,st400,Siemens ST/Highscan flatbed scanners))
342
+$(eval $(call SaneBackend,stv680,STV680 cameras))
343
+$(eval $(call SaneBackend,tamarack,Tamarack flatbed scanners))
344
+$(eval $(call SaneBackend,teco1,TECO / RELISYS scanners))
345
+$(eval $(call SaneBackend,teco2,TECO / RELISYS scanners))
346
+$(eval $(call SaneBackend,teco3,TECO / RELISYS scanners))
347
+$(eval $(call SaneBackend,test,testing frontends))
348
+$(eval $(call SaneBackend,u12,Plustek USB flatbed scanners based on older parport designs))
349
+$(eval $(call SaneBackend,umax,UMAX scanners))
350
+$(eval $(call SaneBackend,umax1220u,the UMAX Astra 1220U and similar scanners))
351
+$(eval $(call SaneBackend,umax_pp,Umax Astra parallel port flatbed scanners))
352
+$(eval $(call SaneBackend,v4l,Video for Linux API,+libv4l +libjpeg))
353
+$(eval $(call SaneBackend,xerox_mfp,Xerox Phaser 3200MFP device))
354
+$(eval $(call BuildPackage,sane-backends))
355
+$(eval $(call BuildPackage,sane-backends-all))
356
+$(eval $(call BuildPackage,sane-frontends))

+ 14
- 0
utils/sane-backends/files/xinet.d_sane-port View File

@@ -0,0 +1,14 @@
1
+# default: off
2
+# description: The saned provides scanner service via the network.  \
3
+#	Applications like kooka, xsane or xscanimage can use the remote \
4
+#	scanner. 
5
+service sane-port
6
+{
7
+	socket_type = stream
8
+	port        = 6566
9
+	wait        = no
10
+	user        = root
11
+	group       = root
12
+	server      = /usr/sbin/saned
13
+	disable     = yes
14
+}

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

@@ -0,0 +1,11 @@
1
+--- a/Makefile.in
2
++++ b/Makefile.in
3
+@@ -400,7 +400,7 @@ target_alias = @target_alias@
4
+ top_build_prefix = @top_build_prefix@
5
+ top_builddir = @top_builddir@
6
+ top_srcdir = @top_srcdir@
7
+-SUBDIRS = include lib sanei backend frontend tools doc po testsuite
8
++SUBDIRS = include lib sanei backend frontend
9
+ DIST_SUBDIRS = include lib sanei backend frontend tools doc po japi testsuite
10
+ dist_doc_DATA = AUTHORS ChangeLog COPYING LICENSE NEWS PROBLEMS PROJECTS \
11
+  README README.aix README.beos README.darwin README.djpeg README.freebsd \

+ 16
- 0
utils/sane-backends/patches/020-fix_pieusb.patch View File

@@ -0,0 +1,16 @@
1
+--- a/backend/pieusb_buffer.c
2
++++ b/backend/pieusb_buffer.c
3
+@@ -104,11 +104,13 @@
4
+ 
5
+ /* When creating the release backend, make complains about unresolved external
6
+  * le16toh, although it finds the include <endian.h> */
7
++#ifndef le16toh
8
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
9
+  #define le16toh(x) (x)
10
+ #else
11
+  #define le16toh(x) __bswap_16 (x)
12
+ #endif
13
++#endif
14
+ 
15
+ static void buffer_update_read_index(struct Pieusb_Read_Buffer* buffer, int increment);
16
+ 

+ 61
- 0
utils/sane-backends/patches/030-musl.patch View File

@@ -0,0 +1,61 @@
1
+--- a/include/sane/sanei_udp.h
2
++++ b/include/sane/sanei_udp.h
3
+@@ -27,6 +27,7 @@
4
+ #include <netinet/in.h>
5
+ #include <netdb.h>
6
+ #endif
7
++#include <sys/types.h>
8
+ 
9
+ extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
10
+ extern SANE_Status sanei_udp_open_broadcast(int *fdp);
11
+--- a/backend/kvs20xx_cmd.h
12
++++ b/backend/kvs20xx_cmd.h
13
+@@ -9,6 +9,8 @@
14
+    Panasonic KV-S20xx USB-SCSI scanners.
15
+ */
16
+ 
17
++#include <sys/types.h>
18
++
19
+ #define COMMAND_BLOCK	1
20
+ #define DATA_BLOCK	2
21
+ #define RESPONSE_BLOCK	3
22
+--- a/backend/kvs40xx.h
23
++++ b/backend/kvs40xx.h
24
+@@ -10,6 +10,7 @@
25
+ 
26
+ #include "../include/sane/config.h"
27
+ #include <semaphore.h>
28
++#include <sys/types.h>
29
+ 
30
+ #undef  BACKEND_NAME
31
+ #define BACKEND_NAME kvs40xx
32
+--- a/backend/hp5400.c
33
++++ b/backend/hp5400.c
34
+@@ -67,6 +67,7 @@
35
+ #include <stdlib.h>		/* malloc, free */
36
+ #include <string.h>		/* memcpy */
37
+ #include <stdio.h>
38
++#include <sys/types.h>
39
+ 
40
+ 
41
+ #define HP5400_CONFIG_FILE "hp5400.conf"
42
+--- a/backend/hp5590.c
43
++++ b/backend/hp5590.c
44
+@@ -48,6 +48,7 @@
45
+ #include <stdio.h>
46
+ #include <string.h>
47
+ #include <unistd.h>
48
++#include <sys/types.h>
49
+ 
50
+ #include "../include/sane/sane.h"
51
+ #define BACKEND_NAME hp5590
52
+--- a/backend/epsonds-io.c
53
++++ b/backend/epsonds-io.c
54
+@@ -16,6 +16,7 @@
55
+ #include "sane/config.h"
56
+ #include <ctype.h>
57
+ #include <unistd.h>     /* sleep */
58
++#include <sys/types.h>
59
+ 
60
+ #include "epsonds.h"
61
+ #include "epsonds-io.h"

+ 38
- 0
utils/sane-backends/patches/031-fix_uclibc.patch View File

@@ -0,0 +1,38 @@
1
+--- a/configure.in
2
++++ b/configure.in
3
+@@ -279,6 +279,9 @@ dnl ************************************
4
+ dnl Checks for library functions
5
+ dnl ***********************************************************************
6
+ 
7
++dnl Check mkostemp (missing in uclibc)
8
++AC_CHECK_FUNC(mkostemp)
9
++
10
+ dnl Define SOCKET_LIB, NSL_LIB, BIND_LIB, and RESOLV_LIB  when required 
11
+ dnl for functions we use.
12
+ AC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(bind, gethostbyaddr, BIND_LIB="-lbind")])
13
+--- a/include/sane/config.h.in
14
++++ b/include/sane/config.h.in
15
+@@ -207,6 +207,9 @@
16
+ /* Define to 1 if you have the `mkdir' function. */
17
+ #undef HAVE_MKDIR
18
+ 
19
++/* Define to 1 if you have a working `mkostemp' function. */
20
++#undef HAVE_MKOSTEMP
21
++
22
+ /* Define to 1 if you have a working `mmap' system call. */
23
+ #undef HAVE_MMAP
24
+ 
25
+--- a/backend/pieusb_buffer.c
26
++++ b/backend/pieusb_buffer.c
27
+@@ -112,6 +112,11 @@
28
+ #endif
29
+ #endif
30
+ 
31
++#ifndef HAVE_MKOSTEMP
32
++/* uclibc might not implement mkostemp GNU extension */
33
++#define mkostemp(template, flags) mkstemp(template)
34
++#endif
35
++
36
+ static void buffer_update_read_index(struct Pieusb_Read_Buffer* buffer, int increment);
37
+ 
38
+ /* READER */

+ 11
- 0
utils/sane-backends/patches/050-remove_linked_libs_for_unused_preload.patch View File

@@ -0,0 +1,11 @@
1
+--- a/backend/Makefile.am
2
++++ b/backend/Makefile.am
3
+@@ -1142,7 +1142,7 @@ EXTRA_DIST += dll.aliases
4
+ nodist_libsane_la_SOURCES =  dll-s.c
5
+ libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll
6
+ libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS)
7
+-libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
8
++libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
9
+ 
10
+ # WARNING: Automake is getting this wrong so have to do it ourselves.
11
+ libsane_la_DEPENDENCIES = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo @SANEI_SANEI_JPEG_LO@