From patchwork Sat Aug 5 08:20:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timotej Lazar X-Patchwork-Id: 52499 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8098127BBE9; Sat, 5 Aug 2023 09:21:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2B68027BBE2 for ; Sat, 5 Aug 2023 09:21:10 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSCX2-0000Yx-Gz; Sat, 05 Aug 2023 04:21:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSCX0-0000YE-KU for guix-patches@gnu.org; Sat, 05 Aug 2023 04:21:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSCX0-0002Ik-C5 for guix-patches@gnu.org; Sat, 05 Aug 2023 04:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qSCX0-0006Sp-7d for guix-patches@gnu.org; Sat, 05 Aug 2023 04:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65066] [PATCH 2/2] gnu: syncthing: Use new package style. Resent-From: Timotej Lazar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 05 Aug 2023 08:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65066@debbugs.gnu.org Cc: Timotej Lazar Received: via spool by 65066-submit@debbugs.gnu.org id=B65066.169122363324797 (code B ref 65066); Sat, 05 Aug 2023 08:21:02 +0000 Received: (at 65066) by debbugs.gnu.org; 5 Aug 2023 08:20:33 +0000 Received: from localhost ([127.0.0.1]:55439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSCWW-0006Rt-PD for submit@debbugs.gnu.org; Sat, 05 Aug 2023 04:20:33 -0400 Received: from araneo.si ([194.195.87.103]:47716 helo=localhost) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSCWU-0006RU-51 for 65066@debbugs.gnu.org; Sat, 05 Aug 2023 04:20:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=20230712; bh=4GkcM0Vv6VK v78DwHzhubUZI1MkKAV2jVq0ErtouszE=; h=references:in-reply-to:date: subject:cc:to:from; d=araneo.si; b=Lom8wwzFCmRz7nU67sOwX91WxsdGT7sJ1M7 HCBL8gkiozE0i1YeqQOEprUSUJM1Vk3vhjbt7aF/ZAI9b5V4AQ4r/BggyP4crkaIRtXPPT 25bF6phLlbR3UOkjxejo6nHD083OA2qglWAZ8tp0utJzsAIwJ1g9bG1QOPgeEvNIF4= Received: by araneo.si (OpenSMTPD) with ESMTPSA id a54c2bfb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 5 Aug 2023 08:20:26 +0000 (UTC) From: Timotej Lazar Date: Sat, 5 Aug 2023 10:20:21 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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