Re: libgit2

Jeremy Drake via Cygwin-apps <[email protected]>
Newsgroups gmane.os.cygwin.applications
Message-ID <[email protected]>
On Sat, 24 May 2025, ASSI via Cygwin-apps wrote:

> Jeremy Drake via Cygwin-apps writes:
> > I made a little attempt to update libgit2 based on what MSYS2 did, since
> > it is apparently needed for cargo (and it seems like it's getting close to
> > possible to build cargo for Cygwin).  Unfortunately, it failed to build in
> > scallywag:
> > https://github.com/cygwin/scallywag/actions/runs/15219165082/job/42811502993
>
> It needs to be compiled with --std=gnu90, not c90 or it triggers a bug
> in 3.6.1 headers with the setproctitle declaration.
>
> > Also, there are some test failures for me locally.
>
> CMake generates a wrong untility.sh, replace $(ARGS) with ${ARGS} there.
> Tests need to be run with admin privileges dropped.
>

Thanks for the hints, that got it running on scallywag as it does locally.
Attaching updated cygport, scallywag run at
https://github.com/cygwin/scallywag/actions/runs/15229587565/job/42835871879

83% tests passed, 2 tests failed out of 12
Total Test time (real) = 1182.89 sec
The following tests FAILED:
	  1 - offline (Failed)
	 12 - util (Failed)
Errors while running CTest

Do I need to probably somehow skip the remaining failing tests (they seem
generally to be related to Cygwin unicode quirks), or just put
SCALLYWAG="notest" in the cygport?
libgit2.cygport (text/plain, 1.4 KB)
inherit cmake

NAME="libgit2"
VERSION=1.9.0
RELEASE=1
CATEGORY="Libs"
SUMMARY="Git C library"
DESCRIPTION="libgit2 is a portable, pure C implementation of the Git core
methods provided as a re-entrant linkable library with a solid API, allowing
you to write native speed custom Git applications in any language which
supports C bindings."
HOMEPAGE="https://libgit2.org/"
LICENSE="LicenseRef-Callaway-GPLv2-with-exceptions"
SRC_URI="https://github.com/libgit2/libgit2/archive/v${VERSION}/libgit2-${VERSION}.tar.gz"
SRC_DIR="libgit2-${VERSION}"
PATCH_URI="https://raw.githubusercontent.com/msys2/MSYS2-packages/135c44822061034265d1b9d209a5f80ef1e32477/libgit2/0001-missing-alloca.patch"
BUILD_REQUIRES="cygutils-extra libpcre2-devel libssh2-devel libssl-devel zlib-devel"

# CMAKE_C_EXTENSIONS is needed to work around a bug in Cygwin 3.6.1, it can
# be removed after 3.6.2 is released.
CYGCMAKE_ARGS="-DCMAKE_C_EXTENSIONS=ON -DUSE_SSH=ON -DUSE_ICONV=ON -DREGEX_BACKEND=pcre2"

src_test() {
	cd ${B}
	find . -path '*/test.dir/utility.sh' -exec sed -i -e 's/\$(ARGS)/${ARGS}/' '{}' +
	cygdrop ctest -V
}

PKG_NAMES="git2 libgit2_1_9 libgit2-devel"
git2_CONTENTS="usr/bin/git2.exe"
libgit2_1_9_CONTENTS="usr/bin/cyggit2-1.9.dll usr/share/doc/"
libgit2_devel_CONTENTS="usr/include/git2* usr/lib/cmake/libgit2/ usr/lib/libgit2.dll.a usr/lib/pkgconfig/libgit2.pc"

DIFF_EXCLUDES=".clarcache clar.suite"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.