You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

354 lines
13 KiB

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