guix-commits
[Top][All Lists]
Advanced

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

04/05: gnu: syncthing: Split into two outputs.


From: Leo Famulari
Subject: 04/05: gnu: syncthing: Split into two outputs.
Date: Tue, 24 Oct 2017 13:11:51 -0400 (EDT)

lfam pushed a commit to branch master
in repository guix.

commit c330c27f7feea8172fa6881020a1425746bbb6a6
Author: Leo Famulari <address@hidden>
Date:   Tue Oct 24 11:56:37 2017 -0400

    gnu: syncthing: Split into two outputs.
    
    * gnu/packages/syncthing.scm (syncthing)[outputs]: New field.
    [arguments]: Change the 'install' and 'install-docs' phases to install to 
the
    two outputs.
---
 gnu/packages/syncthing.scm | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index 0bfa6d9..b23339d 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -38,6 +38,10 @@
                (base32
                 "07mrvd3vq0p4f550dpq73xg1vpa2h7xxz7vq07sjw0whapknkw9f"))))
     (build-system go-build-system)
+    ;; The primary Syncthing executable goes to "out", while the auxiliary
+    ;; server programs and utility tools go to "utils".  This reduces the size
+    ;; of "out" by ~80 MiB.
+    (outputs '("out" "utils"))
     (arguments
      `(#:import-path "github.com/syncthing/syncthing"
        #:unpack-path "github.com/syncthing"
@@ -74,21 +78,39 @@
                (zero? (system* "go" "run" "build.go" "test")))))
 
          (replace 'install
-           (lambda _
-             (copy-recursively "src/github.com/syncthing/syncthing/bin/"
-                               (string-append (assoc-ref %outputs "out") 
"/bin"))
-             #t))
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (utils (assoc-ref outputs "utils"))
+                   (src "src/github.com/syncthing/syncthing/bin/"))
+               (install-file (string-append src "/syncthing")
+                             (string-append out "/bin"))
+               (delete-file (string-append src "/syncthing"))
+               (copy-recursively "src/github.com/syncthing/syncthing/bin/"
+                                 (string-append utils "/bin"))
+               #t)))
 
          (add-after 'install 'install-docs
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (man (string-append out "/share/man/man"))
+                    (utils (assoc-ref outputs "utils"))
+                    (man "/share/man")
+                    (man-section (string-append man "/man"))
                     (src "src/github.com/syncthing/syncthing/man/"))
+               ;; Install all the man pages to "out".
                (for-each
                  (lambda (file)
                    (install-file file
-                                 (string-append man (string-take-right file 
1))))
+                                 (string-append out man-section
+                                                (string-take-right file 1))))
                  (find-files src "\\.[1-9]"))
+               ;; Copy all the man pages to "utils"
+               (copy-recursively (string-append out man)
+                                 (string-append utils man))
+               ;; 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))))))
     ;; When updating Syncthing, check 'vendor/manifest' in the source
     ;; distribution to ensure we are using the correct versions of these



reply via email to

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