dev-libs/libgit2: Remove old
[gentoo.git] / dev-libs / libgit2 / libgit2-0.24.6.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit cmake-utils multilib
8
9 if [[ ${PV} == "9999" ]] ; then
10         EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
11         inherit git-r3
12 else
13         SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
14         KEYWORDS="amd64 ~arm ~ppc x86 ~ppc-macos"
15 fi
16
17 DESCRIPTION="A linkable library for Git"
18 HOMEPAGE="https://libgit2.github.com/"
19
20 LICENSE="GPL-2-with-linking-exception"
21 SLOT="0/24"
22 IUSE="examples gssapi libressl ssh test threads trace"
23
24 RDEPEND="
25         !libressl? ( dev-libs/openssl:0 )
26         libressl? ( dev-libs/libressl )
27         sys-libs/zlib
28         net-libs/http-parser:=
29         gssapi? ( virtual/krb5 )
30         ssh? ( net-libs/libssh2 )
31 "
32 DEPEND="${RDEPEND}
33         virtual/pkgconfig
34 "
35
36 DOCS=( AUTHORS CONTRIBUTING.md CONVENTIONS.md README.md )
37
38 src_prepare() {
39         # skip online tests
40         sed -i '/libgit2_clar/s/-ionline/-xonline/' CMakeLists.txt || die
41
42         cmake-utils_src_prepare
43 }
44
45 src_configure() {
46         local mycmakeargs=(
47                 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
48                 $(cmake-utils_use_build test CLAR)
49                 $(cmake-utils_use_enable trace TRACE)
50                 $(cmake-utils_use_use gssapi GSSAPI)
51                 $(cmake-utils_use_use ssh SSH)
52                 $(cmake-utils_use threads THREADSAFE)
53         )
54         cmake-utils_src_configure
55 }
56
57 src_test() {
58         if [[ ${EUID} -eq 0 ]] ; then
59                 # repo::iterator::fs_preserves_error fails if run as root
60                 # since root can still access dirs with 0000 perms
61                 ewarn "Skipping tests: non-root privileges are required for all tests to pass"
62         else
63                 local TEST_VERBOSE=1
64                 cmake-utils_src_test
65         fi
66 }
67
68 src_install() {
69         cmake-utils_src_install
70
71         if use examples ; then
72                 egit_clean examples
73                 dodoc -r examples
74                 docompress -x /usr/share/doc/${PF}/examples
75         fi
76 }