usbmuxd: update to githash 360619c and addon (1)

- libusbmuxd: update to githash 07cd6f7
- libimobiledevice: update to githash 73b6fd1
- libimobiledevice-glue: initial package
- libplist: update to 2.4.0
This commit is contained in:
Rudi Heitbaum 2023-04-28 14:13:24 +00:00
parent 6e39ecc0d4
commit cbd8a8d5d5
2 changed files with 11 additions and 212 deletions

View File

@ -2,14 +2,15 @@
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="usbmuxd"
PKG_VERSION="1.1.1"
PKG_SHA256="c0ec9700172bf635ccb5bed98daae607d2925c2bc3597f25706ecd9dfbfd2d9e"
PKG_REV="0"
PKG_VERSION="360619c5f721f93f0b9d8af1a2df0b926fbcf281"
PKG_SHA256="3f36b9f427f388c701798904ed2655867e0113ef3ac68e73f1a69a6e5e2940b2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.libimobiledevice.org"
PKG_URL="https://github.com/libimobiledevice/usbmuxd/releases/download/${PKG_VERSION}/usbmuxd-${PKG_VERSION}.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libusb libimobiledevice"
PKG_URL="https://github.com/libimobiledevice/usbmuxd/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain libusb libimobiledevice libimobiledevice-glue libusbmuxd libplist"
PKG_TOOLCHAIN="autotools"
PKG_SECTION="service"
PKG_SHORTDESC="USB Multiplex Daemon"
PKG_LONGDESC="USB Multiplex Daemon"
@ -23,6 +24,11 @@ PKG_DISCLAIMER="Additional data charges may occur. The LibreELEC team doesn't ta
PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_malloc_0_nonnull=yes \
ac_cv_func_realloc_0_nonnull=yes"
configure_package() {
# if using a git hash as a package version - set RELEASE_VERSION
export RELEASE_VERSION="$(sed -n '1,/RE/s/Version \(.*\)/\1/p' ${PKG_BUILD}/NEWS)-git-${PKG_VERSION:0:7}"
}
post_configure_target() {
libtool_remove_rpath libtool
}

View File

@ -1,207 +0,0 @@
diff --git a/src/utils.c b/src/utils.c
index 206c684..2ce59ff 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -160,170 +160,6 @@ char *stpcpy(char * s1, const char * s2)
}
#endif
-/**
- * Concatenate strings into a newly allocated string
- *
- * @note: Specify NULL for the last string in the varargs list
- *
- * @str: The first string in the list
- * @...: Subsequent strings. Use NULL for the last item.
- *
- * @return a newly allocated string, or NULL if @str is NULL. This will also
- * return NULL and set errno to ENOMEM if memory is exhausted.
- */
-char *string_concat(const char *str, ...)
-{
- size_t len;
- va_list args;
- char *s;
- char *result;
- char *dest;
-
- if (!str)
- return NULL;
-
- /* Compute final length */
-
- len = strlen(str) + 1; /* plus 1 for the null terminator */
-
- va_start(args, str);
- s = va_arg(args, char *);
- while (s) {
- len += strlen(s);
- s = va_arg(args, char*);
- }
- va_end(args);
-
- /* Concat each string */
-
- result = malloc(len);
- if (!result)
- return NULL; /* errno remains set */
-
- dest = result;
-
- dest = stpcpy(dest, str);
-
- va_start(args, str);
- s = va_arg(args, char *);
- while (s) {
- dest = stpcpy(dest, s);
- s = va_arg(args, char *);
- }
- va_end(args);
-
- return result;
-}
-
-int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length)
-{
- FILE *f;
- uint64_t size;
-
- *length = 0;
-
- f = fopen(filename, "rb");
- if (!f) {
- return 0;
- }
-
- fseek(f, 0, SEEK_END);
- size = ftell(f);
- rewind(f);
-
- if (size == 0) {
- fclose(f);
- return 0;
- }
-
- *buffer = (char*)malloc(sizeof(char)*(size+1));
-
- if (!buffer) {
- return 0;
- }
-
- int ret = 1;
- if (fread(*buffer, sizeof(char), size, f) != size) {
- usbmuxd_log(LL_ERROR, "%s: ERROR: couldn't read %d bytes from %s", __func__, (int)size, filename);
- free(*buffer);
- ret = 0;
- errno = EIO;
- }
- fclose(f);
-
- *length = size;
- return ret;
-}
-
-int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length)
-{
- FILE *f;
-
- f = fopen(filename, "wb");
- if (f) {
- size_t written = fwrite(buffer, sizeof(char), length, f);
- fclose(f);
-
- if (written == length) {
- return 1;
- }
- else {
- // Not all data could be written.
- errno = EIO;
- return 0;
- }
- }
- else {
- // Failed to open the file, let the caller know.
- return 0;
- }
-}
-
-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/src/utils.h b/src/utils.h
index b5cab3f..f862271 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <libimobiledevice/utils.h>
+
#ifndef UTILS_H
#define UTILS_H
@@ -73,18 +75,6 @@ void collection_copy(struct collection *dest, struct collection *src);
#ifndef HAVE_STPCPY
char *stpcpy(char * s1, const char * s2);
#endif
-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);