Your message dated Sun, 28 Aug 2016 22:24:49 +0000
with message-id <e1be8vv-0001nm...@franck.debian.org>
and subject line Bug#835335: fixed in libusb-1.0 2:1.0.21~rc3-1
has caused the Debian Bug report #835335,
regarding libusb-1.0: Provide Hurd stub like libusb-0.1 did?
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
835335: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835335
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: src:libusb-1.0
Version: 2:1.0.20-1
Severity: wishlist

The fact that libusb-1.0 is not available on Hurd block several hundred
packages that would otherwise work just fine without USB support on Hurd
from building in Debian.  A fix for this, which I've been told was
present in the libusb 0.1 era, is to provide a Hurd backend for libusb
returning an empty list of USB devices.  Would you be willing to include
such implementation?

The attached patch provide such stub implementation.  It is tested on
the Hurd porter box.

-- 
Happy hacking
Petter Reinholdtsen
Description: Implement stub backend for Hurd
Author: Petter Reinholdtsen <p...@hungry.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2016-08-24

--- libusb-1.0-1.0.20.orig/config.h.in
+++ libusb-1.0-1.0.20/config.h.in
@@ -88,6 +88,9 @@
 /* Haiku backend */
 #undef OS_HAIKU
 
+/* Hurd backend */
+#undef OS_HURD
+
 /* Linux backend */
 #undef OS_LINUX
 
--- libusb-1.0-1.0.20.orig/configure
+++ libusb-1.0-1.0.20/configure
@@ -659,6 +659,8 @@ OS_NETBSD_FALSE
 OS_NETBSD_TRUE
 OS_OPENBSD_FALSE
 OS_OPENBSD_TRUE
+OS_HURD_FALSE
+OS_HURD_TRUE
 OS_DARWIN_FALSE
 OS_DARWIN_TRUE
 OS_LINUX_FALSE
@@ -667,6 +669,7 @@ OS_HAIKU
 OS_WINDOWS
 OS_NETBSD
 OS_OPENBSD
+OS_HURD
 OS_DARWIN
 USE_UDEV
 OS_LINUX
@@ -768,6 +771,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -855,6 +859,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1107,6 +1112,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1244,7 +1258,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1397,6 +1411,7 @@ Fine tuning of the installation director
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -11933,6 +11948,12 @@ $as_echo "Darwin/Mac OS X" >&6; }
 	backend="darwin"
 	threads="posix"
 	;;
+*-gnu*)
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Hurd" >&5
+$as_echo "Hurd" >&6; }
+	backend="hurd"
+	threads="posix"
+	;;
 *-openbsd*)
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenBSD" >&5
 $as_echo "OpenBSD" >&6; }
@@ -12207,6 +12228,29 @@ $as_echo "#define POLL_NFDS_TYPE unsigne
 fi
 
 	;;
+hurd)
+
+$as_echo "#define OS_HURD 1" >>confdefs.h
+
+
+	THREAD_CFLAGS="-pthread"
+	LIBS="-pthread"
+	for ac_header in poll.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default"
+if test "x$ac_cv_header_poll_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_POLL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+$as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h
+
+	;;
 openbsd)
 
 $as_echo "#define OS_OPENBSD 1" >>confdefs.h
@@ -12309,6 +12353,14 @@ else
   OS_DARWIN_FALSE=
 fi
 
+ if test "x$backend" = xhurd; then
+  OS_HURD_TRUE=
+  OS_HURD_FALSE='#'
+else
+  OS_HURD_TRUE='#'
+  OS_HURD_FALSE=
+fi
+
  if test "x$backend" = xopenbsd; then
   OS_OPENBSD_TRUE=
   OS_OPENBSD_FALSE='#'
@@ -12830,6 +12882,10 @@ if test -z "${OS_DARWIN_TRUE}" && test -
   as_fn_error $? "conditional \"OS_DARWIN\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${OS_HURD_TRUE}" && test -z "${OS_HURD_FALSE}"; then
