sys-process/glances: revbump 3.1.4.1, add missing doc dep
[gentoo.git] / app-pda / libplist / libplist-2.1.0.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 PYTHON_COMPAT=( python3_{6,7,8} )
7 inherit autotools python-r1 toolchain-funcs
8
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"
12
13 LICENSE="GPL-2 LGPL-2.1"
14 SLOT="0/3"
15 KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86"
16 IUSE="python static-libs"
17
18 RDEPEND="python? ( ${PYTHON_DEPS} )"
19 DEPEND="${RDEPEND}"
20 BDEPEND="
21         virtual/pkgconfig
22         python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )
23 "
24
25 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
26
27 DOCS=( AUTHORS NEWS README.md )
28
29 BUILD_DIR="${S}_build"
30
31 src_prepare() {
32         default
33         eautoreconf
34 }
35
36 src_configure() {
37         local ECONF_SOURCE=${S}
38         local myeconfargs=( $(use_enable static-libs static) )
39
40         do_configure() {
41                 mkdir -p "${BUILD_DIR}" || die
42                 pushd "${BUILD_DIR}" >/dev/null || die
43                 econf "${myeconfargs[@]}" "${@}"
44                 popd >/dev/null || die
45         }
46
47         do_configure_python() {
48                 local -x PYTHON_LDFLAGS="$(python_get_LIBS)"
49                 do_configure "$@"
50         }
51
52         # Don't prefer clang.
53         tc-export CC CXX
54
55         do_configure --without-cython
56         use python && python_foreach_impl do_configure_python
57 }
58
59 src_compile() {
60         python_compile() {
61                 emake -C "${BUILD_DIR}"/cython \
62                         VPATH="${S}/cython:${native_builddir}/cython" \
63                         plist_la_LIBADD="${native_builddir}/src/libplist.la"
64         }
65
66         local native_builddir=${BUILD_DIR}
67         pushd "${BUILD_DIR}" >/dev/null || die
68         emake
69         use python && python_foreach_impl python_compile
70         popd >/dev/null || die
71 }
72
73 src_test() {
74         emake -C "${BUILD_DIR}" check
75 }
76
77 src_install() {
78         python_install() {
79                 emake -C "${BUILD_DIR}/cython" \
80                         VPATH="${S}/cython:${native_builddir}/cython" \
81                         DESTDIR="${D}" install
82         }
83
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
89
90         einstalldocs
91
92         if use python ; then
93                 insinto /usr/include/plist/cython
94                 doins cython/plist.pxd
95         fi
96
97         find "${D}" -name '*.la' -delete || die
98 }