1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7,8} )
7 inherit autotools python-r1 toolchain-funcs
9 DESCRIPTION="Support library to deal with Apple Property Lists (Binary & XML)"
10 HOMEPAGE="https://www.libimobiledevice.org/"
11 SRC_URI="https://cgit.libimobiledevice.org/${PN}.git/snapshot/${P}.tar.bz2"
13 LICENSE="GPL-2 LGPL-2.1"
15 KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86"
16 IUSE="python static-libs"
18 RDEPEND="python? ( ${PYTHON_DEPS} )"
22 python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )
25 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
27 DOCS=( AUTHORS NEWS README.md )
29 BUILD_DIR="${S}_build"
37 local ECONF_SOURCE=${S}
38 local myeconfargs=( $(use_enable static-libs static) )
41 mkdir -p "${BUILD_DIR}" || die
42 pushd "${BUILD_DIR}" >/dev/null || die
43 econf "${myeconfargs[@]}" "${@}"
44 popd >/dev/null || die
47 do_configure_python() {
48 local -x PYTHON_LDFLAGS="$(python_get_LIBS)"
55 do_configure --without-cython
56 use python && python_foreach_impl do_configure_python
61 emake -C "${BUILD_DIR}"/cython \
62 VPATH="${S}/cython:${native_builddir}/cython" \
63 plist_la_LIBADD="${native_builddir}/src/libplist.la"
66 local native_builddir=${BUILD_DIR}
67 pushd "${BUILD_DIR}" >/dev/null || die
69 use python && python_foreach_impl python_compile
70 popd >/dev/null || die
74 emake -C "${BUILD_DIR}" check
79 emake -C "${BUILD_DIR}/cython" \
80 VPATH="${S}/cython:${native_builddir}/cython" \
81 DESTDIR="${D}" install
84 local native_builddir=${BUILD_DIR}
85 pushd "${BUILD_DIR}" >/dev/null || die
86 emake DESTDIR="${D}" install
87 use python && python_foreach_impl python_install
88 popd >/dev/null || die
93 insinto /usr/include/plist/cython
94 doins cython/plist.pxd
97 find "${D}" -name '*.la' -delete || die