libimobiledevice: sync with gentoo

This commit is contained in:
blshkv 2016-06-26 09:22:12 +08:00
parent e364197ff5
commit a437569f54
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
5 changed files with 57 additions and 135 deletions

View file

@ -1,2 +1 @@
DIST libimobiledevice-1.1.7.tar.bz2 626752 SHA256 e6afaad739f8deeb5b9c5c99fac7d01c818fa944b18ef3d3ae0456453d2eb2b0 SHA512 385c8d35ca24b6a2e542d2d7ada024bba29f5504c0e5fddd6bed5a93308fc2b4da030fc05baca8a611dcfe9db335ad7efcc02eee2fa7b8ee061256a6139eb20b WHIRLPOOL 00e956dd1e3985eeb91d20ee7ed6344fcccf17f6947c062f3a553cea12050c34fc5e5d68608e830f514c3d5b8b98904c572a44e1ddca6597c75a70b78fc8e7fb
DIST libimobiledevice-1.2.0.tar.bz2 631495 SHA256 786b0de0875053bf61b5531a86ae8119e320edab724fc62fe2150cc931f11037 SHA512 0de5f768aeb5d62445892855d84ceaff776f6667733c351ed6c34bf9d500802762d1a06e5efdf57f33cafc9ee788041cd9b6748fb9bad6c2e4ae2f9b9aa93589 WHIRLPOOL ca0d709fcc844811fa19b1b149afd81c15f75c213384789b1bc1a4ec838f12ffa33c6f78753befd4eae81156cb1c002d24e7ddc50a59f374164c33ddfd37ddb6

View file

@ -0,0 +1,51 @@
From 2a5868411c57e25802d2f16fd6b77601f10d0b72 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
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 = &ssl_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(&ssl_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(&ssl_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);

View file

@ -1,66 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} )
AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
inherit autotools-utils multilib python-r1
DESCRIPTION="Support library to communicate with Apple iPhone/iPod Touch devices"
HOMEPAGE="http://www.libimobiledevice.org/"
SRC_URI="http://www.libimobiledevice.org/downloads/${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/4" # based on SONAME of libimobiledevice.so
KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86"
IUSE="gnutls python static-libs"
RDEPEND=">=app-pda/libplist-1.12:=[python?,${PYTHON_USEDEP}]
>=app-pda/libusbmuxd-1.0.10:=
gnutls? (
dev-libs/libgcrypt:0
>=dev-libs/libtasn1-1.1
>=net-libs/gnutls-2.2.0
)
!gnutls? ( dev-libs/openssl:0 )"
DEPEND="${RDEPEND}
virtual/pkgconfig
python? (
${PYTHON_DEPS}
>=dev-python/cython-0.17[${PYTHON_USEDEP}]
)"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
DOCS=( AUTHORS NEWS README )
pkg_setup() {
# Prevent linking to the installed copy
if has_version "<${CATEGORY}/${P}"; then
rm -f "${EROOT}"/usr/$(get_libdir)/${PN}$(get_libname)
fi
}
src_configure() {
local myeconfargs=( $(use_enable static-libs static) )
use gnutls && myeconfargs+=( --disable-openssl )
use python || myeconfargs+=( --without-cython )
python_foreach_impl autotools-utils_src_configure
}
src_compile() {
python_foreach_impl autotools-utils_src_compile
}
src_install() {
python_foreach_impl autotools-utils_src_install
dohtml docs/html/*
if use python; then
insinto /usr/include/${PN}/cython
doins cython/imobiledevice.pxd
fi
}

View file

@ -16,8 +16,8 @@ SLOT="0/6" # based on SONAME of libimobiledevice.so
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
IUSE="gnutls python static-libs"
RDEPEND=">=app-pda/libplist-1.11:=
>=app-pda/libusbmuxd-1.0.9:=
RDEPEND=">=app-pda/libplist-1.12:=
>=app-pda/libusbmuxd-1.0.10:=
gnutls? (
dev-libs/libgcrypt:0
>=dev-libs/libtasn1-1.1
@ -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}

View file

@ -1,66 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} )
AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
inherit autotools-utils multilib python-r1
DESCRIPTION="Support library to communicate with Apple iPhone/iPod Touch devices"
HOMEPAGE="http://www.libimobiledevice.org/"
SRC_URI="http://www.libimobiledevice.org/downloads/${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/4" # based on SONAME of libimobiledevice.so
KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86"
IUSE="gnutls python static-libs"
RDEPEND=">=app-pda/libplist-1.12:=[python?,${PYTHON_USEDEP}]
>=app-pda/libusbmuxd-1.0.10:=
gnutls? (
dev-libs/libgcrypt:0
>=dev-libs/libtasn1-1.1
>=net-libs/gnutls-2.2.0
)
!gnutls? ( dev-libs/openssl:0 )"
DEPEND="${RDEPEND}
virtual/pkgconfig
python? (
${PYTHON_DEPS}
>=dev-python/cython-0.17[${PYTHON_USEDEP}]
)"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
DOCS=( AUTHORS NEWS README )
pkg_setup() {
# Prevent linking to the installed copy
if has_version "<${CATEGORY}/${P}"; then
rm -f "${EROOT}"/usr/$(get_libdir)/${PN}$(get_libname)
fi
}
src_configure() {
local myeconfargs=( $(use_enable static-libs static) )
use gnutls && myeconfargs+=( --disable-openssl )
use python || myeconfargs+=( --without-cython )
python_foreach_impl autotools-utils_src_configure
}
src_compile() {
python_foreach_impl autotools-utils_src_compile
}
src_install() {
python_foreach_impl autotools-utils_src_install
dohtml docs/html/*
if use python; then
insinto /usr/include/${PN}/cython
doins cython/imobiledevice.pxd
fi
}