sane-backends: upgraded package to upstream

Upgraded media-gfx/sane-backends to version 1.0.25 for all

BUG=chromium:550311
TEST=pre-cq passes

Change-Id: Ic47f961503966012dda5e3fb23026a55e8fafb19
Reviewed-on: https://chromium-review.googlesource.com/310560
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest
index d25a6cb..fe1bde9 100644
--- a/media-gfx/sane-backends/Manifest
+++ b/media-gfx/sane-backends/Manifest
@@ -1 +1 @@
-DIST sane-backends-git20150628.tar.gz 5765552 SHA256 4cfd1245df8ade75cbfaedec91b1daaea6d30e0736e5d2f9afcd0a56fc357711 SHA512 8e8160b2337502a0b77724ffaa5bd65a6daaa3fa5587f1b72e2714c9253e8130e96170d7f1de38210e17c5524cbe0953ff0464d29db194354d4e9b7249782eaf WHIRLPOOL d9b9a4f44cb3fcda9c8099d5ed3a9764e0a961f80ae1a89dda4e0ec8e6c24c830ad0feebd13c28af848c133a99e50d21c2f01269e434af31b17164a377edbbff
+DIST sane-backends-1.0.25.tar.gz 5955016 SHA256 a4d7ba8d62b2dea702ce76be85699940992daf3f44823ddc128812da33dc6e2c SHA512 b9548646fff13558a4da4a4e9e8bad730f05121bcc65b72d24ded3bfddc6fe574e08c39c8651544b8fbfeab036fffd76cc14d76ef5d5d47e7513a2ce3afcc9df WHIRLPOOL 557a3ac8785c0dd7f98aa55d5edaf76fb5b2b3c86a2431bb40b5b132ac05de3abcb250a8bcf8ed188868c4f124ce0a323a92a5a83c7b44a20908fe40ca323711
diff --git a/media-gfx/sane-backends/files/niash_array_index.patch b/media-gfx/sane-backends/files/niash_array_index.patch
deleted file mode 100644
index 236c459..0000000
--- a/media-gfx/sane-backends/files/niash_array_index.patch
+++ /dev/null
@@ -1,140 +0,0 @@
---- backend/niash.c	2010-12-02 00:49:58.000000000 +0100
-+++ backend/niash.c.new	2011-09-21 20:09:07.000000000 +0200
-@@ -82,14 +82,7 @@
-   optThreshold,
- 
- 
--  optLast,
--/* put temporarily disabled options here after optLast */
--
--  optGroupMisc,
--  optLamp,
--
--  optCalibrate,
--  optGamma                      /* analog gamma = single number */
-+  optLast
- } EOptionIndex;
- 
- 
-@@ -685,17 +678,6 @@
-           pDesc->size = 0;
-           break;
- 
--        case optGamma:
--          pDesc->name = SANE_NAME_ANALOG_GAMMA;
--          pDesc->title = SANE_TITLE_ANALOG_GAMMA;
--          pDesc->desc = SANE_DESC_ANALOG_GAMMA;
--          pDesc->type = SANE_TYPE_FIXED;
--          pDesc->constraint_type = SANE_CONSTRAINT_RANGE;
--          pDesc->constraint.range = &rangeGamma;
--          pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
--          pVal->w = startUpGamma;
--          break;
--
-         case optGammaTable:
-           pDesc->name = SANE_NAME_GAMMA_VECTOR;
-           pDesc->title = SANE_TITLE_GAMMA_VECTOR;
-@@ -707,31 +689,6 @@
-           pVal->wa = s->aGammaTable;
-           break;
- 
--        case optGroupMisc:
--          pDesc->title = SANE_I18N ("Miscellaneous");
--          pDesc->type = SANE_TYPE_GROUP;
--          pDesc->size = 0;
--          break;
--
--        case optLamp:
--          pDesc->name = "lamp";
--          pDesc->title = SANE_I18N ("Lamp status");
--          pDesc->desc = SANE_I18N ("Switches the lamp on or off.");
--          pDesc->type = SANE_TYPE_BOOL;
--          pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
--          /* switch the lamp on when starting for first the time */
--          pVal->w = SANE_TRUE;
--          break;
--
--        case optCalibrate:
--          pDesc->name = "calibrate";
--          pDesc->title = SANE_I18N ("Calibrate");
--          pDesc->desc = SANE_I18N ("Calibrates for black and white level.");
--          pDesc->type = SANE_TYPE_BUTTON;
--          pDesc->cap = SANE_CAP_SOFT_SELECT;
--          pDesc->size = 0;
--          break;
--
-         case optGroupMode:
-           pDesc->title = SANE_I18N ("Scan Mode");
-           pDesc->desc = "";
-@@ -1007,7 +964,6 @@
-           /* Get options of type SANE_Word */
-         case optCount:
-         case optDPI:
--        case optGamma:
-         case optTLX:
-         case optTLY:
-         case optBRX:
-@@ -1031,17 +987,6 @@
-           strcpy ((char *) pVal, modeList[s->aValues[optMode].w]);
-           break;
- 
--          /* Get options of type SANE_Bool */
--        case optLamp:
--          GetLamp (&s->HWParams, &fLampIsOn);
--          *(SANE_Bool *) pVal = fLampIsOn;
--          break;
--
--        case optCalibrate:
--          /*  although this option has nothing to read,
--             it's added here to avoid a warning when running scanimage --help */
--          break;
--
-         default:
-           DBG (DBG_MSG, "SANE_ACTION_GET_VALUE: Invalid option (%d)\n", n);
-         }
-@@ -1061,7 +1006,6 @@
-         case optCount:
-           return SANE_STATUS_INVAL;
- 
--        case optGamma:
-         case optThreshold:
-         case optDPI:
- 
-@@ -1089,15 +1033,7 @@
-           DBG (DBG_MSG,
-                "sane_control_option: SANE_ACTION_SET_VALUE %d = %d\n", n,
-                (int) s->aValues[n].w);
--          if (n == optGamma)
--            {
--              if (!fSame && optLast > optGammaTable)
--                {
--                  info |= SANE_INFO_RELOAD_OPTIONS;
--                }
--              _SetScalarGamma (s->aGammaTable, s->aValues[n].w);
--            }
--          break;
-+         break;
- 
-         case optGammaTable:
-           DBG (DBG_MSG, "Writing gamma table\n");
-@@ -1158,20 +1094,6 @@
-           break;
- 
- 
--
--        case optLamp:
--          fVal = *(SANE_Bool *) pVal;
--          DBG (DBG_MSG, "lamp %s\n", fVal ? "on" : "off");
--          if (fVal)
--            _WarmUpLamp (s, WARMUP_INSESSION);
--          else
--            SetLamp (&s->HWParams, SANE_FALSE);
--          break;
--
--        case optCalibrate:
--/*       SimpleCalib(&s->HWParams); */
--          break;
--
-         default:
-           DBG (DBG_ERR, "SANE_ACTION_SET_VALUE: Invalid option (%d)\n", n);
-         }
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch
deleted file mode 100644
index 7db51b0..0000000
--- a/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-sent upstream:
-https://lists.alioth.debian.org/pipermail/sane-devel/2015-July/033601.html
-
-From 867c8fcde5cf54afae7f9ae8f855605b891708a7 Mon Sep 17 00:00:00 2001
-From: Christopher Brannon <teiresias@gentoo.org>
-Date: Wed, 8 Jul 2015 06:37:14 -0400
-Subject: [PATCH] add a configure flag to control systemd support
-
-This way people can easily disable systemd support locally.
----
- configure.in | 29 ++++++++++++++++++-----------
- 1 file changed, 18 insertions(+), 11 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index 059058b..b539cda 100644
---- a/configure.in
-+++ b/configure.in
-@@ -343,17 +343,24 @@ dnl 	$as_echo "in order to autodetect network scanners in kodakaio."
- dnl 	with_cups="no"
- dnl fi
- 
--dnl added by llagendijk 12/7/2012 to detect systemd for saned
--$as_echo_n "Checking for systemd..."
--if test -e /usr/include/systemd/sd-daemon.h ; then
--    AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
--    with_systemd="yes"
--    SYSTEMD_LIBS=" -lsystemd-daemon"
--    AC_SUBST(SYSTEMD_LIBS)
--    $as_echo "yes"
--else
--    with_systemd="no"
--    $as_echo "no"
-+AC_ARG_WITH(systemd,
-+	AC_HELP_STRING([--with-systemd], [enable systemd support @<:@default=yes@:>@]))
-+if test "x$with_systemd" != xno ; then
-+    dnl added by llagendijk 12/7/2012 to detect systemd for saned
-+    $as_echo_n "Checking for systemd..."
-+    if test -e /usr/include/systemd/sd-daemon.h ; then
-+	AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
-+	have_systemd="yes"
-+	SYSTEMD_LIBS=" -lsystemd-daemon"
-+	AC_SUBST(SYSTEMD_LIBS)
-+	$as_echo "yes"
-+    else
-+	have_systemd="no"
-+	$as_echo "no"
-+	if test "x$with_systemd" = xyes; then
-+	    AC_MSG_ERROR([Systemd support was requested but systemd was not found])
-+	fi
-+    fi
- fi
- 
- dnl ***********
--- 
-2.4.4
-
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-cross-compile.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-cross-compile.patch
deleted file mode 100644
index d66edac..0000000
--- a/media-gfx/sane-backends/files/sane-backends-1.0.24-cross-compile.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-sent upstream:
-https://lists.alioth.debian.org/pipermail/sane-devel/2015-July/033600.html
-
-From c8df148e2b9784be1827e33224baa1cb5066a383 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@chromium.org>
-Date: Wed, 8 Jul 2015 06:31:12 -0400
-Subject: [PATCH] fix cross-compiling paths
-
-There's no reason to hardcode -I paths to /usr/local.  Doing so breaks
-cross-compiling when incompatible headers live in there or the toolchain
-is set up to throw errors with those flags.
----
- configure.in | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/configure.in b/configure.in
-index 48953d2..059058b 100644
---- a/configure.in
-+++ b/configure.in
-@@ -82,7 +82,6 @@ AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
- dnl ***********************************************************************
- dnl set compiler/linker flags
- dnl ***********************************************************************
--INCLUDES="${INCLUDES} -I/usr/local/include"
- AC_SUBST(INCLUDES)
- SANE_SET_CFLAGS([$is_release])
- SANE_SET_LDFLAGS
--- 
-2.4.4
-
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch
deleted file mode 100644
index b87ca8a..0000000
--- a/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-sent upstream:
-https://lists.alioth.debian.org/pipermail/sane-devel/2015-July/033602.html
-
-From 1dcfb42608a27fbdebdaa721b4e48354850a7dcc Mon Sep 17 00:00:00 2001
-From: Christopher Brannon <teiresias@gentoo.org>
-Date: Wed, 8 Jul 2015 06:38:50 -0400
-Subject: [PATCH] use pkg-config to look up systemd paths
-
-Since systemd has always shipped pkg-config files, we should use them.
-This also fixes cross-compiling by not relying on hardcoded host paths.
----
- configure.in | 25 +++++++++++--------------
- 1 file changed, 11 insertions(+), 14 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index b539cda..5e703a8 100644
---- a/configure.in
-+++ b/configure.in
-@@ -346,21 +346,18 @@ dnl fi
- AC_ARG_WITH(systemd,
- 	AC_HELP_STRING([--with-systemd], [enable systemd support @<:@default=yes@:>@]))
- if test "x$with_systemd" != xno ; then
--    dnl added by llagendijk 12/7/2012 to detect systemd for saned
--    $as_echo_n "Checking for systemd..."
--    if test -e /usr/include/systemd/sd-daemon.h ; then
--	AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
--	have_systemd="yes"
--	SYSTEMD_LIBS=" -lsystemd-daemon"
--	AC_SUBST(SYSTEMD_LIBS)
--	$as_echo "yes"
--    else
--	have_systemd="no"
--	$as_echo "no"
--	if test "x$with_systemd" = xyes; then
--	    AC_MSG_ERROR([Systemd support was requested but systemd was not found])
--	fi
-+  PKG_CHECK_MODULES(SYSTEMD, [libsystemd], have_systemd=yes, have_systemd=no)
-+  if test "x$have_systemd" = xno; then
-+    PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon], have_systemd=yes, have_systemd=no)
-+  fi
-+  if test "x$have_systemd" = xyes; then
-+    AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
-+    AC_SUBST(SYSTEMD_LIBS)
-+  else
-+    if test "x$with_systemd" = xyes; then
-+      AC_MSG_ERROR([Systemd support was requested but systemd was not found])
-     fi
-+  fi
- fi
- 
- dnl ***********
--- 
-2.4.4
-
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.25-disable-usb-tests.patch b/media-gfx/sane-backends/files/sane-backends-1.0.25-disable-usb-tests.patch
new file mode 100644
index 0000000..217a440
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.25-disable-usb-tests.patch
@@ -0,0 +1,14 @@
+do not let the tests try reading/locking usb hardware.  we also disable
+this because the test will abort() if no usb support is found at all.
+
+--- a/testsuite/sanei/sanei_usb_test.c
++++ b/testsuite/sanei/sanei_usb_test.c
+@@ -832,6 +832,8 @@ main (int argc, char **argv)
+   int detected, opened, i;
+   SANE_Int dn[MAX_DEVICES];
+ 
++  return 77;
++
+ #ifdef HAVE_LIBUSB
+   printf ("\n%s built with old libusb\n\n", argv[0]);
+ #endif
diff --git a/media-gfx/sane-backends/files/saned.initd b/media-gfx/sane-backends/files/saned.initd
index 26498dd..dd07f0a 100644
--- a/media-gfx/sane-backends/files/saned.initd
+++ b/media-gfx/sane-backends/files/saned.initd
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/files/saned.initd,v 1.1 2013/03/15 08:15:52 phosphan Exp $
+# $Id$
 
 pidfile="/var/run/saned/saned.pid"
 command="/usr/sbin/saned"
diff --git a/media-gfx/sane-backends/sane-backends-1.0.25_pre20150628.ebuild b/media-gfx/sane-backends/sane-backends-1.0.25.ebuild
similarity index 82%
rename from media-gfx/sane-backends/sane-backends-1.0.25_pre20150628.ebuild
rename to media-gfx/sane-backends/sane-backends-1.0.25.ebuild
index 94baaf9..9225d32 100644
--- a/media-gfx/sane-backends/sane-backends-1.0.25_pre20150628.ebuild
+++ b/media-gfx/sane-backends/sane-backends-1.0.25.ebuild
@@ -1,10 +1,10 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/sane-backends-1.0.25_pre20150628.ebuild,v 1.4 2015/08/06 05:47:07 vapier Exp $
+# $Id$
 
 EAPI="5"
 
-inherit autotools eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs
+inherit eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs
 
 # gphoto and v4l are handled by their usual USE flags.
 # The pint backend was disabled because I could not get it to compile.
@@ -118,33 +118,45 @@
 
 DESCRIPTION="Scanner Access Now Easy - Backends"
 HOMEPAGE="http://www.sane-project.org/"
-if [[ ${PV} == *_pre* ]] ; then
+case ${PV} in
+9999)
+	EGIT_REPO_URI="git://anonscm.debian.org/sane/sane-backends.git"
+	inherit git-r3 autotools
+	;;
+*_pre*)
 	MY_P="${PN}-git${PV#*_pre}"
 	SRC_URI="http://www.sane-project.org/snapshots/${MY_P}.tar.gz
 		mirror://gentoo/${MY_P}.tar.gz"
 	S=${WORKDIR}/${MY_P}
