From e6f0746d6d88106066fb646f3d195f8306924f5c Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 2 Nov 2025 21:18:02 +0000 Subject: [PATCH] gnu: goawk: Build with go-1.24. * gnu/packages/textutils.scm (goawk)[arguments] : Use default (go-1.24). : Disable vet during tests and move test skip logic here. : Remove 'disable-failing-tests, and 'patch-pats; add 'pre-check, and 'post-check-remove-output-temp; use default 'check. Change-Id: Id3b3c4c62fd660f693b7b7f44dd3129813894d58 --- gnu/packages/textutils.scm | 45 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index cf4beff3bd5725c14f0460f16000979d6e3496cb..d6ee9daa32d94c656f6d4c6fe0a8fe8771234407 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -1503,46 +1503,41 @@ formats (e.g. Bibtex, RIS, etc.) using a common XML intermediate.") (origin (method git-fetch) (uri (git-reference - (url "https://github.com/benhoyt/goawk") - (commit (string-append "v" version)))) + (url "https://github.com/benhoyt/goawk") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0riimisq3y6pahl1yld5yjxywh39i0v0kd4vmybf5j09klqynbn3")))) (build-system go-build-system) (arguments (list - #:go go-1.23 #:install-source? #f #:import-path "github.com/benhoyt/goawk" + #:test-flags + #~(list "-vet=off" ;Go@1.24 forces vet, but tests are not ready yet. + ;; XXX: The most of the tests passed but some of the group fails + ;; to find additional commands or compare output of test data. + "-skip" "TestCommandLine|TestInterp") #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'disable-failing-tests - (lambda* (#:key tests? import-path #:allow-other-keys) - (with-directory-excursion (string-append "src/" import-path) - ;; Disable tests trying to setup up locale and requiring gawk - ;; executable. - (substitute* (find-files "." "\\_test.go$") - (("TestShellCommand") "OffTestShellCommand") - (("TestInterp") "OffTestInterp") - (("TestCommandLine") "OffTestCommandLine"))))) - (add-before 'check 'patch-paths - (lambda* (#:key tests? import-path #:allow-other-keys) + (add-before 'check 'pre-check + (lambda* (#:key import-path #:allow-other-keys) (with-directory-excursion (string-append "src/" import-path) - (substitute* (list "interp/interp.go" "goawk_test.go") + (substitute* (list "interp/interp.go" + "interp/interp_test.go" + "goawk_test.go") + (("/bin/cat") (which "cat")) + (("/bin/echo") (which "echo")) (("/bin/sh") (which "sh"))) (substitute* "goawk_test.go" ;; During tests goawk tries to write to existing files, ;; point to an empty directory instead. - (("/testdata/output") "/testdata/output-tmp"))))) - (replace 'check - (lambda* (#:key tests? import-path #:allow-other-keys) - (when tests? - (with-directory-excursion (string-append "src/" import-path) - (mkdir "testdata/output-tmp") - (invoke "go" "test" "./...") - ;; Make sure we have not left any generated articfacts - ;; during tests and moved them to the store. - (delete-file-recursively "testdata/output-tmp")))))))) + (("/testdata/output") "/testdata/output-tmp")) + (mkdir "testdata/output-tmp")))) + (add-after 'check 'post-check-remove-output-temp + (lambda* (#:key import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + (delete-file-recursively "testdata/output-tmp"))))))) (home-page "https://github.com/benhoyt/goawk") (synopsis "AWK interpreter with CSV support") (description