pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

usbmuxd: Update to usbmuxd-1.1.1



Module Name:	pkgsrc-wip
Committed By:	PHO <pho%cielonegro.org@localhost>
Pushed By:	pho
Date:		Fri Nov 7 19:48:12 2025 +0900
Changeset:	e75f95330ac6c5591a45b81312958d29cba1e2e6

Modified Files:
	usbmuxd/DESCR
	usbmuxd/Makefile
	usbmuxd/PLIST
	usbmuxd/distinfo
	usbmuxd/patches/patch-Makefile.in
	usbmuxd/patches/patch-configure.ac
Added Files:
	usbmuxd/TODO
	usbmuxd/files/usbmuxd.sh
	usbmuxd/patches/patch-src_conf.c
	usbmuxd/patches/patch-src_utils.c
	usbmuxd/patches/patch-src_utils.h
Removed Files:
	usbmuxd/patches/patch-configure
	usbmuxd/patches/patch-src_main.c

Log Message:
usbmuxd: Update to usbmuxd-1.1.1

But it still doesn't actually work on NetBSD. In fact it has never worked on this OS. See TODO.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e75f95330ac6c5591a45b81312958d29cba1e2e6

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 usbmuxd/DESCR                      |  8 +++++-
 usbmuxd/Makefile                   | 20 ++++++++++---
 usbmuxd/PLIST                      |  2 +-
 usbmuxd/TODO                       | 26 +++++++++++++++++
 usbmuxd/distinfo                   | 15 +++++-----
 usbmuxd/files/usbmuxd.sh           | 19 +++++++++++++
 usbmuxd/patches/patch-Makefile.in  |  1 +
 usbmuxd/patches/patch-configure    | 15 ----------
 usbmuxd/patches/patch-configure.ac |  7 +++--
 usbmuxd/patches/patch-src_conf.c   | 42 +++++++++++++++++++++++++++
 usbmuxd/patches/patch-src_main.c   | 15 ----------
 usbmuxd/patches/patch-src_utils.c  | 58 ++++++++++++++++++++++++++++++++++++++
 usbmuxd/patches/patch-src_utils.h  | 21 ++++++++++++++
 13 files changed, 203 insertions(+), 46 deletions(-)

diffs:
diff --git a/usbmuxd/DESCR b/usbmuxd/DESCR
index ef5694c286..59fa05a377 100644
--- a/usbmuxd/DESCR
+++ b/usbmuxd/DESCR
@@ -1 +1,7 @@
-A socket daemon to multiplex connections from and to iOS devices.
+usbmuxd stands for "USB multiplexing daemon". This daemon is in charge of
+multiplexing connections over USB to an iOS device.
+
+The usbmuxd daemon is running upon installing iTunes on Windows and Mac OS
+X. The libimobiledevice project provides an open-source reimplementation of
+the usbmuxd daemon to use on other OSes or as an alternative to communicate
+with iOS devices without the need to install iTunes.
diff --git a/usbmuxd/Makefile b/usbmuxd/Makefile
index 78d34b3b58..e36f1cee66 100644
--- a/usbmuxd/Makefile
+++ b/usbmuxd/Makefile
@@ -1,8 +1,9 @@
 # $NetBSD$
 
-DISTNAME=	usbmuxd-1.1.0
+DISTNAME=	usbmuxd-1.1.1
 CATEGORIES=	comms
-MASTER_SITES=	http://www.libimobiledevice.org/downloads/
+MASTER_SITES=	${MASTER_SITE_GITHUB:=libimobiledevice/}
+GITHUB_RELEASE=	${PKGVERSION_NOREV}
 EXTRACT_SUFX=	.tar.bz2
 
 MAINTAINER=	ryoon%NetBSD.org@localhost
@@ -12,10 +13,21 @@ LICENSE=	gnu-gpl-v2 AND gnu-gpl-v3
 
 GNU_CONFIGURE=	yes
 USE_LIBTOOL=	yes
-USE_TOOLS+=	gmake pkg-config
+USE_TOOLS+=	autoconf gmake pkg-config
+
+USBMUXD_USER?=	usbmux
+USBMUXD_GROUP?=	usbmux
+PKG_GROUPS=	${USBMUXD_USER}
+PKG_USERS=	${USBMUXD_USER}:${USBMUXD_GROUP}
+
+RCD_SCRIPTS=	usbmuxd
+FILES_SUBST+=	USBMUXD_USER=${USBMUXD_USER:Q}
+FILES_SUBST+=	USBMUXD_GROUP=${USBMUXD_GROUP:Q}
+
+post-patch:
+	cd ${WRKSRC} && autoconf
 
 .include "../../wip/libimobiledevice/buildlink3.mk"
