diff --git a/dev-libs/libgit2/Manifest b/dev-libs/libgit2/Manifest index f429554b3ce1..726acc78fe1f 100644 --- a/dev-libs/libgit2/Manifest +++ b/dev-libs/libgit2/Manifest @@ -1 +1,2 @@ DIST libgit2-1.9.1.tar.gz 7665631 BLAKE2B fac1ecb9ef1589049fe99d54984fb18692ecb4805fc02a1f49193a7d71de75f72b2143214f9239097867b196f90ca45a033b5e65d07ddf1a5b8f00068b1b784a SHA512 3bec01704ad1acdb4f7e9454101c2a205b7e288a4dffaa5e1afc2b1f849fa3a42b961c532bed2669841925ab8f84fb35bb82a2df8039b1caf76c5779665032d9 +DIST libgit2-1.9.2.tar.gz 7667818 BLAKE2B 6e5be4aee7ebe959a23ec24952eaff3ad66bbc740e0fd3ef66bc61b57c3228b71ad9b01808494782a90d362692d2cfabbfc24946543bbc109ec66df9c03cf26d SHA512 b9ac2d0a7cc92a31057fbf066e47145cdda89ebf0489d712d4452c709c3de9923a93a3c37128fdcfd8fbb5498f513a519a7f2a77ad6ef4efafe865323d481f18 diff --git a/dev-libs/libgit2/libgit2-1.9.2.ebuild b/dev-libs/libgit2/libgit2-1.9.2.ebuild new file mode 100644 index 000000000000..b86ed590044b --- /dev/null +++ b/dev-libs/libgit2/libgit2-1.9.2.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11..14} ) + +inherit cmake flag-o-matic python-any-r1 + +DESCRIPTION="A linkable library for Git" +HOMEPAGE="https://libgit2.org/" +SRC_URI=" + https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz +" +S=${WORKDIR}/${P/_/-} + +LICENSE="GPL-2-with-linking-exception" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="examples gssapi +ssh test +threads trace" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-libs/libpcre2:= + net-libs/llhttp:= + virtual/zlib:= + dev-libs/openssl:0= + gssapi? ( virtual/krb5 ) + ssh? ( net-libs/libssh2 ) +" +DEPEND=" + ${RDEPEND} +" +BDEPEND=" + ${PYTHON_DEPS} + virtual/pkgconfig +" + +src_prepare() { + cmake_src_prepare + + # https://bugs.gentoo.org/948941 + sed -i -e 's:-Werror::' tests/headertest/CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DBUILD_TESTS=$(usex test) + -DUSE_SSH=$(usex ssh libssh2 OFF) + -DUSE_GSSAPI=$(usex gssapi ON OFF) + -DUSE_HTTP_PARSER=llhttp + -DREGEX_BACKEND=pcre2 + ) + # https://bugs.gentoo.org/925207 + append-lfs-flags + cmake_src_configure +} + +src_test() { + if [[ ${EUID} -eq 0 ]] ; then + # repo::iterator::fs_preserves_error fails if run as root + # since root can still access dirs with 0000 perms + ewarn "Skipping tests: non-root privileges are required for all tests to pass" + else + local TEST_VERBOSE=1 + cmake_src_test -R offline + fi +} + +src_install() { + cmake_src_install + dodoc docs/*.{md,txt} + + if use examples ; then + find examples -name '.gitignore' -delete || die + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi +}