app-pda/libplist: keyword ~arm64
[gentoo.git] / app-pda / libplist / libplist-2.0.0.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5 PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
6 inherit autotools eutils python-r1
7
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"
11
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"
16
17 RDEPEND="python? ( ${PYTHON_DEPS} )"
18 DEPEND="${RDEPEND}
19         virtual/pkgconfig
20         python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )"
21
22 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
23
24 DOCS=( AUTHORS NEWS README )
25
26 BUILD_DIR="${S}_build"
27
28 src_prepare() {
29         default
30
31         eautoreconf
32 }
33
34 src_configure() {
35         local ECONF_SOURCE=${S}
36         local myeconfargs=( $(use_enable static-libs static) )
37
38         do_configure() {
39                 mkdir -p "${BUILD_DIR}" || die
40                 pushd "${BUILD_DIR}" >/dev/null || die
41                 econf "${myeconfargs[@]}" "${@}"
42                 popd >/dev/null || die
43         }
44
45         do_configure_python() {
46                 PYTHON_LDFLAGS="$(python_get_LIBS)" do_configure "$@"
47         }
48
49         do_configure --without-cython
50         use python && python_foreach_impl do_configure_python
51 }
52
53 src_compile() {
54         python_compile() {
55                 emake -C "${BUILD_DIR}"/cython -j1 \
56                         VPATH="${S}/cython:${native_builddir}/cython" \
57                         plist_la_LIBADD="${native_builddir}/src/libplist.la"
58         }
59
60         local native_builddir=${BUILD_DIR}
61         pushd "${BUILD_DIR}" >/dev/null || die
62         emake -j1
63         use python && python_foreach_impl python_compile
64         popd >/dev/null || die
65 }
66
67 src_install() {
68         python_install() {
69                 emake -C "${BUILD_DIR}/cython" -j1 \
70                         VPATH="${S}/cython:${native_builddir}/cython" \
71                         DESTDIR="${D}" install
72         }
73
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
79
80         einstalldocs
81
82         if use python ; then
83                 insinto /usr/include/plist/cython
84                 doins cython/plist.pxd
85         fi
86         prune_libtool_files --all
87 }