*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-libs / libical / libical-3.0.6.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} )
7 VALA_USE_DEPEND="vapigen"
8 inherit cmake python-any-r1 vala
9
10 DESCRIPTION="An implementation of basic iCAL protocols"
11 HOMEPAGE="https://github.com/libical/libical"
12 SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.gz"
13
14 LICENSE="|| ( MPL-2.0 LGPL-2.1 )"
15 SLOT="0/3"
16 KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
17 IUSE="berkdb doc examples introspection static-libs test vala"
18 RESTRICT="!test? ( test )"
19 REQUIRED_USE="vala? ( introspection )"
20
21 BDEPEND="
22         dev-lang/perl
23         virtual/pkgconfig
24         doc? ( app-doc/doxygen )
25         introspection? ( dev-libs/gobject-introspection )
26         test? ( ${PYTHON_DEPS} )
27         vala? ( $(vala_depend) )
28 "
29 COMMON_DEPEND="
30         dev-libs/icu:=
31         berkdb? ( sys-libs/db:= )
32         introspection? ( dev-libs/glib:2 )
33 "
34 DEPEND="${COMMON_DEPEND}
35         introspection? ( dev-libs/libxml2:2 )
36 "
37 RDEPEND="${COMMON_DEPEND}
38         sys-libs/timezone-data
39 "
40
41 DOCS=(
42         AUTHORS ReadMe.txt ReleaseNotes.txt TEST THANKS TODO
43         doc/{AddingOrModifyingComponents,UsingLibical}.txt
44 )
45
46 PATCHES=(
47         "${FILESDIR}/${PN}-3.0.4-tests.patch"
48         "${FILESDIR}/${PN}-3.0.5-pkgconfig-libdir.patch"
49 )
50
51 pkg_setup() {
52         use test && python-any-r1_pkg_setup
53 }
54
55 src_prepare() {
56         cmake_src_prepare
57         use examples || cmake_comment_add_subdirectory examples
58         use vala && vala_src_prepare
59 }
60
61 src_configure() {
62         local mycmakeargs=(
63                 $(cmake_use_find_package berkdb BDB)
64                 -DICAL_BUILD_DOCS=$(usex doc)
65                 -DICAL_GLIB=$(usex introspection)
66                 -DGOBJECT_INTROSPECTION=$(usex introspection)
67                 -DSHARED_ONLY=$(usex !static-libs)
68                 -DLIBICAL_BUILD_TESTING=$(usex test)
69                 -DICAL_GLIB_VAPI=$(usex vala)
70         )
71         if use vala; then
72                 mycmakeargs+=(
73                         -DVALAC="${VALAC}"
74                         -DVAPIGEN="${VAPIGEN}"
75                 )
76         fi
77         cmake_src_configure
78 }
79
80 src_compile() {
81         cmake_src_compile
82         use doc && cmake_src_compile docs
83 }
84
85 src_test() {
86         local myctestargs=(
87                 -E "(icalrecurtest|icalrecurtest-r)" # bug 660282
88         )
89
90         cmake_src_test
91 }
92
93 src_install() {
94         use doc && HTML_DOCS=( "${BUILD_DIR}"/apidocs/html/. )
95
96         cmake_src_install
97
98         if use examples; then
99                 rm examples/CMakeLists.txt || die
100                 dodoc -r examples
101         fi
102 }