Archived
1
0
Fork 0

gnu: syncthing: Use new package style.

* gnu/packages/syncthing.scm (syncthing)[arguments]: Use gexps. Drop trailing

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Timotej Lazar 2023-08-05 10:20:21 +02:00 committed by Ludovic Courtès
parent bf8e77643c
commit a08592b055
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -61,20 +61,19 @@
;; of "out" by ~144 MiB. ;; of "out" by ~144 MiB.
(outputs '("out" "utils")) (outputs '("out" "utils"))
(arguments (arguments
`(#:modules ((srfi srfi-26) ; for cut (list #:modules '((srfi srfi-26) ; for cut
(guix build utils) (guix build utils)
(guix build go-build-system)) (guix build go-build-system))
#:go ,go-1.19 #:go go-1.19
#:import-path "github.com/syncthing/syncthing" #:import-path "github.com/syncthing/syncthing"
;; We don't need to install the source code for end-user applications. ;; We don't need to install the source code for end-user applications.
#:install-source? #f #:install-source? #f
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'build 'increase-test-timeout (add-before 'build 'increase-test-timeout
(lambda _ (lambda _
(substitute* "src/github.com/syncthing/syncthing/build.go" (substitute* "src/github.com/syncthing/syncthing/build.go"
(("120s") "999s")) (("120s") "999s"))))
#t))
(replace 'build (replace 'build
(lambda _ (lambda _
@ -91,46 +90,36 @@
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(when tests? (when tests?
(with-directory-excursion "src/github.com/syncthing/syncthing" (with-directory-excursion "src/github.com/syncthing/syncthing"
(invoke "go" "run" "build.go" "test"))) (invoke "go" "run" "build.go" "test")))))
#t))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((out (assoc-ref outputs "out"))
(utils (assoc-ref outputs "utils")))
(with-directory-excursion "src/github.com/syncthing/syncthing/bin" (with-directory-excursion "src/github.com/syncthing/syncthing/bin"
(install-file "../syncthing" (string-append out "/bin")) (install-file "../syncthing" (string-append #$output "/bin"))
(for-each (cut install-file <> (string-append utils "/bin/")) (for-each (cut install-file <> (string-append #$output:utils "/bin/"))
'("stcompdirs" "stcrashreceiver" '("stcompdirs" "stcrashreceiver"
"stdisco" "stdiscosrv" "stevents" "stfileinfo" "stdisco" "stdiscosrv" "stevents" "stfileinfo"
"stfinddevice" "stfindignored" "stgenfiles" "stfinddevice" "stfindignored" "stgenfiles"
"strelaypoolsrv" "strelaysrv" "stsigtool" "strelaypoolsrv" "strelaysrv" "stsigtool"
"stvanity" "stwatchfile" "uraggregate" "ursrv")) "stvanity" "stwatchfile" "uraggregate" "ursrv")))))
#t))))
(add-after 'install 'install-docs (add-after 'install 'install-docs
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (let ((man (string-append #$output "/share/man"))
(utils (assoc-ref outputs "utils")) (man:utils (string-append #$output:utils "/share/man")))
(man "/share/man")
(man-section (string-append man "/man"))
(src "src/github.com/syncthing/syncthing/man/"))
;; Install all the man pages to "out". ;; Install all the man pages to "out".
(for-each (for-each
(lambda (file) (lambda (file)
(install-file file (install-file file
(string-append out man-section (string-append man "/man" (string-take-right file 1))))
(string-take-right file 1)))) (find-files "src/github.com/syncthing/syncthing/man" "\\.[1-9]"))
(find-files src "\\.[1-9]"))
;; Copy all the man pages to "utils" ;; Copy all the man pages to "utils"
(copy-recursively (string-append out man) (copy-recursively man man:utils)
(string-append utils man))
;; Delete extraneous man pages from "out" and "utils", ;; Delete extraneous man pages from "out" and "utils",
;; respectively. ;; respectively.
(delete-file (string-append out man "/man1/stdiscosrv.1")) (delete-file (string-append man "/man1/stdiscosrv.1"))
(delete-file (string-append out man "/man1/strelaysrv.1")) (delete-file (string-append man "/man1/strelaysrv.1"))
(delete-file (string-append utils man "/man1/syncthing.1")) (delete-file (string-append man:utils "/man1/syncthing.1"))))))))
#t))))))
(synopsis "Decentralized continuous file system synchronization") (synopsis "Decentralized continuous file system synchronization")
(description "Syncthing is a peer-to-peer file synchronization tool that (description "Syncthing is a peer-to-peer file synchronization tool that
supports a wide variety of computing platforms. It uses the Block Exchange supports a wide variety of computing platforms. It uses the Block Exchange