-else
+	;;
+*)
 	MY_P=${P}
-	SRC_URI="https://alioth.debian.org/frs/download.php/file/3958/${P}.tar.gz"
-fi
+	FRS_ID="4146"
+	SRC_URI="https://alioth.debian.org/frs/download.php/file/${FRS_ID}/${P}.tar.gz"
+	;;
+esac
 
 LICENSE="GPL-2 public-domain"
 SLOT="0"
-KEYWORDS="*"
+if [[ ${PV} != "9999" ]] ; then
+	KEYWORDS="*"
+fi
 
 RDEPEND="
-	sane_backends_dc210? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
-	sane_backends_dc240? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
-	sane_backends_dell1600n_net? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
-									>=media-libs/tiff-3.9.7-r1[${MULTILIB_USEDEP}] )
+	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}]
+	)
 	avahi? ( >=net-dns/avahi-0.6.31-r2[${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}] )
+	usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] )
 	gphoto2? (
 		>=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
-		>=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
+		>=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
 	)
 	v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
 	xinetd? ( sys-apps/xinetd )
@@ -162,11 +174,7 @@
 
 # We now use new syntax construct (SUBSYSTEMS!="usb|usb_device)
 RDEPEND="${RDEPEND}
-	!<sys-fs/udev-114
-	abi_x86_32? (
-		!<=app-emulation/emul-linux-x86-medialibs-20140508
-		!app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
-	)"
+	!<sys-fs/udev-114"
 
 MULTILIB_CHOST_TOOLS=(
 	/usr/bin/sane-config
@@ -184,15 +192,18 @@
 	# Add support for the Epson-specific backend.  Needs media-gfx/iscan installed.
 	epkowa
 	EOF
-	epatch "${FILESDIR}"/niash_array_index.patch \
-		"${FILESDIR}"/${PN}-1.0.24-automagic_systemd.patch \
-		"${FILESDIR}"/${PN}-1.0.24-systemd_pkgconfig.patch \
-		"${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch \
-		"${FILESDIR}"/${PN}-1.0.24-cross-compile.patch
-	# Fix for "make check".
-	sed -i -e 's/sane-backends 1.0.24git/sane-backends 1.0.24/' testsuite/tools/data/html*
-	mv configure.{in,ac} || die
-	AT_NOELIBTOOLIZE=yes eautoreconf
+	epatch "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch
+	epatch "${FILESDIR}"/${PN}-1.0.25-disable-usb-tests.patch
+	if [[ ${PV} == "9999" ]] ; then
+		mv configure.{in,ac} || die
+		AT_NOELIBTOOLIZE=yes eautoreconf
+	fi
+
+	# 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() {
@@ -240,7 +251,7 @@
 	fi
 
 	# relative path must be used for tests to work properly
-	ECONF_SOURCE=../${MY_P} \
+	ECONF_SOURCE=${S} \
 	SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
 	BACKENDS="${BACKENDS}" \
 	econf \