[gentoo-commits] repo/gentoo:master commit in: app-pda/libimobiledevice/, app-pda/libimobiledevice/files/
commit: 5cad7457cbf1cabdc772e0850b98f8b224ddc7ee Author: Matthew Smith gentoo org> AuthorDate: Thu Feb 29 10:20:35 2024 + Commit: Matthew Smith gentoo org> CommitDate: Thu Feb 29 10:21:27 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cad7457 app-pda/libimobiledevice: patch to support cython3 Closes: https://bugs.gentoo.org/898666 Signed-off-by: Matthew Smith gentoo.org> .../files/libimobiledevice-1.3.0-cython3.patch | 48 + .../libimobiledevice-1.3.0-r4.ebuild | 115 + 2 files changed, 163 insertions(+) diff --git a/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-cython3.patch b/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-cython3.patch new file mode 100644 index ..c7b8cf0dcc2f --- /dev/null +++ b/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-cython3.patch @@ -0,0 +1,48 @@ +https://bugs.gentoo.org/898666 +https://github.com/libimobiledevice/libimobiledevice/pull/1521 + +--- a/cython/installation_proxy.pxi b/cython/installation_proxy.pxi +@@ -27,7 +27,7 @@ cdef extern from "libimobiledevice/installation_proxy.h": + instproxy_error_t instproxy_restore(instproxy_client_t client, char *appid, plist.plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) + instproxy_error_t instproxy_remove_archive(instproxy_client_t client, char *appid, plist.plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) + +-cdef void instproxy_notify_cb(plist.plist_t command, plist.plist_t status, void *py_callback) with gil: ++cdef void instproxy_notify_cb(plist.plist_t command, plist.plist_t status, void *py_callback) noexcept: + (py_callback)(plist.plist_t_to_node(command, False), plist.plist_t_to_node(status, False)) + + cdef class InstallationProxyError(BaseError): + +From deba42ba94c13517ebdbe7a4d8177ab47a9589a5 Mon Sep 17 00:00:00 2001 +From: IridiumXOR +Date: Thu, 11 Jan 2024 22:00:39 +0100 +Subject: [PATCH 2/3] Fix np_notify_cb for Cython 3 noexcept error + +--- a/cython/notification_proxy.pxi b/cython/notification_proxy.pxi +@@ -70,7 +70,7 @@ NP_ITDBPREP_DID_END = C_NP_ITDBPREP_DID_END + NP_LANGUAGE_CHANGED = C_NP_LANGUAGE_CHANGED + NP_ADDRESS_BOOK_PREF_CHANGED = C_NP_ADDRESS_BOOK_PREF_CHANGED + +-cdef void np_notify_cb(const_char_ptr notification, void *py_callback): ++cdef void np_notify_cb(const_char_ptr notification, void *py_callback) noexcept: + (py_callback)(notification) + + cdef class NotificationProxyError(BaseError): + +From 7739a4bf61a0fa549646d6062978f126a1ff06fa Mon Sep 17 00:00:00 2001 +From: IridiumXOR +Date: Thu, 11 Jan 2024 22:03:07 +0100 +Subject: [PATCH 3/3] Fix idevice_event_cb for Cython 3 noexcept error + +--- a/cython/imobiledevice.pyx b/cython/imobiledevice.pyx +@@ -94,7 +94,7 @@ cdef class iDeviceEvent: + def __get__(self): + return self._c_event.conn_type + +-cdef void idevice_event_cb(const_idevice_event_t c_event, void *user_data) with gil: ++cdef void idevice_event_cb(const_idevice_event_t c_event, void *user_data) noexcept: + cdef iDeviceEvent event = iDeviceEvent.__new__(iDeviceEvent) + event._c_event = c_event + (user_data)(event) diff --git a/app-pda/libimobiledevice/libimobiledevice-1.3.0-r4.ebuild b/app-pda/libimobiledevice/libimobiledevice-1.3.0-r4.ebuild new file mode 100644 index ..2f506adc337c --- /dev/null +++ b/app-pda/libimobiledevice/libimobiledevice-1.3.0-r4.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} ) + +inherit autotools python-r1 + +DESCRIPTION="Support library to communicate with Apple iPhone/iPod Touch devices" +HOMEPAGE="https://www.libimobiledevice.org/; +SRC_URI="https://github.com/libimobiledevice/libimobiledevice/releases/download/${PV}/${P}.tar.bz2; + +# While COPYING* doesn't mention 'or any later version', all the headers do, hence use + +LICENSE="GPL-2+ LGPL-2.1+" +SLOT="0/1.0-6" # based on SONAME of libimobiledevice-1.0.so +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" +IUSE="doc gnutls python static-libs" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + >=app-pda/libplist-2.2.0:= =app-pda/libusbmuxd-2.0.2:= + gnutls? ( + dev-libs/libgcrypt:0 + >=dev-libs/libtasn1-1.1 + >=net-libs/gnutls-2.2.0 + ) + !gnutls? ( + dev-libs/openssl:0= + ) + python? ( + ${PYTHON_DEPS} + app-pda/libplist[python(-),${PYTHON_USEDEP}] + ) +" +DEPEND=" + ${RDEPEND} +" +BDEPEND=" + virtual/pkgconfig + doc? ( app-text/doxygen ) + python? ( dev-python/cython[${PYTHON_USEDEP}] ) +" + +BUILD_DIR="${S}_build" + +PATCHES=( + "${FILESDIR}/${P}-slibtool.patch" + "${FILESDIR}/${P}-missing_libflags.patch"
[gentoo-commits] repo/gentoo:master commit in: app-pda/libimobiledevice/, app-pda/libimobiledevice/files/
commit: 73d11cc872c3b8d4ca42ed0807bd4889e626cdd1 Author: Matthew Smith gentoo org> AuthorDate: Fri Feb 17 16:56:43 2023 + Commit: Matthew Smith gentoo org> CommitDate: Fri Feb 17 16:59:07 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73d11cc8 app-pda/libimobiledevice: fix Python bindings Also add python3_11 to PYTHON_TARGETS. Signed-off-by: Matthew Smith gentoo.org> .../files/libimobiledevice-1.3.0-python.patch | 223 + .../libimobiledevice-1.3.0-r2.ebuild | 114 +++ 2 files changed, 337 insertions(+) diff --git a/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-python.patch b/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-python.patch new file mode 100644 index ..28ca6da51ebd --- /dev/null +++ b/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-python.patch @@ -0,0 +1,223 @@ +https://github.com/libimobiledevice/libimobiledevice/pull/685 + +From fb337f26c8e58ed0ce0750f7899ccbd5da203dee Mon Sep 17 00:00:00 2001 +From: wendyisgr33n +Date: Mon, 30 Jul 2018 10:43:57 -0700 +Subject: [PATCH 1/5] Fixed AFC afc.pxi definitions for Python2/3 + compatibility. Added missing public method 'remove_path_and_contents' + +--- a/cython/afc.pxi b/cython/afc.pxi +@@ -52,6 +52,7 @@ cdef extern from "libimobiledevice/afc.h": + afc_error_t afc_read_directory(afc_client_t client, char *dir, char ***list) + afc_error_t afc_get_file_info(afc_client_t client, char *filename, char ***infolist) + afc_error_t afc_remove_path(afc_client_t client, char *path) ++afc_error_t afc_remove_path_and_contents(afc_client_t client, char *path) + afc_error_t afc_rename_path(afc_client_t client, char *f, char *to) + afc_error_t afc_make_directory(afc_client_t client, char *dir) + afc_error_t afc_truncate(afc_client_t client, char *path, uint64_t newsize) +@@ -235,17 +236,17 @@ cdef class AfcClient(BaseService): + afc_file_mode_t c_mode + uint64_t handle + AfcFile f +-if mode == 'r': ++if mode == b'r': + c_mode = AFC_FOPEN_RDONLY +-elif mode == 'r+': ++elif mode == b'r+': + c_mode = AFC_FOPEN_RW +-elif mode == 'w': ++elif mode == b'w': + c_mode = AFC_FOPEN_WRONLY +-elif mode == 'w+': ++elif mode == b'w+': + c_mode = AFC_FOPEN_WR +-elif mode == 'a': ++elif mode == b'a': + c_mode = AFC_FOPEN_APPEND +-elif mode == 'a+': ++elif mode == b'a+': + c_mode = AFC_FOPEN_RDAPPEND + else: + raise ValueError("mode string must be 'r', 'r+', 'w', 'w+', 'a', or 'a+'") +@@ -282,6 +283,9 @@ cdef class AfcClient(BaseService): + cpdef remove_path(self, bytes path): + self.handle_error(afc_remove_path(self._c_client, path)) + ++cpdef remove_path_and_contents(self, bytes path): ++self.handle_error(afc_remove_path_and_contents(self._c_client, path)) ++ + cpdef rename_path(self, bytes f, bytes t): + self.handle_error(afc_rename_path(self._c_client, f, t)) + +@@ -308,17 +312,17 @@ cdef class Afc2Client(AfcClient): + afc_file_mode_t c_mode + uint64_t handle + AfcFile f +-if mode == 'r': ++if mode == b'r': + c_mode = AFC_FOPEN_RDONLY +-elif mode == 'r+': ++elif mode == b'r+': + c_mode = AFC_FOPEN_RW +-elif mode == 'w': ++elif mode == b'w': + c_mode = AFC_FOPEN_WRONLY +-elif mode == 'w+': ++elif mode == b'w+': + c_mode = AFC_FOPEN_WR +-elif mode == 'a': ++elif mode == b'a': + c_mode = AFC_FOPEN_APPEND +-elif mode == 'a+': ++elif mode == b'a+': + c_mode = AFC_FOPEN_RDAPPEND + else: + raise ValueError("mode string must be 'r', 'r+', 'w', 'w+', 'a', or 'a+'") + +From b71e8935949a1d6f419a3f783d804809fb4c309b Mon Sep 17 00:00:00 2001 +From: wendyisgr33n +Date: Mon, 30 Jul 2018 10:44:40 -0700 +Subject: [PATCH 2/5] Fixed debugserver.pxi PyString_AsString compatibility + with Python3 + +--- a/cython/debugserver.pxi b/cython/debugserver.pxi +@@ -44,7 +44,12 @@ cdef class DebugServerError(BaseError): + + + # from http://stackoverflow.com/a/17511714 +-from cpython.string cimport PyString_AsString ++# https://github.com/libimobiledevice/libimobiledevice/pull/198 ++from cpython cimport PY_MAJOR_VERSION ++if PY_MAJOR_VERSION <= 2: ++from cpython.string cimport PyString_AsString ++else: ++from cpython.bytes cimport PyBytes_AsString as PyString_AsString + cdef char ** to_cstring_array(list_str): + if not list_str: + return NULL + +From 44f54cdc0ebb052e4a642023bbf96504e6139ec9 Mon Sep 17 00:00:00 2001 +From: wendyisgr33n +Date: Mon, 30 Jul 2018 10:45:22 -0700 +Subject: [PATCH 3/5] Fixed bytes/strings check in
[gentoo-commits] repo/gentoo:master commit in: app-pda/libimobiledevice/, app-pda/libimobiledevice/files/
commit: 17e61fb1aa62d3de6ae10b48689a9f58eb74cd1a Author: Stefan Strogin gentoo org> AuthorDate: Sat Aug 15 05:47:57 2020 + Commit: Stefan Strogin gentoo org> CommitDate: Sat Aug 15 05:49:41 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17e61fb1 app-pda/libimobiledevice: add patch for LibreSSL Closes: https://bugs.gentoo.org/732908 Package-Manager: Portage-3.0.2, Repoman-2.3.23 Signed-off-by: Stefan Strogin gentoo.org> .../files/libimobiledevice-1.3.0-libressl.patch| 25 ++ .../libimobiledevice-1.3.0-r1.ebuild | 2 ++ 2 files changed, 27 insertions(+) diff --git a/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-libressl.patch b/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-libressl.patch new file mode 100644 index 000..0957c9132cb --- /dev/null +++ b/app-pda/libimobiledevice/files/libimobiledevice-1.3.0-libressl.patch @@ -0,0 +1,25 @@ +From 170e1c445e8c930f4ee9dddfb9f1bcf24c089962 Mon Sep 17 00:00:00 2001 +From: Nikias Bassen +Date: Thu, 6 Aug 2020 20:43:08 +0200 +Subject: [PATCH] idevice: Fix build with LibreSSL + +Upstream-Status: Accepted +[https://github.com/libimobiledevice/libimobiledevice/commit/170e1c445e8c930f4ee9dddfb9f1bcf24c089962] +Signed-off-by: Stefan Strogin +--- + src/idevice.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/idevice.c b/src/idevice.c +index fea1e03f..47c9ab4d 100644 +--- a/src/idevice.c b/src/idevice.c +@@ -1015,7 +1015,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_conne + return ret; + } + +-#if OPENSSL_VERSION_NUMBER >= 0x1010L ++#if OPENSSL_VERSION_NUMBER >= 0x1010L && !defined(LIBRESSL_VERSION_NUMBER) + SSL_CTX_set_security_level(ssl_ctx, 0); + #endif + diff --git a/app-pda/libimobiledevice/libimobiledevice-1.3.0-r1.ebuild b/app-pda/libimobiledevice/libimobiledevice-1.3.0-r1.ebuild index 2a630796735..8ff61a7c4d2 100644 --- a/app-pda/libimobiledevice/libimobiledevice-1.3.0-r1.ebuild +++ b/app-pda/libimobiledevice/libimobiledevice-1.3.0-r1.ebuild @@ -46,6 +46,8 @@ BDEPEND=" BUILD_DIR="${S}_build" +PATCHES=( "${FILESDIR}"/${P}-libressl.patch ) + src_prepare() { default eautoreconf
[gentoo-commits] repo/gentoo:master commit in: app-pda/libimobiledevice/, app-pda/libimobiledevice/files/
commit: d4f23796f967afde488c80117818668369ecbf4b Author: James Le Cuirot gentoo org> AuthorDate: Sun May 22 09:05:10 2016 + Commit: James Le Cuirot gentoo org> CommitDate: Sun May 22 09:05:36 2016 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4f23796 app-pda/libimobiledevice: Apply upstream patch for newer gnutls (#582758) Package-Manager: portage-2.3.0_rc1 app-pda/libimobiledevice/files/gnutls-3.4.patch| 51 ++ .../libimobiledevice/libimobiledevice-1.2.0.ebuild | 4 ++ 2 files changed, 55 insertions(+) diff --git a/app-pda/libimobiledevice/files/gnutls-3.4.patch b/app-pda/libimobiledevice/files/gnutls-3.4.patch new file mode 100644 index 000..9b4b833 --- /dev/null +++ b/app-pda/libimobiledevice/files/gnutls-3.4.patch @@ -0,0 +1,51 @@ +From 2a5868411c57e25802d2f16fd6b77601f10d0b72 Mon Sep 17 00:00:00 2001 +From: Nikos Mavrogiannopoulos+Date: Fri, 29 Apr 2016 22:58:34 +0200 +Subject: [PATCH] Updated gnutls certificate callback to new API (backwards + compatible) + +--- + src/idevice.c | 13 + + 1 file changed, 13 insertions(+) + +diff --git a/src/idevice.c b/src/idevice.c +index 5912aeb..f2de6a3 100644 +--- a/src/idevice.c b/src/idevice.c +@@ -642,7 +642,11 @@ static const char *ssl_error_to_string(int e) + /** + * Internally used gnutls callback function that gets called during handshake. + */ ++#if GNUTLS_VERSION_NUMBER >= 0x020b07 ++static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t * req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t * sign_algos, int sign_algos_length, gnutls_retr2_st * st) ++#else + static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t * req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t * sign_algos, int sign_algos_length, gnutls_retr_st * st) ++#endif + { + int res = -1; + gnutls_certificate_type_t type = gnutls_certificate_type_get(session); +@@ -650,7 +654,12 @@ static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t + ssl_data_t ssl_data = (ssl_data_t)gnutls_session_get_ptr(session); + if (ssl_data && ssl_data->host_privkey && ssl_data->host_cert) { + debug_info("Passing certificate"); ++#if GNUTLS_VERSION_NUMBER >= 0x020b07 ++ st->cert_type = type; ++ st->key_type = GNUTLS_PRIVKEY_X509; ++#else + st->type = type; ++#endif + st->ncerts = 1; + st->cert.x509 = _data->host_cert; + st->key.x509 = ssl_data->host_privkey; +@@ -759,7 +768,11 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_conne + debug_info("enabling SSL mode"); + errno = 0; + gnutls_certificate_allocate_credentials(_data_loc->certificate); ++#if GNUTLS_VERSION_NUMBER >= 0x020b07 ++ gnutls_certificate_set_retrieve_function(ssl_data_loc->certificate, internal_cert_callback); ++#else + gnutls_certificate_client_set_retrieve_function(ssl_data_loc->certificate, internal_cert_callback); ++#endif + gnutls_init(_data_loc->session, GNUTLS_CLIENT); + gnutls_priority_set_direct(ssl_data_loc->session, "NONE:+VERS-SSL3.0:+ANON-DH:+RSA:+AES-128-CBC:+AES-256-CBC:+SHA1:+MD5:+COMP-NULL", NULL); + gnutls_credentials_set(ssl_data_loc->session, GNUTLS_CRD_CERTIFICATE, ssl_data_loc->certificate); diff --git a/app-pda/libimobiledevice/libimobiledevice-1.2.0.ebuild b/app-pda/libimobiledevice/libimobiledevice-1.2.0.ebuild index 0022327..47d6c54 100644 --- a/app-pda/libimobiledevice/libimobiledevice-1.2.0.ebuild +++ b/app-pda/libimobiledevice/libimobiledevice-1.2.0.ebuild @@ -38,6 +38,10 @@ DOCS=( AUTHORS NEWS README ) BUILD_DIR="${S}_build" +src_prepare() { + epatch "${FILESDIR}/gnutls-3.4.patch" +} + src_configure() { local ECONF_SOURCE=${S}