dev-libs/libgit2: Sec-bump to 0.26.7
[gentoo.git] / dev-libs / libgit2 / libgit2-9999.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=( python{2_7,3_{4,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/27"
22 IUSE="+curl examples gssapi libressl +ssh test +threads trace"
23
24 RDEPEND="
25         !libressl? ( dev-libs/openssl:0= )
26         libressl? ( dev-libs/libressl:0= )
27         sys-libs/zlib
28         net-libs/http-parser:=
29         curl? (
30                 !libressl? ( net-misc/curl:=[curl_ssl_openssl(-)] )
31                 libressl? ( net-misc/curl:=[curl_ssl_libressl(-)] )
32         )
33         gssapi? ( virtual/krb5 )
34         ssh? ( net-libs/libssh2 )
35 "
36 DEPEND="${RDEPEND}
37         ${PYTHON_DEPS}
38         virtual/pkgconfig
39 "
40
41 DOCS=( AUTHORS CONTRIBUTING.md CONVENTIONS.md README.md )
42
43 src_prepare() {
44         # skip online tests
45         sed -i '/libgit2_clar/s/-ionline/-xonline/' tests/CMakeLists.txt || die
46
47         cmake-utils_src_prepare
48 }
49
50 src_configure() {
51         local mycmakeargs=(
52                 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
53                 -DBUILD_CLAR=$(usex test)
54                 -DENABLE_TRACE=$(usex trace)
55                 -DUSE_GSSAPI=$(usex gssapi)
56                 -DUSE_SSH=$(usex ssh)
57                 -DTHREADSAFE=$(usex threads)
58                 -DCURL=$(usex curl)
59         )
60         cmake-utils_src_configure
61 }
62
63 src_test() {
64         if [[ ${EUID} -eq 0 ]] ; then
65                 # repo::iterator::fs_preserves_error fails if run as root
66                 # since root can still access dirs with 0000 perms
67                 ewarn "Skipping tests: non-root privileges are required for all tests to pass"
68         else
69                 local TEST_VERBOSE=1
70                 cmake-utils_src_test
71         fi
72 }
73
74 src_install() {
75         cmake-utils_src_install
76
77         if use examples ; then
78                 find examples -name '.gitignore' -delete || die
79                 dodoc -r examples
80                 docompress -x /usr/share/doc/${PF}/examples
81         fi
82 }