unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Timotej Lazar <timotej.lazar@araneo.si>
To: 65066@debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar@araneo.si>
Subject: [bug#65066] [PATCH 2/2] gnu: syncthing: Use new package style.
Date: Sat,  5 Aug 2023 10:20:21 +0200	[thread overview]
Message-ID: <bdc5464b395847c58dcfdb365b3c93439f24a645.1691223319.git.timotej.lazar@araneo.si> (raw)
In-Reply-To: <cover.1691223319.git.timotej.lazar@araneo.si>

* gnu/packages/syncthing.scm (syncthing)[arguments]: Use gexps. Drop trailing
---
 gnu/packages/syncthing.scm | 109 +++++++++++++++++--------------------
 1 file changed, 49 insertions(+), 60 deletions(-)

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





  parent reply	other threads:[~2023-08-05  8:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-05  8:17 [bug#65066] [PATCH 0/2] Update syncthing Timotej Lazar
2023-08-05  8:20 ` [bug#65066] [PATCH 1/2] gnu: syncthing: Update to 1.23.6 Timotej Lazar
2023-08-05  8:20 ` Timotej Lazar [this message]
2023-08-21 21:17 ` bug#65066: [PATCH 0/2] Update syncthing Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bdc5464b395847c58dcfdb365b3c93439f24a645.1691223319.git.timotej.lazar@araneo.si \
    --to=timotej.lazar@araneo.si \
    --cc=65066@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).