gnu: libgit2: Fix tests on 32bit systems.

This prevents a discrepancy between git_fs_path_lstat using different size
stat structs.

See https://github.com/libgit2/libgit2/issues/7169

* gnu/packages/version-control.scm (libgit2-1.9): Compile with
-D_FILE_OFFSET_BITS=64 on 32bit system.

Change-Id: Iab7df2c930b0fc0cb9030b754ad7b668d49a7034
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #4860
This commit is contained in:
Yelninei 2025-12-15 11:55:30 +00:00 committed by Ludovic Courtès
parent 90defc6a0f
commit f0ab81c097
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1273,17 +1273,13 @@ other git-like projects such as @code{libgit2}.")
%build-inputs
(string-append "/bin/" ,(%current-target-system)
"-pkg-config"))))
'())))
'())
;; See https://github.com/libgit2/libgit2/issues/7169
,@(if (target-64bit?)
'()
'("-DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64"))))
#:phases
(modify-phases %standard-phases
,@(if (or (target-arm32?) (target-hurd?))
;; Some tests are flaky on armhf.
;; On GNU/Hurd, the 'diff/workdir' test in libgit2 1.7.1 fails
;; while comparing st.st_size to zero.
'((add-before 'check 'pre-check
(lambda _
(setenv "GITTEST_FLAKY_STAT" "true"))))
'())
;; Run checks more verbosely, unless we are cross-compiling.
(replace 'check
(lambda* (#:key (tests? #t) #:allow-other-keys)