gnu: libchop: Fix build and test.

* gnu/packages/backup.scm (libchop)[source]: Adjust snippet to work
around build error in Gnulib's <stdio.h>.
[arguments]: Remove 'skip-test' phase and add 'adjust-test' phase.
This commit is contained in:
Ludovic Courtès 2023-02-08 18:42:18 +01:00
parent 035339b703
commit a8974597cc
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -564,6 +564,13 @@ (define-public libchop
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
;; Gnulib's <stdio.h> refers to 'gets' for the purposes of
;; warning against its use, but 'gets' is no longer declared
;; in glibc's <stdio.h>. Remove that warning.
(substitute* "lib/stdio.in.h"
(("_GL_WARN_ON_USE \\(gets,.*")
"\n/* 'gets' is gone, rejoice! */\n"))
;; Include all the libtirpc headers necessary to get the ;; Include all the libtirpc headers necessary to get the
;; definitions of 'u_int', etc. ;; definitions of 'u_int', etc.
(substitute* '("src/block-server.c" (substitute* '("src/block-server.c"
@ -572,8 +579,7 @@ (define-public libchop
(("#include <rpc/(.*)\\.h>" _ header) (("#include <rpc/(.*)\\.h>" _ header)
(string-append "#include <rpc/types.h>\n" (string-append "#include <rpc/types.h>\n"
"#include <rpc/rpc.h>\n" "#include <rpc/rpc.h>\n"
"#include <rpc/" header ".h>\n"))) "#include <rpc/" header ".h>\n")))))))
#t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(;; Link against libtirpc. '(;; Link against libtirpc.
@ -598,12 +604,16 @@ (define-public libchop
(string-append (getenv "CPATH") (string-append (getenv "CPATH")
":" tirpc)) ":" tirpc))
(setenv "CPATH" tirpc))))) (setenv "CPATH" tirpc)))))
(add-before 'check 'skip-test (add-before 'check 'adjust-test
(lambda _ (lambda _
;; XXX: This test fails (1) because current GnuTLS no ;; This test uses a weird construct to spawn
;; longer supports OpenPGP authentication, and (2) for ;; 'chop-block-server' in the background. Replace it
;; some obscure reason. Better skip it. ;; with something that actually works.
(setenv "XFAIL_TESTS" "utils/block-server")))))) (substitute* "tests/utils/block-server"
(("chop_fail_if ! chop-block-server")
"chop-block-server")
(("'&'")
"&")))))))
(native-inputs (native-inputs
(list guile-2.0 gperf-3.0 ;see <https://bugs.gnu.org/32382> (list guile-2.0 gperf-3.0 ;see <https://bugs.gnu.org/32382>
pkg-config rpcsvc-proto)) ;for 'rpcgen' pkg-config rpcsvc-proto)) ;for 'rpcgen'