1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python3_{8..10} )
9 inherit autotools python-r1
11 DESCRIPTION="Support library to communicate with Apple iPhone/iPod Touch devices"
12 HOMEPAGE="https://www.libimobiledevice.org/"
13 SRC_URI="https://cgit.libimobiledevice.org/libimobiledevice.git/snapshot/libimobiledevice-${COMMIT}.tar.bz2 -> ${P}.tar.bz2"
15 # While COPYING* doesn't mention 'or any later version', all the headers do, hence use +
16 LICENSE="GPL-2+ LGPL-2.1+"
18 SLOT="0/6" # based on SONAME of libimobiledevice.so
20 KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86"
21 IUSE="doc gnutls libressl python static-libs"
22 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
25 >=app-pda/libplist-1.11:=
26 >=app-pda/libusbmuxd-1.1.0:=
29 >=dev-libs/libtasn1-1.1
30 >=net-libs/gnutls-2.2.0 )
32 !libressl? ( dev-libs/openssl:0= )
33 libressl? ( dev-libs/libressl:0= ) )
36 app-pda/libplist[python(-),${PYTHON_USEDEP}] )
45 doc? ( app-doc/doxygen )
46 python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )
49 S="${WORKDIR}/${PN}-${COMMIT}"
50 BUILD_DIR="${S}_build"
58 local ECONF_SOURCE=${S}
60 local myeconfargs=( $(use_enable static-libs static) )
61 use gnutls && myeconfargs+=( --disable-openssl )
64 mkdir -p "${BUILD_DIR}" || die
65 pushd "${BUILD_DIR}" >/dev/null || die
66 econf "${myeconfargs[@]}" "${@}"
67 popd >/dev/null || die
70 do_configure_python() {
72 local -x PYTHON_LDFLAGS="$(python_get_LIBS)"
76 do_configure --without-cython
77 use python && python_foreach_impl do_configure_python
82 emake -C "${BUILD_DIR}"/cython \
83 VPATH="${S}/cython:$1/cython" \
84 imobiledevice_la_LIBADD="$1/src/libimobiledevice.la"
87 emake -C "${BUILD_DIR}"
88 use python && python_foreach_impl python_compile "${BUILD_DIR}"
91 doxygen "${BUILD_DIR}"/doxygen.cfg || die
97 emake -C "${BUILD_DIR}/cython" install \
99 VPATH="${S}/cython:$1/cython"
102 emake -C "${BUILD_DIR}" install DESTDIR="${D}"
103 use python && python_foreach_impl python_install "${BUILD_DIR}"
104 use doc && dodoc docs/html/*
107 insinto /usr/include/${PN}/cython
108 doins cython/imobiledevice.pxd
111 find "${D}" -name '*.la' -delete || die