dev-libs/libgit2: Bump to 0.28.3
[gentoo.git] / dev-libs / libgit2 / libgit2-0.28.3.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
7 inherit cmake-utils python-any-r1
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 ~arm64 ~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/28"
22 IUSE="examples gssapi libressl +ssh test +threads trace"
23 RESTRICT="!test? ( test )"
24
25 RDEPEND="
26         !libressl? ( dev-libs/openssl:0= )
27         libressl? ( dev-libs/libressl:0= )
28         sys-libs/zlib
29         net-libs/http-parser:=
30         gssapi? ( virtual/krb5 )
31         ssh? ( net-libs/libssh2 )
32 "
33 DEPEND="${RDEPEND}
34         ${PYTHON_DEPS}
35         virtual/pkgconfig
36 "
37
38 S=${WORKDIR}/${P/_/-}
39
40 src_configure() {
41         local mycmakeargs=(
42                 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
43                 -DBUILD_CLAR=$(usex test)
44                 -DENABLE_TRACE=$(usex trace)
45                 -DUSE_GSSAPI=$(usex gssapi)
46                 -DUSE_SSH=$(usex ssh)
47                 -DTHREADSAFE=$(usex threads)
48         )
49         cmake-utils_src_configure
50 }
51
52 src_test() {
53         if [[ ${EUID} -eq 0 ]] ; then
54                 # repo::iterator::fs_preserves_error fails if run as root
55                 # since root can still access dirs with 0000 perms
56                 ewarn "Skipping tests: non-root privileges are required for all tests to pass"
57         else
58                 local TEST_VERBOSE=1
59                 cmake-utils_src_test -R offline
60         fi
61 }
62
63 src_install() {
64         cmake-utils_src_install
65         dodoc docs/*.{md,txt}
66
67         if use examples ; then
68                 find examples -name '.gitignore' -delete || die
69                 dodoc -r examples
70                 docompress -x /usr/share/doc/${PF}/examples
71         fi
72 }