media-gfx/cgal-ipelets: Add cgal-ipelets-5.6
[shuber-gentoo-overlay.git] / app-pda / libimobiledevice / libimobiledevice-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 COMMIT="master"
7 PYTHON_COMPAT=( python3_{6..9} )
8
9 inherit autotools python-r1
10
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"
14
15 # While COPYING* doesn't mention 'or any later version', all the headers do, hence use +
16 LICENSE="GPL-2+ LGPL-2.1+"
17
18 SLOT="0/6" # based on SONAME of libimobiledevice.so
19
20 KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86"
21 IUSE="doc gnutls libressl python static-libs"
22 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
23
24 RDEPEND="
25 >=app-pda/libplist-1.11:=
26 >=app-pda/libusbmuxd-1.1.0:=
27 gnutls? (
28 dev-libs/libgcrypt:0
29 >=dev-libs/libtasn1-1.1
30 >=net-libs/gnutls-2.2.0 )
31 !gnutls? (
32 !libressl? ( dev-libs/openssl:0= )
33 libressl? ( dev-libs/libressl:0= ) )
34 python? (
35 ${PYTHON_DEPS}
36 app-pda/libplist[python(-),${PYTHON_USEDEP}] )
37 "
38
39 DEPEND="
40 ${RDEPEND}
41 "
42
43 BDEPEND="
44 virtual/pkgconfig
45 doc? ( app-doc/doxygen )
46 python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )
47 "
48
49 S="${WORKDIR}/${PN}-${COMMIT}"
50 BUILD_DIR="${S}_build"
51
52 src_prepare() {
53 default
54 eautoreconf
55 }
56
57 src_configure() {
58 local ECONF_SOURCE=${S}
59
60 local myeconfargs=( $(use_enable static-libs static) )
61 use gnutls && myeconfargs+=( --disable-openssl )
62
63 do_configure() {
64 mkdir -p "${BUILD_DIR}" || die
65 pushd "${BUILD_DIR}" >/dev/null || die
66 econf "${myeconfargs[@]}" "${@}"
67 popd >/dev/null || die
68 }
69
70 do_configure_python() {
71 # Bug 567916
72 local -x PYTHON_LDFLAGS="$(python_get_LIBS)"
73 do_configure "$@"
74 }
75
76 do_configure --without-cython
77 use python && python_foreach_impl do_configure_python
78 }
79
80 src_compile() {
81 python_compile() {
82 emake -C "${BUILD_DIR}"/cython \
83 VPATH="${S}/cython:$1/cython" \
84 imobiledevice_la_LIBADD="$1/src/libimobiledevice.la"
85 }
86
87 emake -C "${BUILD_DIR}"
88 use python && python_foreach_impl python_compile "${BUILD_DIR}"
89
90 if use doc; then
91 doxygen "${BUILD_DIR}"/doxygen.cfg || die
92 fi
93 }
94
95 src_install() {
96 python_install() {
97 emake -C "${BUILD_DIR}/cython" install \
98 DESTDIR="${D}" \
99 VPATH="${S}/cython:$1/cython"
100 }
101
102 emake -C "${BUILD_DIR}" install DESTDIR="${D}"
103 use python && python_foreach_impl python_install "${BUILD_DIR}"
104 use doc && dodoc docs/html/*
105
106 if use python; then
107 insinto /usr/include/${PN}/cython
108 doins cython/imobiledevice.pxd
109 fi
110
111 find "${D}" -name '*.la' -delete || die
112 }