+  as_fn_error $? "conditional \"OS_HURD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${OS_OPENBSD_TRUE}" && test -z "${OS_OPENBSD_FALSE}"; then
   as_fn_error $? "conditional \"OS_OPENBSD\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
--- libusb-1.0-1.0.20.orig/configure.ac
+++ libusb-1.0-1.0.20/configure.ac
@@ -67,6 +67,11 @@ case $host in
 	backend="darwin"
 	threads="posix"
 	;;
+*-gnu*)
+	AC_MSG_RESULT([Hurd])
+	backend="hurd"
+	threads="posix"
+	;;
 *-openbsd*)
 	AC_MSG_RESULT([OpenBSD])
 	backend="openbsd"
@@ -149,6 +154,14 @@ darwin)
 		[AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])],
 		[#include <poll.h>])
 	;;
+hurd)
+	AC_DEFINE(OS_HURD, 1, [Hurd backend])
+	AC_SUBST(OS_HURD)
+	THREAD_CFLAGS="-pthread"
+	LIBS="-pthread"
+	AC_CHECK_HEADERS([poll.h])
+	AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
+	;;
 openbsd)
 	AC_DEFINE(OS_OPENBSD, 1, [OpenBSD backend])
 	AC_SUBST(OS_OPENBSD)
@@ -186,6 +199,7 @@ AC_SUBST(LIBS)
 
 AM_CONDITIONAL(OS_LINUX, test "x$backend" = xlinux)
 AM_CONDITIONAL(OS_DARWIN, test "x$backend" = xdarwin)
+AM_CONDITIONAL(OS_HURD, test "x$backend" = xhurd)
 AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xopenbsd)
 AM_CONDITIONAL(OS_NETBSD, test "x$backend" = xnetbsd)
 AM_CONDITIONAL(OS_WINDOWS, test "x$backend" = xwindows)

--- libusb-1.0-1.0.20.orig/libusb/core.c
+++ libusb-1.0-1.0.20/libusb/core.c
@@ -48,6 +48,8 @@
 const struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend;
 #elif defined(OS_DARWIN)
 const struct usbi_os_backend * const usbi_backend = &darwin_backend;
+#elif defined(OS_HURD)
+const struct usbi_os_backend * const usbi_backend = &hurd_backend;
 #elif defined(OS_OPENBSD)
 const struct usbi_os_backend * const usbi_backend = &openbsd_backend;
 #elif defined(OS_NETBSD)