-.include "../../wip/libusbmuxd/buildlink3.mk"
 .include "../../devel/libusb1/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"
 .include "../../textproc/libplist/buildlink3.mk"
diff --git a/usbmuxd/PLIST b/usbmuxd/PLIST
index 3cea7bb66c..aeecae7f69 100644
--- a/usbmuxd/PLIST
+++ b/usbmuxd/PLIST
@@ -1,3 +1,3 @@
 @comment $NetBSD$
-man/man1/usbmuxd.1
+man/man8/usbmuxd.8
 sbin/usbmuxd
diff --git a/usbmuxd/TODO b/usbmuxd/TODO
new file mode 100644
index 0000000000..26ba85f82d
--- /dev/null
+++ b/usbmuxd/TODO
@@ -0,0 +1,26 @@
+<!-- -*- markdown -*- -->
+
+We can compile usbmuxd on NetBSD but it doesn't actually work. I (pho@)
+tried hard but figured that it wasn't straightforward at all. Here are
+reasons:
+
+1. Unlike Linux, NetBSD allows userland to directly access USB devices only
+   if the said devices are completely unknown to its USB
+   stack. Specifically, userland direct access is only possible when the
+   `ugen(4)` driver attaches to them.
+2. However, Apple mobile devices (iPhone, iPad, Apple Watch, ...) aren't
+   complete aliens. We have `uipad(4)` which prevents `ugen(4)` from
+   attaching. And even if we disable it, `uaudio(4)` recognizes them as
+   audio input devices. `uhidev(4)` also attaches for a reason I (pho@)
+   don't know.
+3. On NetBSD, `devel/libusb1` can only talk to devices with `ugen(4)`
+   attached. This is logical. Makes sense. But in this case it isn't
+   helpful to us. Devices without `ugen(4)` attached are simply ignored by
+   libusb.
+4. And since libusb ignores them, `usbmuxd` cannot discover them and
+   reports no applicable devices are found.
+
+In theory it *could* be possible to make `ugen(4)` steal only a specific
+interface from these devices, but I (pho@) don't know what interface to
+steal. Future travellers may find it useful to see what `usb_device_add()`
+in `${WRKSRC}/src/usb.c` does. I am bailing out, at least for now.
diff --git a/usbmuxd/distinfo b/usbmuxd/distinfo
index 94f0da3991..512e4d20fc 100644
--- a/usbmuxd/distinfo
+++ b/usbmuxd/distinfo
@@ -1,9 +1,10 @@
 $NetBSD$
 
-RMD160 (usbmuxd-1.1.0.tar.bz2) = cc690cd42a4699d9d464a94e3ab7433590123c5d
-SHA512 (usbmuxd-1.1.0.tar.bz2) = 66aa0c40e912bf596b819098b87d88e9cf30b2e6352e607eeb778bd4f23bf9bb123fb6a6ecca2d4e4be3171e35d66200d632d2c9c80b1f2462bb45be8aa6912d
-Size (usbmuxd-1.1.0.tar.bz2) = 321897 bytes
-SHA1 (patch-Makefile.in) = 2d5a800ca6f098fc4c8a2eb21cb75c130407f09f
-SHA1 (patch-configure) = d833ffadd5eee3482bacd841aded1bb37b368c1b
-SHA1 (patch-configure.ac) = cd4457924ba71c414e8537a1ab563ca2d2664d3e
-SHA1 (patch-src_main.c) = 57323e5fb532e891d88c0a469219b5a71c0a6adb
+BLAKE2s (usbmuxd-1.1.1.tar.bz2) = 3f538853eb05fc48c3713f2de86738c2001e00f4a9b5f9c206b49ebe2f954fae
+SHA512 (usbmuxd-1.1.1.tar.bz2) = 0e8829c93aac147a6b949fe95592d6ad9ea36e1c04676cb85accb4670a65b31065706fc438556def17b55850081d6c07deb325ca02b9853335b6e0b1049ba1da
+Size (usbmuxd-1.1.1.tar.bz2) = 345290 bytes
+SHA1 (patch-Makefile.in) = 3e7eaab8fe6bb0de28d9f77908f848ead7aaabc8
+SHA1 (patch-configure.ac) = 1014fa338f52114f0d13a8acb64d9cf77e876ac0
+SHA1 (patch-src_conf.c) = f9c9af5b36ca7585c7b46ddfdfd565a36ef08442
+SHA1 (patch-src_utils.c) = c463603f72df312f06eba924194fecf290c428aa
+SHA1 (patch-src_utils.h) = 14ad7dd4a86040959b030e9f884139be63dc86f5
diff --git a/usbmuxd/files/usbmuxd.sh b/usbmuxd/files/usbmuxd.sh
new file mode 100644
index 0000000000..5014b4eadd
--- /dev/null
+++ b/usbmuxd/files/usbmuxd.sh
@@ -0,0 +1,19 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+
+# PROVIDE: usbmuxd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+$_rc_subr_loaded . @SYSCONFBASE@/rc.subr
+
+name="usbmuxd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+command_args="--user usbmux"
+pidfile="/var/run/usbmuxd.pid"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/usbmuxd/patches/patch-Makefile.in b/usbmuxd/patches/patch-Makefile.in
index c173093430..0e7fe18d49 100644
--- a/usbmuxd/patches/patch-Makefile.in
+++ b/usbmuxd/patches/patch-Makefile.in
@@ -1,6 +1,7 @@
 $NetBSD$
 
 * Disable udev installation
