1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 if [[ ${PV} == "9999" ]] ; then
9 EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
12 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
13 KEYWORDS="amd64 ~arm ~arm64 ~ppc x86 ~ppc-macos"
16 DESCRIPTION="A linkable library for Git"
17 HOMEPAGE="https://libgit2.github.com/"
19 LICENSE="GPL-2-with-linking-exception"
21 IUSE="+curl examples gssapi libressl +ssh test +threads trace"
24 !libressl? ( dev-libs/openssl:0= )
25 libressl? ( dev-libs/libressl:0= )
27 net-libs/http-parser:=
29 !libressl? ( net-misc/curl:=[curl_ssl_openssl(-)] )
30 libressl? ( net-misc/curl:=[curl_ssl_libressl(-)] )
32 gssapi? ( virtual/krb5 )
33 ssh? ( net-libs/libssh2 )
39 DOCS=( AUTHORS CONTRIBUTING.md CONVENTIONS.md README.md )
43 sed -i '/libgit2_clar/s/-ionline/-xonline/' CMakeLists.txt || die
45 cmake-utils_src_prepare
50 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
51 -DBUILD_CLAR=$(usex test)
52 -DENABLE_TRACE=$(usex trace)
53 -DUSE_GSSAPI=$(usex gssapi)
55 -DTHREADSAFE=$(usex threads)
58 cmake-utils_src_configure
62 if [[ ${EUID} -eq 0 ]] ; then
63 # repo::iterator::fs_preserves_error fails if run as root
64 # since root can still access dirs with 0000 perms
65 ewarn "Skipping tests: non-root privileges are required for all tests to pass"
73 cmake-utils_src_install
75 if use examples ; then
76 find examples -name '.gitignore' -delete || die
78 docompress -x /usr/share/doc/${PF}/examples