From 9c8a108186fa23cf31bf3a1a2370c4f82bdc91e3 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 26 Apr 2021 21:28:18 +0300 Subject: gnu: syncthing: Allow skipping the check phase. * gnu/packages/syncthing.scm (syncthing)[arguments]: Adjust the custom 'check phase so tests only run when enabled. --- gnu/packages/syncthing.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gnu/packages/syncthing.scm') diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm index e800aebda7..469c19f109 100644 --- a/gnu/packages/syncthing.scm +++ b/gnu/packages/syncthing.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2016 Petter ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Leo Famulari ;;; Copyright © 2020 Tobias Geerinckx-Rice -;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2020, 2021 Efraim Flashner ;;; Copyright © 2020 Giacomo Leidi ;;; Copyright © 2021 Maxim Cournoyer ;;; @@ -87,9 +87,11 @@ (define-public syncthing (invoke "go" "run" "build.go" "-no-upgrade" "build" "syncthing")))) (replace 'check - (lambda _ - (with-directory-excursion "src/github.com/syncthing/syncthing" - (invoke "go" "run" "build.go" "test")))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "src/github.com/syncthing/syncthing" + (invoke "go" "run" "build.go" "test"))) + #t)) (replace 'install (lambda* (#:key outputs #:allow-other-keys) -- cgit v1.2.3 From b33f5d7ff0627424a06fd0416761cd81c350e20a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 26 Apr 2021 21:30:15 +0300 Subject: gnu: syncthing: Prepare for cross-compiling. * gnu/packages/syncthing.scm (syncthing)[arguments]: Add custom 'pre-build phase to not set a local GOBIN directory. Adjust custom 'build and 'install phases accordingly. --- gnu/packages/syncthing.scm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'gnu/packages/syncthing.scm') diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm index 469c19f109..e40f696720 100644 --- a/gnu/packages/syncthing.scm +++ b/gnu/packages/syncthing.scm @@ -75,6 +75,14 @@ (define-public syncthing (("120s") "999s")) #t)) + (add-before 'build 'pre-build + (lambda _ + (with-directory-excursion "src/github.com/syncthing/syncthing" + ;; Don't set a local GOBIN, it breaks cross compiling. + (substitute* "build.go" + ((".*GOBIN.*") ""))) + #t)) + (replace 'build (lambda _ (with-directory-excursion "src/github.com/syncthing/syncthing" @@ -83,7 +91,7 @@ (define-public syncthing ;; "build syncthing" again with -no-upgrade. ;; https://github.com/syncthing/syncthing/issues/6118 (invoke "go" "run" "build.go") - (delete-file "bin/syncthing") + (for-each delete-file (find-files "../../../../bin" "syncthing")) (invoke "go" "run" "build.go" "-no-upgrade" "build" "syncthing")))) (replace 'check @@ -97,15 +105,11 @@ (define-public syncthing (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" - "stindex" "strelaypoolsrv" "strelaysrv" "stsigtool" - "stvanity" "stwatchfile" "uraggregate" "ursrv")) - #t)))) + (with-directory-excursion "src/github.com/syncthing/syncthing" + (install-file "syncthing" (string-append out "/bin"))) + (for-each (cut install-file <> (string-append utils "/bin/")) + (find-files "bin")) + #t))) (add-after 'install 'install-docs (lambda* (#:key outputs #:allow-other-keys) -- cgit v1.2.3