+https://github.com/libimobiledevice/usbmuxd/pull/270
 
 --- Makefile.in.orig	2014-10-17 20:27:41.000000000 +0000
 +++ Makefile.in
diff --git a/usbmuxd/patches/patch-configure b/usbmuxd/patches/patch-configure
deleted file mode 100644
index 0ec454afb4..0000000000
--- a/usbmuxd/patches/patch-configure
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-* POSIX shell portability
-
---- configure.orig	2014-10-17 20:27:41.000000000 +0000
-+++ configure
-@@ -15826,7 +15826,7 @@ $as_echo "#define HAVE_LIBIMOBILEDEVICE 
- 
-   fi
- else
--  if test "x$with_preflight" == "xyes"; then
-+  if test "x$with_preflight" = "xyes"; then
-     as_fn_error $? "preflight worker support requested but libimobiledevice could not be found" "$LINENO" 5
-   fi
- fi
diff --git a/usbmuxd/patches/patch-configure.ac b/usbmuxd/patches/patch-configure.ac
index 784af342bd..c3f079aee1 100644
--- a/usbmuxd/patches/patch-configure.ac
+++ b/usbmuxd/patches/patch-configure.ac
@@ -1,11 +1,12 @@
 $NetBSD$
 
 * POSIX shell portability
+https://github.com/libimobiledevice/usbmuxd/pull/270
 
---- configure.ac.orig	2014-10-17 20:27:35.000000000 +0000
+--- configure.ac.orig	2020-06-09 01:57:16.000000000 +0000
 +++ configure.ac
-@@ -37,7 +37,7 @@ if test "x$have_limd" = "xyes"; then
-     AC_SUBST(libimobiledevice_LIBS)
+@@ -49,7 +49,7 @@ if test "x$have_limd" = "xyes"; then
+     fi
    fi
  else
 -  if test "x$with_preflight" == "xyes"; then