--- libusb-1.0-1.0.20.orig/libusb/libusbi.h
+++ libusb-1.0-1.0.20/libusb/libusbi.h
@@ -493,7 +493,7 @@ int usbi_signal_event(struct libusb_cont
 int usbi_clear_event(struct libusb_context *ctx);
 
 /* Internal abstraction for poll (needs struct usbi_transfer on Windows) */
-#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) || defined(OS_NETBSD) || defined(OS_HAIKU)
+#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_HURD) || defined(OS_OPENBSD) || defined(OS_NETBSD) || defined(OS_HAIKU)
 #include <unistd.h>
 #include "os/poll_posix.h"
 #elif defined(OS_WINDOWS) || defined(OS_WINCE)
@@ -1086,6 +1086,7 @@ extern const struct usbi_os_backend * co
 
 extern const struct usbi_os_backend linux_usbfs_backend;
 extern const struct usbi_os_backend darwin_backend;
+extern const struct usbi_os_backend hurd_backend;
 extern const struct usbi_os_backend openbsd_backend;
 extern const struct usbi_os_backend netbsd_backend;
 extern const struct usbi_os_backend windows_backend;
--- /dev/null
+++ libusb-1.0-1.0.20/libusb/os/hurd_usb.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright © 2016 Petter Reinholdtsen <p...@hungry.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * Stup libusb implementation for GNU Hurd returning empty list of
+ * devices.  This allow programs to build on Hurd without USB support
+ * without having to update a lot of build dependencies.
+ */
+
+#include "libusbi.h"
+
+static int
+hurd_init(struct libusb_context *ctx)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_get_device_list(struct libusb_context * ctx,
+	struct discovered_devs **discdevs)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_open(struct libusb_device_handle *handle)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static void
+hurd_close(struct libusb_device_handle *handle)
+{
+	usbi_dbg(__FUNCTION__);
+}
+
+static int
+hurd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf,
+    int *host_endian)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+int
+hurd_get_active_config_descriptor(struct libusb_device *dev,
+    unsigned char *buf, size_t len, int *host_endian)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+int
+hurd_get_config_descriptor(struct libusb_device *dev, uint8_t idx,
+    unsigned char *buf, size_t len, int *host_endian)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_get_configuration(struct libusb_device_handle *handle, int *config)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_set_configuration(struct libusb_device_handle *handle, int config)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_claim_interface(struct libusb_device_handle *handle, int iface)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_release_interface(struct libusb_device_handle *handle, int iface)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_set_interface_altsetting(struct libusb_device_handle *handle, int iface,
+    int altsetting)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_reset_device(struct libusb_device_handle *handle)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_alloc_streams(struct libusb_device_handle *handle,
+		   uint32_t num_streams, unsigned char *endpoints, int num_endpoints)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static int
+hurd_free_streams(struct libusb_device_handle *handle,
+		  unsigned char *endpoints, int num_endpoints)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+static void
+hurd_destroy_device(struct libusb_device *dev)
+{
+	usbi_dbg(__FUNCTION__);
+}
+
+static int
+hurd_submit_transfer(struct usbi_transfer *itransfer)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+int
+hurd_cancel_transfer(struct usbi_transfer *itransfer)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+void
+hurd_clear_transfer_priv(struct usbi_transfer *itransfer)
+{
+	usbi_dbg(__FUNCTION__);
+}
+
+int
+hurd_handle_transfer_completion(struct usbi_transfer *itransfer)
+{
+	usbi_dbg(__FUNCTION__);
+	return (LIBUSB_ERROR_NOT_SUPPORTED);
+}
+
+int
+hurd_clock_gettime(int clkid, struct timespec *tp)
+{
+	usbi_dbg("clock %d", clkid);
+
+	if (clkid == USBI_CLOCK_REALTIME)
+		return clock_gettime(CLOCK_REALTIME, tp);
+
+	if (clkid == USBI_CLOCK_MONOTONIC)
+		return clock_gettime(CLOCK_MONOTONIC, tp);
+
+	return (LIBUSB_ERROR_INVALID_PARAM);
+}
+
+const struct usbi_os_backend hurd_backend = {
+	.name = "Synchronous Hurd backend",
+	.caps = 0,
+	.init = hurd_init,
+	.get_device_list = hurd_get_device_list,
+	.open = hurd_open,
+	.close = hurd_close,
+	.get_device_descriptor = hurd_get_device_descriptor,
+	.get_active_config_descriptor = hurd_get_active_config_descriptor,
+	.get_config_descriptor = hurd_get_config_descriptor,
+	.set_configuration = hurd_set_configuration,
+	.claim_interface = hurd_claim_interface,
+	.release_interface = hurd_release_interface,
+	.set_interface_altsetting = hurd_set_interface_altsetting,
+	.clear_halt = hurd_clear_halt,
+	.reset_device = hurd_reset_device,
+	.alloc_streams = hurd_alloc_streams,
+	.free_streams = hurd_free_streams,
+	.submit_transfer = hurd_submit_transfer,
+	.cancel_transfer = hurd_cancel_transfer,
+	.clear_transfer_priv = hurd_clear_transfer_priv,
+	.clock_gettime = hurd_clock_gettime,
+};

--- End Message ---
--- Begin Message ---
Source: libusb-1.0
Source-Version: 2:1.0.21~rc3-1

