[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
19/26: gnu: tmsu: Enable test suite.
From: |
guix-commits |
Subject: |
19/26: gnu: tmsu: Enable test suite. |
Date: |
Tue, 7 May 2024 18:24:52 -0400 (EDT) |
sharlatan pushed a commit to branch master
in repository guix.
commit aa1090713aad76a652aa0159662880b1301e13ae
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Sun May 5 22:10:28 2024 +0100
gnu: tmsu: Enable test suite.
* gnu/packages/file-systems.scm (tmsu): Fail over to the project's
Makefile targets.
[arguments]: <#:go>: Use go-1.21.
<#:phases>: Add 'adjust-makefile' phase. Use custom 'build, 'check and
'install phases.
Change-Id: Ice920f2196123f1a1f1561879ab919bc0d4e8512
---
gnu/packages/file-systems.scm | 49 +++++++++++++++++++++++++++++++++----------
1 file changed, 38 insertions(+), 11 deletions(-)
diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index 8afd853350..1396386b63 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -1955,17 +1955,44 @@ memory-efficient.")
"0834hah7p6ad81w60ifnxyh9zn09ddfgrll04kwjxwp7ypbv38wq"))))
(build-system go-build-system)
(arguments
- `(#:import-path "github.com/oniony/TMSU"
- #:unpack-path ".."
- #:install-source? #f
- #:phases
- (modify-phases %standard-phases
- (add-after 'install 'post-install
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- ;; The go build system produces /bin/TMSU -> install as
/bin/tmsu
- (rename-file (string-append out "/bin/TMSU")
- (string-append out "/bin/tmsu"))))))))
+ (list
+ #:go go-1.21
+ #:import-path "github.com/oniony/TMSU"
+ #:unpack-path "github.com/oniony/TMSU"
+ #:install-source? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'adjust-makefile
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ (substitute* "Makefile"
+ (("SHELL=.*") (string-append "SHELL=" (which "sh") "\n"))
+ ;; Make sure we do not compile 2 more times during the check
+ ;; phase.
+ (("unit-test: compile") "unit-test:")
+ (("integration-test: compile") "integration-test:")
+ ;; Simplify install path.
+ (("usr/") "")))))
+ (replace 'build
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ (invoke "make" "compile"))))
+ (replace 'check
+ (lambda* (#:key import-path tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion (string-append "src/" import-path)
+ ;; Remove shaky test file, see
+ ;; <https://github.com/oniony/TMSU/issues/281>.
+ (for-each
+ (lambda (test-file)
+ (delete-file test-file))
+ (find-files "." "^fingerprinter_test.go$"))
+ (invoke "make" "test")))))
+ (replace 'install
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ (setenv "DESTDIR" #$output)
+ (invoke "make" "install")))))))
(inputs
(list go-github-com-mattn-go-sqlite3 go-github-com-hanwen-fuse))
(home-page "https://github.com/oniony/TMSU")
- branch master updated (014875b29e -> 2795d0f3e7), guix-commits, 2024/05/07
- 03/26: gnu: Add go-github-com-msteinert-pam., guix-commits, 2024/05/07
- 11/26: gnu: Add go-gopkg-in-irc-v4., guix-commits, 2024/05/07
- 17/26: gnu: Add go-github-com-msteinert-pam-v2., guix-commits, 2024/05/07
- 14/26: gnu: go-github-com-prometheus-client-golang: Update to 1.17.0., guix-commits, 2024/05/07
- 19/26: gnu: tmsu: Enable test suite.,
guix-commits <=
- 23/26: gnu: go-git-sr-ht-emersion-gqlclient: Move to golang-web., guix-commits, 2024/05/07
- 01/26: gnu: Add go-github-com-golang-jwt-jwt., guix-commits, 2024/05/07
- 08/26: gnu: Add go-git-sr-ht-emersion-go-sqlite3-fts5., guix-commits, 2024/05/07
- 06/26: gnu: go-github-com-mattn-go-sqlite3: Update to 1.14.22., guix-commits, 2024/05/07
- 13/26: gnu: go-github-com-prometheus-common: Update to 0.45.0., guix-commits, 2024/05/07
- 10/26: gnu: go-gopkg-in-irc-v3: Enable tests., guix-commits, 2024/05/07
- 16/26: gnu: Add soju., guix-commits, 2024/05/07
- 18/26: gnu: sqls: Use go-1.21., guix-commits, 2024/05/07
- 20/26: gnu: go-github-com-nbrownus-go-metrics-prometheus: Disable tests., guix-commits, 2024/05/07
- 24/26: gnu: go-git-sr-ht-emersion-go-scfg: Move to golang-xyz., guix-commits, 2024/05/07