Add app-pda/{ifuse,libimobiledevice}-9999
[shuber-gentoo-overlay.git] / app-pda / libimobiledevice / libimobiledevice-9999.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 PYTHON_COMPAT=( python{2_7,3_4,3_5} )
6 inherit eutils autotools python-r1
7
8 DESCRIPTION="Support library to communicate with Apple iPhone/iPod Touch devices"
9 HOMEPAGE="http://www.libimobiledevice.org/"
10 SRC_URI="https://github.com/libimobiledevice/${PN}/archive/master.zip -> ${PN}.zip"
11
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"
17
18 RDEPEND=">=app-pda/libplist-1.11:=
19 >=app-pda/libusbmuxd-1.0.9:=
20 gnutls? (
21 dev-libs/libgcrypt:0
22 >=dev-libs/libtasn1-1.1
23 >=net-libs/gnutls-2.2.0
24 )
25 !gnutls? ( dev-libs/openssl:0 )
26 python? (
27 ${PYTHON_DEPS}
28 app-pda/libplist[python(-),${PYTHON_USEDEP}]
29 )"
30 DEPEND="${RDEPEND}
31 virtual/pkgconfig
32 python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )"
33
34 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
35
36 DOCS=( AUTHORS NEWS README )
37
38 BUILD_DIR="${S}_build"
39 S="${WORKDIR}/${PN}-master"
40
41 src_prepare() {
42 #epatch "${FILESDIR}/gnutls-3.4.patch"
43 eautoreconf
44 }
45
46 src_configure() {
47 local ECONF_SOURCE=${S}
48
49 local myeconfargs=( $(use_enable static-libs static) )
50 use gnutls && myeconfargs+=( --disable-openssl )
51
52 do_configure() {
53 mkdir -p "${BUILD_DIR}" || die
54 pushd "${BUILD_DIR}" >/dev/null || die
55 econf "${myeconfargs[@]}" "${@}"
56 popd >/dev/null || die
57 }
58
59 do_configure_python() {
60 # Bug 567916
61 PYTHON_LDFLAGS="$(python_get_LIBS)" do_configure "$@"
62 }
63
64 do_configure --without-cython
65 use python && python_foreach_impl do_configure_python
66 }
67
68 src_compile() {
69 python_compile() {
70 emake -C "${BUILD_DIR}"/cython -j1 \
71 VPATH="${S}/cython:${native_builddir}/cython" \
72 imobiledevice_la_LIBADD="${native_builddir}/src/libimobiledevice.la"
73 }
74
75 local native_builddir=${BUILD_DIR}
76 pushd "${BUILD_DIR}" >/dev/null || die
77 emake -j1
78 use python && python_foreach_impl python_compile
79 popd >/dev/null || die
80 }
81
82 src_install() {
83 python_install() {
84 emake -C "${BUILD_DIR}/cython" -j1 \
85 VPATH="${S}/cython:${native_builddir}/cython" \
86 DESTDIR="${D}" install
87 }
88
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
94
95 #dodoc docs/html/*
96 if use python; then
97 insinto /usr/include/${PN}/cython
98 doins cython/imobiledevice.pxd
99 fi
100 prune_libtool_files --all
101 }