From 9204361517c17a358de37a9711ce2f3e3e012139 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 11 Oct 2025 18:39:04 +0300 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 9 +++++++ pkg.info | 21 +++++++++++++++ source-files/iDevices.patch | 25 ++++++++++++++++++ source-files/libplist-2.3.0.patch | 32 ++++++++++++++++++++++ source-files/sysusers | 1 + source.sh | 44 +++++++++++++++++++++++++++++++ 7 files changed, 134 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source-files/iDevices.patch create mode 100644 source-files/libplist-2.3.0.patch create mode 100644 source-files/sysusers create mode 100644 source.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..3934af2 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Github repository +REPO="libimobiledevice/usbmuxd" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +echo "$TAG_NAME" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..52e77c1 --- /dev/null +++ b/pkg.info @@ -0,0 +1,21 @@ +name: usbmuxd +description: A socket daemon to multiplex connections from and to iOS devices +version: 1.1.1 +revision: 1 +url: https://github.com/libimobiledevice/usbmuxd +license: GPL3-or-later +architecture: any +type: source +depends: + - libimobiledevice + - libplist + - libusb + - sysusers +make_depends: + - git +downloads: + - url: https://github.com/libimobiledevice/usbmuxd.git + type: git + clone_to: ${BPM_SOURCE} + git_branch: ${BPM_PKG_VERSION} + checksum: 79c8b38d1488a6b07e1e68f39d8caec3f1a45622 diff --git a/source-files/iDevices.patch b/source-files/iDevices.patch new file mode 100644 index 0000000..f3464bb --- /dev/null +++ b/source-files/iDevices.patch @@ -0,0 +1,25 @@ +From dedbd15300fb46519166ef953c7e032fd905b594 Mon Sep 17 00:00:00 2001 +From: Nathan +Date: Sun, 7 May 2023 23:59:11 -0500 +Subject: [PATCH] iDevices + +--- + udev/39-usbmuxd.rules.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/udev/39-usbmuxd.rules.in b/udev/39-usbmuxd.rules.in +index 11d33c6..f26b7ff 100644 +--- a/udev/39-usbmuxd.rules.in ++++ b/udev/39-usbmuxd.rules.in +@@ -4,7 +4,7 @@ + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/8600/*", TAG+="systemd" + + # Initialize iOS devices into "deactivated" USB configuration state and activate usbmuxd +-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/8600/*", ACTION=="add", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux", @udev_activation_rule@ ++SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/8600/*", ACTION=="add", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux" + + # Make sure properties don't get lost when bind action is called + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/8600/*", ACTION=="bind", ENV{USBMUX_SUPPORTED}="1", OWNER="usbmux", @udev_activation_rule@ +-- +2.40.1 + diff --git a/source-files/libplist-2.3.0.patch b/source-files/libplist-2.3.0.patch new file mode 100644 index 0000000..30ee4bf --- /dev/null +++ b/source-files/libplist-2.3.0.patch @@ -0,0 +1,32 @@ +diff --git i/src/utils.c w/src/utils.c +index 206c684..a91faea 100644 +--- i/src/utils.c ++++ w/src/utils.c +@@ -302,7 +302,7 @@ int plist_read_from_filename(plist_t *plist, const char *filename) + return 1; + } + +-int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format) ++int plist_write_to_filename(plist_t plist, const char *filename, plist_format_t format) + { + char *buffer = NULL; + uint32_t length; +diff --git i/src/utils.h w/src/utils.h +index b5cab3f..3e9eb41 100644 +--- i/src/utils.h ++++ w/src/utils.h +@@ -78,13 +78,8 @@ 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); ++int plist_write_to_filename(plist_t plist, const char *filename, plist_format_t format); + + uint64_t mstime64(void); + void get_tick_count(struct timeval * tv); diff --git a/source-files/sysusers b/source-files/sysusers new file mode 100644 index 0000000..ce0aeae --- /dev/null +++ b/source-files/sysusers @@ -0,0 +1 @@ +u usbmux 140 "usbmux user" diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..f5f8f18 --- /dev/null +++ b/source.sh @@ -0,0 +1,44 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + + # Fix compatibility with libplist 2.3.0+ + git apply -3 "$BPM_WORKDIR"/libplist-2.3.0.patch + git apply -3 "$BPM_WORKDIR"/iDevices.patch + + NOCONFIGURE=1 ./autogen.sh +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var + + # Prevent overlinking due to libtool + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + + make +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + make check +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make DESTDIR="$BPM_OUTPUT" install + + # Install sysusers file + install -Dm644 "$BPM_WORKDIR"/sysusers "$BPM_OUTPUT"/usr/lib/sysusers.d/usbmuxd.conf + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING.GPLv3 "$BPM_OUTPUT"/usr/share/licenses/usbmuxd/COPYING +}