1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-28 01:06:17 +00:00
freebsd-ports/comms/usbmuxd/Makefile
Jason E. Hale f4bd2eeb66 comms/usbmuxd: Workaround devd(8) race condition
When connecting an Apple device via USB, the device connects, usbmuxd is
started, then for reasons yet unknown, the device instantly disconnects,
and reconnects.

From dmesg when plugging in, for example:
ugen0.5: <Apple Inc. iPhone> at usbus0
<usbmuxd starts here>
ugen0.5: <Apple Inc. iPhone> at usbus0 (disconnected)
ugen0.5: <Apple Inc. iPhone> at usbus0

Due to the disconnect, the instance of usbmuxd that is spawned when the
device is first attached is subsequently killed by the unexplained
detach because the cdce(4) devices have not yet been created, but not
before the second instance of usbmuxd is started by the reattach. The
second instance automatically exits because two instances cannot run
simultaneously. The first instance then exits leaving no running
instances.

Adding a short sleep after the first instance is called to shutdown
gives it enough time to completely exit before the second instance is
spawned. Unfortunately, only one device is supported at a time until
I can figure out why the hotplugging isn't working.

While here, cleanup whitespace.

PR:		280014
Reported by:	<fabio.comolli@gmail.com>
2024-07-12 02:24:35 -04:00

58 lines
1.4 KiB
Makefile

PORTNAME= usbmuxd
DISTVERSION= 1.1.1-58
PORTREVISION= 1
DISTVERSIONSUFFIX= -gbc0b91c
CATEGORIES= comms
#MASTER_SITES= https://github.com/libimobiledevice/${PORTNAME}/releases/download/${DISTVERSION}/
MAINTAINER= jhale@FreeBSD.org
COMMENT= Daemon for multiplexing connections over USB to iPhone/iPod Touch
WWW= https://www.libimobiledevice.org
LICENSE= GPLv2 GPLv3
LICENSE_COMB= dual
LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING.GPLv2
LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING.GPLv3
LIB_DEPENDS= libplist-2.0.so:devel/libplist \
libimobiledevice-1.0.so:comms/libimobiledevice \
libimobiledevice-glue-1.0.so:comms/libimobiledevice-glue
USES= autoreconf cpe libtool localbase pathfix pkgconfig
CPE_VENDOR= nikias_bassen
USE_GITHUB= yes
GH_ACCOUNT= libimobiledevice
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --without-systemd
SUB_LIST= USERS=${USERS} \
GROUPS=${GROUPS}
USERS= ${PORTNAME}
GROUPS= ${PORTNAME}
PLIST_FILES= share/man/man8/${PORTNAME}.8.gz \
sbin/${PORTNAME}
PORTDOCS= AUTHORS NEWS README.md
OPTIONS_DEFINE= DEVD DOCS
OPTIONS_DEFAULT= DEVD
DEVD_SUB_FILES= ${PORTNAME}.conf
DEVD_PLIST_FILES= etc/devd/${PORTNAME}.conf
post-patch:
@echo "${DISTVERSIONFULL}" > ${WRKSRC}/.tarball-version
post-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
post-install-DEVD-on:
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/devd
${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.conf ${STAGEDIR}${PREFIX}/etc/devd
.include <bsd.port.mk>