dev-libs/libxml2: arm64 stable (bug #701020)
[gentoo.git] / dev-libs / libgit2 / libgit2-9999.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
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 ~ppc64 ~x86 ~ppc-macos"
15 fi
16
17 DESCRIPTION="A linkable library for Git"
18 HOMEPAGE="https://libgit2.org"
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 src_configure() {
39         local mycmakeargs=(
40                 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
41                 -DBUILD_CLAR=$(usex test)
42                 -DENABLE_TRACE=$(usex trace)
43                 -DUSE_GSSAPI=$(usex gssapi)
44                 -DUSE_SSH=$(usex ssh)
45                 -DTHREADSAFE=$(usex threads)
46         )
47         cmake-utils_src_configure
48 }
49
50 src_test() {
51         if [[ ${EUID} -eq 0 ]] ; then
52                 # repo::iterator::fs_preserves_error fails if run as root
53                 # since root can still access dirs with 0000 perms
54                 ewarn "Skipping tests: non-root privileges are required for all tests to pass"
55         else
56                 local TEST_VERBOSE=1
57                 cmake-utils_src_test -R offline
58         fi
59 }
60
61 src_install() {
62         cmake-utils_src_install
63         dodoc docs/*.{md,txt}
64
65         if use examples ; then
66                 find examples -name '.gitignore' -delete || die
67                 dodoc -r examples
68                 docompress -x /usr/share/doc/${PF}/examples
69         fi
70 }