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,3_6} )
6 inherit autotools eutils python-r1
8 DESCRIPTION="Support library to deal with Apple Property Lists (Binary & XML)"
9 HOMEPAGE="http://www.libimobiledevice.org/"
10 SRC_URI="http://www.libimobiledevice.org/downloads/${P}.tar.bz2"
12 LICENSE="GPL-2 LGPL-2.1"
13 SLOT="0/3.1.0" # based on SONAME of libplist.so
14 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-fbsd"
15 IUSE="python static-libs"
17 RDEPEND="python? ( ${PYTHON_DEPS} )"
20 python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )"
22 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
24 DOCS=( AUTHORS NEWS README )
26 BUILD_DIR="${S}_build"
35 local ECONF_SOURCE=${S}
36 local myeconfargs=( $(use_enable static-libs static) )
39 mkdir -p "${BUILD_DIR}" || die
40 pushd "${BUILD_DIR}" >/dev/null || die
41 econf "${myeconfargs[@]}" "${@}"
42 popd >/dev/null || die
45 do_configure_python() {
46 PYTHON_LDFLAGS="$(python_get_LIBS)" do_configure "$@"
49 do_configure --without-cython
50 use python && python_foreach_impl do_configure_python
55 emake -C "${BUILD_DIR}"/cython -j1 \
56 VPATH="${S}/cython:${native_builddir}/cython" \
57 plist_la_LIBADD="${native_builddir}/src/libplist.la"
60 local native_builddir=${BUILD_DIR}
61 pushd "${BUILD_DIR}" >/dev/null || die
63 use python && python_foreach_impl python_compile
64 popd >/dev/null || die
69 emake -C "${BUILD_DIR}/cython" -j1 \
70 VPATH="${S}/cython:${native_builddir}/cython" \
71 DESTDIR="${D}" install
74 local native_builddir=${BUILD_DIR}
75 pushd "${BUILD_DIR}" >/dev/null || die
76 emake -j1 DESTDIR="${D}" install
77 use python && python_foreach_impl python_install
78 popd >/dev/null || die
83 insinto /usr/include/plist/cython
84 doins cython/plist.pxd
86 prune_libtool_files --all