diff --git a/usbmuxd/patches/patch-src_conf.c b/usbmuxd/patches/patch-src_conf.c
new file mode 100644
index 0000000000..9ae6a58509
--- /dev/null
+++ b/usbmuxd/patches/patch-src_conf.c
@@ -0,0 +1,42 @@
+$NetBSD$
+
+Fix build with libplist-2.7.0. Already fixed in upstream.
+
+--- src/conf.c.orig	2025-11-07 10:41:30.750835727 +0000
++++ src/conf.c
+@@ -230,7 +230,7 @@ static int internal_set_value(const char
+ 	/* read file into plist */
+ 	plist_t config = NULL;
+ 
+-	plist_read_from_filename(&config, config_file);
++	plist_read_from_file(config_file, &config, NULL);
+ 	if (!config) {
+ 		config = plist_new_dict();
+ 		plist_dict_set_item(config, key, value);
+@@ -254,7 +254,7 @@ static int internal_set_value(const char
+ 		usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file);
+ 	}
+ 
+-	int res = plist_write_to_filename(config, config_file, PLIST_FORMAT_XML);
++	int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0);
+ 
+ 	plist_free(config);
+ 
+@@ -288,7 +288,7 @@ static int internal_get_value(const char
+ 
+ 	/* now parse file to get the SystemBUID */
+ 	plist_t config = NULL;
+-	if (plist_read_from_filename(&config, config_file)) {
++	if (plist_read_from_file(config_file, &config, NULL)) {
+ 		usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file);
+ 		plist_t n = plist_dict_get_item(config, key);
+ 		if (n) {
+@@ -428,7 +428,7 @@ int config_set_device_record(const char 
+ 	remove(device_record_file);
+ 
+ 	/* store file */
+-	if (!plist_write_to_filename(plist, device_record_file, PLIST_FORMAT_XML)) {
++	if (!plist_write_to_file(plist, device_record_file, PLIST_FORMAT_XML, 0)) {
+ 		usbmuxd_log(LL_DEBUG, "Could not open '%s' for writing: %s", device_record_file, strerror(errno));
+ 		res = -ENOENT;
+ 	}
diff --git a/usbmuxd/patches/patch-src_main.c b/usbmuxd/patches/patch-src_main.c
deleted file mode 100644
index 5a1a3c91eb..0000000000
--- a/usbmuxd/patches/patch-src_main.c
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-* Support NetBSD
-
---- src/main.c.orig	2014-10-16 13:17:48.000000000 +0000
-+++ src/main.c
-@@ -150,7 +150,7 @@ static void set_signal_handlers(void)
- 	sigaction(SIGUSR2, &sa, NULL);
- }
- 
--#if defined(__FreeBSD__) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- static int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, const sigset_t *sigmask)
- {
- 	int ready;
diff --git a/usbmuxd/patches/patch-src_utils.c b/usbmuxd/patches/patch-src_utils.c
new file mode 100644
index 0000000000..6e835c1711
--- /dev/null
+++ b/usbmuxd/patches/patch-src_utils.c
@@ -0,0 +1,58 @@
+$NetBSD$
+
+Fix build with libplist-2.7.0. Already fixed in upstream.
+
+--- src/utils.c.orig	2025-11-07 10:39:55.456855663 +0000
++++ src/utils.c
+@@ -279,51 +279,6 @@ int buffer_write_to_filename(const char 
+ 	}
+ }
+ 
+-int plist_read_from_filename(plist_t *plist, const char *filename)
+-{
+-	char *buffer = NULL;
+-	uint64_t length;
+-
+-	if (!filename)
+-		return 0;
+-
+-	if (!buffer_read_from_filename(filename, &buffer, &length)) {
+-		return 0;
+-	}
+-
+-	if ((length > 8) && (memcmp(buffer, "bplist00", 8) == 0)) {
+-		plist_from_bin(buffer, length, plist);
+-	} else {
+-		plist_from_xml(buffer, length, plist);
+-	}
+-
+-	free(buffer);
+-
+-	return 1;
+-}
+-
+-int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format)
+-{
+-	char *buffer = NULL;
+-	uint32_t length;
+-
+-	if (!plist || !filename)
+-		return 0;
+-
+-	if (format == PLIST_FORMAT_XML)
+-		plist_to_xml(plist, &buffer, &length);
+-	else if (format == PLIST_FORMAT_BINARY)
+-		plist_to_bin(plist, &buffer, &length);
+-	else
+-		return 0;
+-
+-	int res  = buffer_write_to_filename(filename, buffer, length);
+-
+-	free(buffer);
+-
+-	return res;
+-}
+-
+ #ifndef HAVE_CLOCK_GETTIME
+ typedef int clockid_t;
+ #define CLOCK_MONOTONIC 1
diff --git a/usbmuxd/patches/patch-src_utils.h b/usbmuxd/patches/patch-src_utils.h
new file mode 100644
index 0000000000..624c585d35
--- /dev/null
+++ b/usbmuxd/patches/patch-src_utils.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+Fix build with libplist-2.7.0. Already fixed in upstream.
+
+--- src/utils.h.orig	2025-11-07 09:55:55.030114714 +0000
++++ src/utils.h
+@@ -78,14 +78,6 @@ char *string_concat(const char *str, ...
+ int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length);
+ int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length);
+ 
+-enum plist_format_t {
+-	PLIST_FORMAT_XML,
+-	PLIST_FORMAT_BINARY
+-};
+-
+-int plist_read_from_filename(plist_t *plist, const char *filename);
+-int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format);
+-
+ uint64_t mstime64(void);
+ void get_tick_count(struct timeval * tv);
+ 


Home | Main Index | Thread Index | Old Index