1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python{2_7,3_4,3_5} )
6 inherit eutils autotools python-r1
8 DESCRIPTION="Support library to communicate with Apple iPhone/iPod Touch devices"
9 HOMEPAGE="http://www.libimobiledevice.org/"
10 SRC_URI="https://github.com/${PN}/${PN}/archive/master.zip -> ${PN}.zip"
12 # While COPYING* doesn't mention 'or any later version', all the headers do, hence use +
13 LICENSE="GPL-2+ LGPL-2.1+"
14 SLOT="0/6" # based on SONAME of libimobiledevice.so
15 KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86"
16 IUSE="gnutls python static-libs"
18 RDEPEND=">=app-pda/libplist-1.11:=
19 >=app-pda/libusbmuxd-1.0.9:=
22 >=dev-libs/libtasn1-1.1
23 >=net-libs/gnutls-2.2.0
25 !gnutls? ( dev-libs/openssl:0 )
28 app-pda/libplist[python(-),${PYTHON_USEDEP}]
32 python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )"
34 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
36 DOCS=( AUTHORS NEWS README )
38 BUILD_DIR="${S}_build"
39 S="${WORKDIR}/${PN}-master"
42 #epatch "${FILESDIR}/gnutls-3.4.patch"
47 local ECONF_SOURCE=${S}
49 local myeconfargs=( $(use_enable static-libs static) )
50 use gnutls && myeconfargs+=( --disable-openssl )
53 mkdir -p "${BUILD_DIR}" || die
54 pushd "${BUILD_DIR}" >/dev/null || die
55 econf "${myeconfargs[@]}" "${@}"
56 popd >/dev/null || die
59 do_configure_python() {
61 PYTHON_LDFLAGS="$(python_get_LIBS)" do_configure "$@"
64 do_configure --without-cython
65 use python && python_foreach_impl do_configure_python
70 emake -C "${BUILD_DIR}"/cython -j1 \
71 VPATH="${S}/cython:${native_builddir}/cython" \
72 imobiledevice_la_LIBADD="${native_builddir}/src/libimobiledevice.la"
75 local native_builddir=${BUILD_DIR}
76 pushd "${BUILD_DIR}" >/dev/null || die
78 use python && python_foreach_impl python_compile
79 popd >/dev/null || die
84 emake -C "${BUILD_DIR}/cython" -j1 \
85 VPATH="${S}/cython:${native_builddir}/cython" \
86 DESTDIR="${D}" install
89 local native_builddir=${BUILD_DIR}
90 pushd "${BUILD_DIR}" >/dev/null || die
91 emake -j1 DESTDIR="${D}" install
92 use python && python_foreach_impl python_install
93 popd >/dev/null || die
97 insinto /usr/include/${PN}/cython
98 doins cython/imobiledevice.pxd
100 prune_libtool_files --all