guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: syncthing: Prepare for cross-compiling.


From: guix-commits
Subject: 02/02: gnu: syncthing: Prepare for cross-compiling.
Date: Mon, 26 Apr 2021 14:33:56 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit b33f5d7ff0627424a06fd0416761cd81c350e20a
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Mon Apr 26 21:30:15 2021 +0300

    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(-)

diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index 469c19f..e40f696 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -75,6 +75,14 @@
                (("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 @@
                ;; "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 @@
            (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]