fe0236af8a46ad9133498358eb7d444fc0f0f0f9
[gentoo.git] / dev-libs / libical / libical-3.0.3.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_{4,5,6} )
7 inherit cmake-utils python-any-r1
8
9 DESCRIPTION="An implementation of basic iCAL protocols"
10 HOMEPAGE="https://github.com/libical/libical"
11 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="|| ( MPL-2.0 LGPL-2.1 )"
14 SLOT="0/3"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
16 IUSE="berkdb doc examples static-libs test"
17
18 # TODO: disabled until useful
19 #       glib? (
20 #               dev-libs/glib:2
21 #               dev-libs/libxml2:2
22 #       )
23 #       introspection? ( dev-libs/gobject-introspection:= )
24 COMMON_DEPEND="
25         dev-libs/icu:=
26         berkdb? ( sys-libs/db:= )
27 "
28 DEPEND="${COMMON_DEPEND}
29         dev-lang/perl
30         virtual/pkgconfig
31         doc? ( app-doc/doxygen )
32         test? ( ${PYTHON_DEPS} )
33 "
34 RDEPEND="${COMMON_DEPEND}
35         sys-libs/timezone-data
36 "
37
38 DOCS=(
39         AUTHORS ReadMe.txt ReleaseNotes.txt TEST THANKS TODO
40         doc/{AddingOrModifyingComponents,UsingLibical}.txt
41 )
42
43 PATCHES=(
44         "${FILESDIR}/${PN}-3.0.1-pkgconfig-libdir.patch"
45         "${FILESDIR}/${P}-findicu-pkgconfig.patch"
46 )
47
48 pkg_setup() {
49         use test && python-any-r1_pkg_setup
50 }
51
52 src_prepare() {
53         cmake-utils_src_prepare
54         use examples || cmake_comment_add_subdirectory examples
55 }
56
57 src_configure() {
58         local mycmakeargs=(
59                 -DICAL_GLIB=OFF
60                 -DGOBJECT_INTROSPECTION=OFF
61                 $(cmake-utils_use_find_package berkdb BDB)
62                 -DICAL_BUILD_DOCS=$(usex doc)
63                 -DSHARED_ONLY=$(usex !static-libs)
64         )
65 #       TODO: disabled until useful
66 #               -DICAL_GLIB=$(usex glib)
67 #               -DGOBJECT_INTROSPECTION=$(usex introspection)
68         cmake-utils_src_configure
69 }
70
71 src_compile() {
72         cmake-utils_src_compile
73         use doc && cmake-utils_src_compile docs
74 }
75
76 src_test() {
77         local myctestargs=( -j1 )
78         cmake-utils_src_test
79 }
80
81 src_install() {
82         use doc && HTML_DOCS=( "${BUILD_DIR}"/apidocs/html/. )
83
84         cmake-utils_src_install
85
86         if use examples; then
87                 rm examples/CMakeLists.txt || die
88                 dodoc -r examples
89         fi
90 }