1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
7 inherit cmake-utils python-any-r1
9 if [[ ${PV} == "9999" ]] ; then
10 EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
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"
17 DESCRIPTION="A linkable library for Git"
18 HOMEPAGE="https://libgit2.github.com/"
20 LICENSE="GPL-2-with-linking-exception"
22 IUSE="examples gssapi libressl +ssh test +threads trace"
23 RESTRICT="!test? ( test )"
26 !libressl? ( dev-libs/openssl:0= )
27 libressl? ( dev-libs/libressl:0= )
29 net-libs/http-parser:=
30 gssapi? ( virtual/krb5 )
31 ssh? ( net-libs/libssh2 )
42 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
43 -DBUILD_CLAR=$(usex test)
44 -DENABLE_TRACE=$(usex trace)
45 -DUSE_GSSAPI=$(usex gssapi)
47 -DTHREADSAFE=$(usex threads)
49 cmake-utils_src_configure
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"
59 cmake-utils_src_test -R offline
64 cmake-utils_src_install
67 if use examples ; then
68 find examples -name '.gitignore' -delete || die
70 docompress -x /usr/share/doc/${PF}/examples