We believe that the bug you reported is fixed in the latest version of
libusb-1.0, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 835...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aure...@debian.org> (supplier of updated libusb-1.0 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 28 Aug 2016 23:55:19 +0200
Source: libusb-1.0
Binary: libusb-1.0-0 libusb-1.0-0-dev libusb-1.0-doc libusb-1.0-0-udeb
Architecture: source
Version: 2:1.0.21~rc3-1
Distribution: experimental
Urgency: medium
Maintainer: Aurelien Jarno <aure...@debian.org>
Changed-By: Aurelien Jarno <aure...@debian.org>
Description:
 libusb-1.0-0 - userspace USB programming library
 libusb-1.0-0-dev - userspace USB programming library development files
 libusb-1.0-0-udeb - userspace USB programming library (udeb)
 libusb-1.0-doc - documentation for userspace USB programming
Closes: 835335
Changes:
 libusb-1.0 (2:1.0.21~rc3-1) experimental; urgency=medium
 .
   * New upstream release candidate.
   * Build-depends on dh-autoreconf and pass --with autoreconf to dh.
   * Add a hurd stub backend, thanks to Petter Reinholdtsen for the patch
     (closes: #835335).
Checksums-Sha1:
 1960b22b9a36f4eeaccc21604dd11f38772e3ba3 2098 libusb-1.0_1.0.21~rc3-1.dsc
 82dde37d35939d894ea6536fa51148d81bfaeca6 1079938 
libusb-1.0_1.0.21~rc3.orig.tar.bz2
 ab96bc3333e7dc3275982c4fb449d0902d8cb0fd 12016 
libusb-1.0_1.0.21~rc3-1.debian.tar.xz
Checksums-Sha256:
 357c269e6f734519a976d05229c647ebdd4eab02a33f36645184caa7de29a70c 2098 
libusb-1.0_1.0.21~rc3-1.dsc
 04a5ad316c72ba7d0b59b3c78c409ed36c85ea8847b8c5be49d08e6beb855d1d 1079938 
libusb-1.0_1.0.21~rc3.orig.tar.bz2
 1b1238994901e53e83c04c9c1785c9e88309879f82b6f2190b2dec3fd042a148 12016 
libusb-1.0_1.0.21~rc3-1.debian.tar.xz
Files:
 4fc62673849e8325e263376340527f66 2098 libs optional libusb-1.0_1.0.21~rc3-1.dsc
 70557276fde384eb7f094b289584b5af 1079938 libs optional 
libusb-1.0_1.0.21~rc3.orig.tar.bz2
 199abd3dac1f3061f6460b65716e6abe 12016 libs optional 
libusb-1.0_1.0.21~rc3-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJXw13RAAoJELqceAYd3YybWp4QALrtLzZfRcEzcUwi6wpIBitn
TZHiODYoLE8utRzuIXSM+9Qb9LmZlQue6MI8WMWsw+CrjCzYUgzbpqqXNEENFFcV
JxM3OoaEGUB4mx5rBPKENBArHh5Zz5jtrmwj3I1I8jf+qZESvNJg37dle81d9aAE
LUsDJMoGWE+UvNLOB7LIx5/meN6EmEAEp3K70DjvSIVxHk3iEHlPgQm+1jCglpUM
cyLXWjOwmlIeSFK+lZH0gxLjRpyRbjjBawy6D4gkugNHKPQVS+L++5DG0jGHhfUq
FGLSBA8P4HA2XB7gVmSyy5ybcOM+a+695gdwZCZvzyU3Fmt7wcXAgTg5s0KJo8AE
Rxh3P20B6y8UQq2klE0tefKYB6nUoMDkkK2C7Rwb9drE/wq6u54k86/cNfdy77xU
i3nWzxMyvYo15klamUXvS9j4BdbstWkbp24btll/2Sh9YypY2r8cxUrgKiPncDwt
drYc8F6kl0Wkqa7XIZrc8+AJavVNJr/Dbk21vlnPL9ZuSnWCKoKOMomi5Ok+Bajl
nDSoljoHETgWsP1T6Oj4eEsptABhrsDtLMgqg+j8ABFOF8MVZcxqrTsEZWDJU6lp
h948AmWrSpUx4PCHNVoRYyxeRK8dWBGcLM2TXA7GrJ3lPkI7LIPqeV9BmI+06bug
Ca4SLZqiphEqlVm7B7GW
=hXMm
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to