summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.si>2023-08-05 10:20:21 +0200
committerLudovic Courtès <ludo@gnu.org>2023-08-21 23:11:22 +0200
commita08592b055e9b6d9baf704e2405ba9ae38215e62 (patch)
treef0a7c1addf4a198e7baa008876a03e03faa7df91 /gnu
parentbf8e77643c67c62ecaf25701b0f321483968a017 (diff)
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>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/syncthing.scm109
1 files changed, 49 insertions, 60 deletions
diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index 6ae80164911..414395251be 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -61,76 +61,65 @@
61 ;; of "out" by ~144 MiB. 61 ;; of "out" by ~144 MiB.
62 (outputs '("out" "utils")) 62 (outputs '("out" "utils"))
63 (arguments 63 (arguments
64 `(#:modules ((srfi srfi-26) ; for cut 64 (list #:modules '((srfi srfi-26) ; for cut
65 (guix build utils) 65 (guix build utils)
66 (guix build go-build-system)) 66 (guix build go-build-system))
67 #:go ,go-1.19 67 #:go go-1.19
68 #:import-path "github.com/syncthing/syncthing" 68 #:import-path "github.com/syncthing/syncthing"
69 ;; We don't need to install the source code for end-user applications. 69 ;; We don't need to install the source code for end-user applications.
70 #:install-source? #f 70 #:install-source? #f
71 #:phases 71 #:phases
72 (modify-phases %standard-phases 72 #~(modify-phases %standard-phases
73 (add-before 'build 'increase-test-timeout 73 (add-before 'build 'increase-test-timeout
74 (lambda _ 74 (lambda _
75 (substitute* "src/github.com/syncthing/syncthing/build.go" 75 (substitute* "src/github.com/syncthing/syncthing/build.go"
76 (("120s") "999s")) 76 (("120s") "999s"))))
77 #t))
78 77
79 (replace 'build 78 (replace 'build
80 (lambda _ 79 (lambda _
81 (with-directory-excursion "src/github.com/syncthing/syncthing" 80 (with-directory-excursion "src/github.com/syncthing/syncthing"
82 ;; XXX The only way to build Syncthing without its automatic 81 ;; XXX The only way to build Syncthing without its automatic
83 ;; updater and to build the utilities is to "build all" and then 82 ;; updater and to build the utilities is to "build all" and then
84 ;; "build syncthing" again with -no-upgrade. 83 ;; "build syncthing" again with -no-upgrade.
85 ;; https://github.com/syncthing/syncthing/issues/6118 84 ;; https://github.com/syncthing/syncthing/issues/6118
86 (invoke "go" "run" "build.go") 85 (invoke "go" "run" "build.go")
87 (delete-file "bin/syncthing") 86 (delete-file "bin/syncthing")
88 (invoke "go" "run" "build.go" "-no-upgrade" "build" "syncthing")))) 87 (invoke "go" "run" "build.go" "-no-upgrade" "build" "syncthing"))))
89 88
90 (replace 'check 89 (replace 'check
91 (lambda* (#:key tests? #:allow-other-keys) 90 (lambda* (#:key tests? #:allow-other-keys)
92 (when tests? 91 (when tests?
93 (with-directory-excursion "src/github.com/syncthing/syncthing" 92 (with-directory-excursion "src/github.com/syncthing/syncthing"
94 (invoke "go" "run" "build.go" "test"))) 93 (invoke "go" "run" "build.go" "test")))))
95 #t))
96 94
97 (replace 'install 95 (replace 'install
98 (lambda* (#:key outputs #:allow-other-keys) 96 (lambda _
99 (let ((out (assoc-ref outputs "out")) 97 (with-directory-excursion "src/github.com/syncthing/syncthing/bin"
100 (utils (assoc-ref outputs "utils"))) 98 (install-file "../syncthing" (string-append #$output "/bin"))
101 (with-directory-excursion "src/github.com/syncthing/syncthing/bin" 99 (for-each (cut install-file <> (string-append #$output:utils "/bin/"))
102 (install-file "../syncthing" (string-append out "/bin")) 100 '("stcompdirs" "stcrashreceiver"
103 (for-each (cut install-file <> (string-append utils "/bin/")) 101 "stdisco" "stdiscosrv" "stevents" "stfileinfo"
104 '("stcompdirs" "stcrashreceiver" 102 "stfinddevice" "stfindignored" "stgenfiles"
105 "stdisco" "stdiscosrv" "stevents" "stfileinfo" 103 "strelaypoolsrv" "strelaysrv" "stsigtool"
106 "stfinddevice" "stfindignored" "stgenfiles" 104 "stvanity" "stwatchfile" "uraggregate" "ursrv")))))
107 "strelaypoolsrv" "strelaysrv" "stsigtool"
108 "stvanity" "stwatchfile" "uraggregate" "ursrv"))
109 #t))))
110 105
111 (add-after 'install 'install-docs 106 (add-after 'install 'install-docs
112 (lambda* (#:key outputs #:allow-other-keys) 107 (lambda _
113 (let* ((out (assoc-ref outputs "out")) 108 (let ((man (string-append #$output "/share/man"))
114 (utils (assoc-ref outputs "utils")) 109 (man:utils (string-append #$output:utils "/share/man")))
115 (man "/share/man")
116 (man-section (string-append man "/man"))
117 (src "src/github.com/syncthing/syncthing/man/"))
118 ;; Install all the man pages to "out". 110 ;; Install all the man pages to "out".
119 (for-each 111 (for-each
120 (lambda (file) 112 (lambda (file)
121 (install-file file 113 (install-file file
122 (string-append out man-section 114 (string-append man "/man" (string-take-right file 1))))
123 (string-take-right file 1)))) 115 (find-files "src/github.com/syncthing/syncthing/man" "\\.[1-9]"))
124 (find-files src "\\.[1-9]"))
125 ;; Copy all the man pages to "utils" 116 ;; Copy all the man pages to "utils"
126 (copy-recursively (string-append out man) 117 (copy-recursively man man:utils)
127 (string-append utils man))
128 ;; Delete extraneous man pages from "out" and "utils", 118 ;; Delete extraneous man pages from "out" and "utils",
129 ;; respectively. 119 ;; respectively.
130 (delete-file (string-append out man "/man1/stdiscosrv.1")) 120 (delete-file (string-append man "/man1/stdiscosrv.1"))
131 (delete-file (string-append out man "/man1/strelaysrv.1")) 121 (delete-file (string-append man "/man1/strelaysrv.1"))
132 (delete-file (string-append utils man "/man1/syncthing.1")) 122 (delete-file (string-append man:utils "/man1/syncthing.1"))))))))
133 #t))))))
134 (synopsis "Decentralized continuous file system synchronization") 123 (synopsis "Decentralized continuous file system synchronization")
135 (description "Syncthing is a peer-to-peer file synchronization tool that 124 (description "Syncthing is a peer-to-peer file synchronization tool that
136supports a wide variety of computing platforms. It uses the Block Exchange 125supports a wide variety of computing platforms. It uses the Block Exchange