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
This commit is contained in:
parent
c7bd735bc4
commit
aa1090713a
1 changed files with 38 additions and 11 deletions
|
@ -1955,17 +1955,44 @@ memory-efficient.")
|
||||||
"0834hah7p6ad81w60ifnxyh9zn09ddfgrll04kwjxwp7ypbv38wq"))))
|
"0834hah7p6ad81w60ifnxyh9zn09ddfgrll04kwjxwp7ypbv38wq"))))
|
||||||
(build-system go-build-system)
|
(build-system go-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:import-path "github.com/oniony/TMSU"
|
(list
|
||||||
#:unpack-path ".."
|
#:go go-1.21
|
||||||
#:install-source? #f
|
#:import-path "github.com/oniony/TMSU"
|
||||||
#:phases
|
#:unpack-path "github.com/oniony/TMSU"
|
||||||
(modify-phases %standard-phases
|
#:install-source? #f
|
||||||
(add-after 'install 'post-install
|
#:phases
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
#~(modify-phases %standard-phases
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(add-after 'unpack 'adjust-makefile
|
||||||
;; The go build system produces /bin/TMSU -> install as /bin/tmsu
|
(lambda* (#:key import-path #:allow-other-keys)
|
||||||
(rename-file (string-append out "/bin/TMSU")
|
(with-directory-excursion (string-append "src/" import-path)
|
||||||
(string-append out "/bin/tmsu"))))))))
|
(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
|
(inputs
|
||||||
(list go-github-com-mattn-go-sqlite3 go-github-com-hanwen-fuse))
|
(list go-github-com-mattn-go-sqlite3 go-github-com-hanwen-fuse))
|
||||||
(home-page "https://github.com/oniony/TMSU")
|
(home-page "https://github.com/oniony/TMSU")
|
||||||
|
|
Reference in a new issue