summaryrefslogtreecommitdiff
path: root/media-gfx/sane-backends
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-04-02 17:36:40 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-04-02 17:36:40 +0100
commit171a011ad3a131671aeb5a98b9e3adf219ad2865 (patch)
tree0c877a3d1a37f10e37ad7168cfc52054aa0948a7 /media-gfx/sane-backends
parent75fc75ae1f0481ffdb78450e801a9b443ba641bd (diff)
gentoo resync : 02.04.2018
Diffstat (limited to 'media-gfx/sane-backends')
-rw-r--r--media-gfx/sane-backends/Manifest3
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.27-canon-lide-100.patch17
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.27-network.patch42
-rw-r--r--media-gfx/sane-backends/sane-backends-1.0.27-r1.ebuild340
4 files changed, 402 insertions, 0 deletions
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest
index 5fc935b0f6e4..8bf6730485ba 100644
--- a/media-gfx/sane-backends/Manifest
+++ b/media-gfx/sane-backends/Manifest
@@ -1,10 +1,13 @@
AUX sane-backends-1.0.24-saned_pidfile_location.patch 345 BLAKE2B dcf7cbd5787c7a225450e03663e7c1ca69dd40fc58e3de9d994fde6a66635d6a3ca20d2886fe7cbc6a7ed3202f8f3a8c7e3d9ea4072b4418a7a43048427a06c3 SHA512 49519b8fea68292b8cbd7bdcaf5b4803a1b890800e17015ace1d662e4503cc0844f191793c8f42cd6aa7e9922ee9f961d4784e30f22abc497973be1978bf1b24
+AUX sane-backends-1.0.27-canon-lide-100.patch 907 BLAKE2B 3e625443b48e2f03d1d095c1d3d2651abf1ea073ca7bbd439ef389906ed683d7f8b43123e7a9cc6360703f1b66886ff2cb6a7428984e4073496b890ed240e9bb SHA512 870dc11926df5ef0c38588336c8d69cfa11ebf9d3355f26eec4e5178fe2dac6e8ffc576980a4b5789cdb7155fbcc97a35300c63ba4e9e1ebbdd0702c563d09f3
AUX sane-backends-1.0.27-disable-usb-tests.patch 336 BLAKE2B 00fd225a4426405d515f5b6641c86e6d9035a588a776aaec26eaa4e10beebf0a9fd97da991646b7964a867c422da2bc1cf93560d1ba326f0086675036338ff00 SHA512 64cce489e87de31e1a865b86d5829ae4914a30f47e27b07fba68629261cefcd617b8eed272c94b7554545e4802283c5bd5b53f79f54403d875726b38378ae74d
+AUX sane-backends-1.0.27-network.patch 1022 BLAKE2B bcc929635fe62af4201f474cddd141b95bf1b7520f7279b713771ed9614990b3331ec1b42f309d88e375d6c9cffacb7195e7e3f063e491bb9cd6e4ae39f79eea SHA512 04b65a06d2c76dde6fce501ba823e999eb89ea41573f887f9e7d5347f3aa5e35310fad69313e99f873640e29a9849372d2ff995678593a0781fba73b464bec0d
AUX saned 150 BLAKE2B 306d57a0c09856b387c3c50eb27aaafdb194972c2fdb5d1cb7de3118f0c71cf234898ce958f0d6bd17a5e1f2b5bde458e014a7bfdec52403a6204ebf51aee039 SHA512 26f3d66c6b1e75d87d7d430518aa878c77d5ab8d76a45847cef3ff15566341938eedf46c50d0fa8cdeef828df9cddefdd6fdd767c5de30d3aa7d64ed1911d910
AUX saned.confd 76 BLAKE2B cac74b6f117f7f78a71b951433bc6b155f8641e2cf1bd747871165764e97ed368d10551075761c34ff01f51f7cae1b8a9c5692fb9666a300b45134fe255ea3c1 SHA512 8f4a99ef24c19b3a7213b3d25ea16f5bca8623735cf25d21e3a706e9e0135ac8cce5d0b8fb8728845977f41dcefe6bd858076d755515fc91b00e05ee5817d751
AUX saned.initd 294 BLAKE2B 571bd4032b2330c627a31459a18baf2044852ec1b40f0216bd5b5a546d61133522cdc98c7011669feaadc2d030ffeb49a86130075f22a18edab5f4c925780681 SHA512 655200141339f14bf7fc6f4fff3403cf9504809b7f023aa5425aad691c5baa65772100da0a6311669f83ed1dce73b7d65ca20aa31345b13c48dfdb1b30ce5dbd
AUX saned.socket 132 BLAKE2B 5e9f0350a1553fc75aea88ce355fb68b881e3b2194ac0e3c6f3cecdae79111fb1db1cfe3b4933eca15af5f985fc6b89e4d9af3844b6e9cfd542828b6b9e57ed9 SHA512 a23ceeeb02bd9e214702003a3165886858ecbdd93df89cd37ad5f00581745454548ccda0ab656f2dc0acbf2896a8781568c786797e64a07014be003d6140a093
AUX saned_at.service 434 BLAKE2B 6dad3c809e01c17c0064a52c4103486b19294ed3cf8fc71faad18edaf71b920584366ac988d354f45bc07607ea64a97ea480fe152ac9a1cd896df99ff457cbf7 SHA512 891c751261107676f8159f403e0f4d4254099b709b9ba0ac9f2af97a9ed30f677411ad6bc316c2e6e673c616ba988253479d5e30c9617e3ae279beb79f70e965
DIST sane-backends-1.0.27.tar.gz 6430188 BLAKE2B 90f910311e31a436eaa0ca0fedd998aac3331f89a346f31613776ebc860a10cc37055fd15db8de8d743498914ea0c16e4153dbaa101380eb6e36857d730c3456 SHA512 c6552768bfc10216730fc11011c82f74ca0952182019ded3916072147ec09be5c975ce1d37dc3ccea050c488dbdf983c2ca17dcd702644060ba796ae2591f9c5
+EBUILD sane-backends-1.0.27-r1.ebuild 7738 BLAKE2B d1762f06249a0e150259fe18704e10585b758754fde385b4470adce6e5df3a80d102fffc2c25a8ab753b2463a82a06e20ee30759f3361c329ed65cfd89e14a60 SHA512 e518104ed334885f03239833fc58c7f50e2818d2145cdb2c23940b497d2788b437134dd2b596eedbbedcffc8c8eefce8892e1369bfdec4c1c13b17b9a1912200
EBUILD sane-backends-1.0.27.ebuild 7913 BLAKE2B f6cdfc03d373fbad3872fdc6f7686d3b006e365860851f821eded0f0cbc661f8ed1d176f6032ca2abfd706afc2846185f09a134ace637e896f3c2e067b748385 SHA512 c228f459e1e62095aa57f75018cd63773cf6c55ef6e24ff28123476f43d8a9798d27d6cc2b6f4d85a79736d824ebc5ca4216199e527158781cf698bcc62b2620
MISC metadata.xml 166 BLAKE2B c254f1fb642881aba57637be14fb0a89b10384f91a128feaec3a8c870d76efc2cbacb92caccc0dee2dd19a5ac5eaf8643080dafa05c4e2ac96a68568927e5afd SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.27-canon-lide-100.patch b/media-gfx/sane-backends/files/sane-backends-1.0.27-canon-lide-100.patch
new file mode 100644
index 000000000000..504f9e666e62
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.27-canon-lide-100.patch
@@ -0,0 +1,17 @@
+diff -up sane-backends-1.0.27/backend/genesys.c.canon-lide-100 sane-backends-1.0.27/backend/genesys.c
+--- sane-backends-1.0.27/backend/genesys.c.canon-lide-100 2018-02-01 10:37:26.160044539 +0100
++++ sane-backends-1.0.27/backend/genesys.c 2018-02-01 10:45:44.616653277 +0100
+@@ -2070,11 +2070,9 @@ genesys_white_shading_calibration (Genes
+ dev->model->cmd_set->set_lamp_power (dev, dev->calib_reg, SANE_TRUE);
+ dev->model->cmd_set->set_motor_power (dev->calib_reg, motor);
+
+- /* if needed, go back before doin next scan, by using rewind, registers and
+- * slopes table are kept intact from previous scan */
+- if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK && dev->model->cmd_set->rewind)
++ if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK)
+ {
+- status = dev->model->cmd_set->rewind (dev);
++ status = dev->model->cmd_set->slow_back_home (dev, SANE_TRUE);
+ }
+
+ status =
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.27-network.patch b/media-gfx/sane-backends/files/sane-backends-1.0.27-network.patch
new file mode 100644
index 000000000000..2605ea83578d
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.27-network.patch
@@ -0,0 +1,42 @@
+diff --git a/sanei/sanei_tcp.c b/sanei/sanei_tcp.c
+index a57d7c7..d0a1e92 100644
+--- a/sanei/sanei_tcp.c
++++ b/sanei/sanei_tcp.c
+@@ -45,6 +45,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <time.h>
+
+ #ifdef HAVE_WINSOCK2_H
+ #include <winsock2.h>
+@@ -123,14 +124,27 @@ sanei_tcp_write(int fd, const u_char * buf, int count)
+ ssize_t
+ sanei_tcp_read(int fd, u_char * buf, int count)
+ {
+- ssize_t bytes_recv = 0, rc = 1;
++ ssize_t bytes_recv = 0, rc = 1;
++ int retry = 5;
+
+ while (bytes_recv < count && rc > 0)
+ {
+ rc = recv(fd, buf+bytes_recv, count-bytes_recv, 0);
++ DBG(1, "%s: bytes received %d\n", __FUNCTION__, rc);
+ if (rc > 0)
+ bytes_recv += rc;
+-
++ else {
++ if ( errno == EAGAIN && retry-- ) {
++ DBG(1, "%s: waiting %d\n", __FUNCTION__, retry);
++ /* wait for max 1s */
++ struct timespec req;
++ struct timespec rem;
++ req.tv_sec = 0;
++ req.tv_nsec= 100000000;
++ nanosleep(&req, &rem);
++ rc = 1;
++ }
++ }
+ }
+ return bytes_recv;
+ }
diff --git a/media-gfx/sane-backends/sane-backends-1.0.27-r1.ebuild b/media-gfx/sane-backends/sane-backends-1.0.27-r1.ebuild
new file mode 100644
index 000000000000..4b7b9d954cdb
--- /dev/null
+++ b/media-gfx/sane-backends/sane-backends-1.0.27-r1.ebuild
@@ -0,0 +1,340 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic multilib-minimal systemd toolchain-funcs udev user xdg-utils
+
+# gphoto and v4l are handled by their usual USE flags.
+# The pint backend was disabled because I could not get it to compile.
+IUSE_SANE_BACKENDS="
+ abaton
+ agfafocus
+ apple
+ artec
+ artec_eplus48u
+ as6e
+ avision
+ bh
+ canon
+ canon630u
+ canon_dr
+ canon_pp
+ cardscan
+ coolscan
+ coolscan2
+ coolscan3
+ dc210
+ dc240
+ dc25
+ dell1600n_net
+ dmc
+ epjitsu
+ epson
+ epson2
+ fujitsu
+ genesys
+ gt68xx
+ hp
+ hp3500
+ hp3900
+ hp4200
+ hp5400
+ hp5590
+ hpljm1005
+ hpsj5s
+ hs2p
+ ibm
+ kodak
+ kodakaio
+ kvs1025
+ kvs20xx
+ kvs40xx
+ leo
+ lexmark
+ ma1509
+ magicolor
+ matsushita
+ microtek
+ microtek2
+ mustek
+ mustek_pp
+ mustek_usb
+ mustek_usb2
+ nec
+ net
+ niash
+ p5
+ pie
+ pixma
+ plustek
+ plustek_pp
+ pnm
+ qcam
+ ricoh
+ rts8891
+ s9036
+ sceptre
+ sharp
+ sm3600
+ sm3840
+ snapscan
+ sp15c
+ st400
+ stv680
+ tamarack
+ teco1
+ teco2
+ teco3
+ test
+ u12
+ umax
+ umax1220u
+ umax_pp
+ xerox_mfp"
+
+IUSE="gphoto2 ipv6 snmp systemd threads usb v4l xinetd zeroconf"
+
+for backend in ${IUSE_SANE_BACKENDS}; do
+ case ${backend} in
+ # Disable backends that require parallel ports as no one has those anymore.
+ canon_pp|hpsj5s|mustek_pp|\
+ pnm)
+ IUSE+=" -sane_backends_${backend}"
+ ;;
+ mustek_usb2|kvs40xx)
+ IUSE+=" sane_backends_${backend}"
+ ;;
+ *)
+ IUSE+=" +sane_backends_${backend}"
+ esac
+done
+
+REQUIRED_USE="
+ sane_backends_mustek_usb2? ( threads )
+ sane_backends_kvs40xx? ( threads )
+"
+
+DESCRIPTION="Scanner Access Now Easy - Backends"
+HOMEPAGE="http://www.sane-project.org/"
+MY_P="${P}"
+FRS_ID="4224"
+SRC_URI="https://alioth.debian.org/frs/download.php/file/${FRS_ID}/${P}.tar.gz"
+
+LICENSE="GPL-2 public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
+ sane_backends_dell1600n_net? (
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
+ >=media-libs/tiff-3.9.7-r1:0=[${MULTILIB_USEDEP}]
+ )
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] )
+ gphoto2? (
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
+ )
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
+ xinetd? ( sys-apps/xinetd )
+ snmp? ( net-analyzer/net-snmp )
+ systemd? ( sys-apps/systemd:0= )
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="${RDEPEND}
+ v4l? ( sys-kernel/linux-headers )
+ >=sys-devel/gettext-0.18.1
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device)
+RDEPEND="${RDEPEND}
+ !<sys-fs/udev-114
+"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/sane-config
+)
+
+pkg_setup() {
+ enewgroup scanner
+ enewuser saned -1 -1 -1 scanner
+}
+
+src_prepare() {
+ default
+
+ xdg_environment_reset
+
+ cat >> backend/dll.conf.in <<-EOF
+ # Add support for the HP-specific backend. Needs net-print/hplip installed.
+ hpaio
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed.
+ epkowa
+ EOF
+
+ eapply "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch
+ eapply "${FILESDIR}"/${PN}-1.0.27-disable-usb-tests.patch
+
+ # From Arch
+ eapply "${FILESDIR}"/${PN}-1.0.27-network.patch
+
+ # From Fedora
+ # Fix https://bugs.gentoo.org/635348
+ eapply "${FILESDIR}"/${PN}-1.0.27-canon-lide-100.patch
+
+ # Fix for "make check". Upstream sometimes forgets to update this.
+ local ver=$(./configure --version | awk '{print $NF; exit 0}')
+ sed -i \
+ -e "/by sane-desc 3.5 from sane-backends/s:sane-backends .*:sane-backends ${ver}:" \
+ testsuite/tools/data/html* || die
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing # From Fedora
+
+ # if LINGUAS is set, just use the listed and supported localizations.
+ if [[ ${LINGUAS+set} == "set" ]]; then
+ mkdir -p po || die
+ strip-linguas -u po
+ printf '%s\n' ${LINGUAS} > po/LINGUAS
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # the blank is intended - an empty string would result in building ALL backends.
+ local BACKENDS=" "
+
+ use gphoto2 && BACKENDS="gphoto2"
+ use v4l && BACKENDS="${BACKENDS} v4l"
+ for backend in ${IUSE_SANE_BACKENDS}; do
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then
+ BACKENDS="${BACKENDS} ${backend}"
+ fi
+ done
+
+ local myconf=(
+ $(use_with usb)
+ $(multilib_native_use_with snmp)
+ )
+
+ # you can only enable this backend, not disable it...
+ if use sane_backends_pnm; then
+ myconf+=( --enable-pnm-backend )
+ fi
+ if use sane_backends_mustek_pp; then
+ myconf+=( --enable-parport-directio )
+ fi
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then
+ myconf+=( sane_cv_use_libieee1284=no )
+ fi
+
+ # relative path must be used for tests to work properly
+ ECONF_SOURCE=${S} \
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
+ BACKENDS="${BACKENDS}" \
+ econf \
+ $(use_with gphoto2) \
+ $(multilib_native_use_with systemd) \
+ $(use_with v4l) \
+ $(use_enable ipv6) \
+ $(use_enable threads pthread) \
+ $(use_enable zeroconf avahi) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake VARTEXFONTS="${T}/fonts"
+
+ if tc-is-cross-compiler; then
+ pushd "${BUILD_DIR}"/tools >/dev/null || die
+
+ # The build system sucks and doesn't handle this properly.
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366
+ tc-export_build_env BUILD_CC
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+ -I. -I../include -I"${S}"/include \
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die
+ local dirs=( hal hotplug hotplug-ng udev )
+ local targets=(
+ hal/libsane.fdi
+ hotplug/libsane.usermap
+ hotplug-ng/libsane.db
+ udev/libsane.rules
+ )
+ mkdir -p "${dirs[@]}" || die
+ emake "${targets[@]}"
+
+ popd >/dev/null
+ fi
+
+ if use usb; then
+ sed -i -e '/^$/d' \
+ tools/hotplug/libsane.usermap || die
+ fi
+}
+
+multilib_src_install() {
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \
+ docdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ if multilib_is_native_abi; then
+ if use usb; then
+ insinto /etc/hotplug/usb
+ doins tools/hotplug/libsane.usermap
+ fi
+
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules
+ insinto "/usr/share/pkgconfig"
+ doins tools/sane-backends.pc
+ fi
+}
+
+multilib_src_install_all() {
+ keepdir /var/lib/lock/sane
+ fowners root:scanner /var/lib/lock/sane
+ fperms g+w /var/lib/lock/sane
+ dodir /etc/env.d
+
+ if use systemd; then
+ systemd_newunit "${FILESDIR}"/saned_at.service "saned@.service"
+ systemd_newunit "${FILESDIR}"/saned.socket saned.socket
+ fi
+
+ if use usb; then
+ exeinto /etc/hotplug/usb
+ doexe tools/hotplug/libusbscanner
+ newdoc tools/hotplug/README README.hotplug
+ fi
+
+ dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux
+ find "${D}" -name '*.la' -delete || die
+
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ doins "${FILESDIR}"/saned
+ fi
+
+ newinitd "${FILESDIR}"/saned.initd saned
+ newconfd "${FILESDIR}"/saned.confd saned
+}
+
+pkg_postinst() {
+ if use xinetd; then
+ elog "If you want remote clients to connect, edit"
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow"
+ fi
+
+ if ! use systemd; then
+ elog "If you are using a USB scanner, add all users who want"
+ elog "to access your scanner to the \"scanner\" group."
+ fi
+}