unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 0937e2bcffddbef1ecb0b7428115ac7e03ab0fb5 8813 bytes (raw)
name: gnu/packages/syncthing.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Petter <petter@mykolab.ch>
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Leo Famulari <leo@famulari.name>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages syncthing)
  #:use-module (guix build-system go)
  #:use-module (guix build-system python)
  #:use-module (guix build-system trivial)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix licenses)
  #:use-module (gnu packages)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-crypto)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages time))

(define-public syncthing
  (package
    (name "syncthing")
    (version "1.12.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/syncthing/syncthing"
                                  "/releases/download/v" version
                                  "/syncthing-source-v" version ".tar.gz"))
              (sha256
               (base32
                "0a8s7xmaiqg8j7zmwqr7gw6kip0lh42yig9gmnk51c2r3ic5f2zv"))))
    (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
     `(#:modules ((srfi srfi-26) ; for cut
                  (guix build utils)
                  (guix build go-build-system))
       #: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))

         (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 _
             (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"
                 (install-file "syncthing" (string-append out "/bin"))
                 (with-directory-excursion "bin"
                   (for-each (cut install-file <> (string-append utils "/bin/"))
                             '("stcli" "stcompdirs" "stcrashreceiver"
                               "stdisco" "stdiscosrv" "stevents" "stfileinfo"
                               "stfinddevice" "stfindignored" "stgenfiles"
                               "stindex" "strelaypoolsrv" "strelaysrv" "stsigtool"
                               "stvanity" "stwatchfile" "uraggregate" "ursrv")))
                 #t))))

         (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/"))
               ;; 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]"))
               ;; 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))))))
    (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
Protocol.")
    (home-page "https://github.com/syncthing/syncthing")
    (license mpl2.0)))

(define-public syncthing-gtk
  (package
    (name "syncthing-gtk")
    (version "0.9.4.4")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/syncthing/syncthing-gtk")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0nc0wd7qvyri7841c3dd9in5d7367hys0isyw8znv5fj4c0a6v1f"))))
    (build-system python-build-system)
    (arguments
     `(#:python ,python-2
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'hardcode-dependencies
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((psmisc (assoc-ref inputs "psmisc"))
                   (syncthing (assoc-ref inputs "syncthing")))
               ;; Hardcode dependencies paths to avoid propagation.
               (substitute* "syncthing_gtk/tools.py"
                 (("killall") (string-append psmisc "/bin/killall")))
               (substitute* "syncthing_gtk/configuration.py"
                 (("/usr/bin/syncthing") (string-append syncthing
                                                        "/bin/syncthing"))))
             #t))
         (add-after 'wrap 'wrap-libs
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (wrap-program (string-append out "/bin/syncthing-gtk")
                 `("GI_TYPELIB_PATH" ":" prefix
                   (,(getenv "GI_TYPELIB_PATH"))))
               #t))))))
    (inputs
     `(("gtk+" ,gtk+)
       ("libappindicator" ,libappindicator)
       ("libnotify" ,libnotify)
       ("librsvg" ,librsvg)
       ("python2-bcrypt" ,python2-bcrypt)
       ("python2-dateutil" ,python2-dateutil)
       ("python2-pycairo" ,python2-pycairo)
       ("python2-pygobject" ,python2-pygobject)
       ("python-nautilus" ,python-nautilus)
       ("psmisc" ,psmisc)
       ("syncthing" ,syncthing)))
    (native-inputs
     `(("python2-setuptools" ,python2-setuptools)))
    (home-page "https://github.com/syncthing/syncthing-gtk")
    (synopsis "GTK3 based GUI and notification area icon for Syncthing")
    (description "@code{syncthing-gtk} is a GTK3 Python based GUI and
notification area icon for Syncthing.  Supported Syncthing features:

@itemize
@item Everything that WebUI can display
@item Adding, editing and deleting nodes
@item Adding, editing and deleting repositories
@item Restart, shutdown server
@item Editing daemon settings
@end itemize\n")
    (license gpl2)))

debug log:

solving 0937e2bcff ...
found 0937e2bcff in https://yhetil.org/guix-patches/20201227212304.19409-1-dftxbs3e@free.fr/ ||
	https://yhetil.org/guix-patches/20201227220016.20897-1-dftxbs3e@free.fr/
found 7e479a0d39 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 7e479a0d393afc56ce6dde13fa5096074c842d15	gnu/packages/syncthing.scm

applying [1/1] https://yhetil.org/guix-patches/20201227212304.19409-1-dftxbs3e@free.fr/
diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index 7e479a0d39..0937e2bcff 100644

Checking patch gnu/packages/syncthing.scm...
Applied patch gnu/packages/syncthing.scm cleanly.

skipping https://yhetil.org/guix-patches/20201227220016.20897-1-dftxbs3e@free.fr/ for 0937e2bcff
index at:
100644 0937e2bcffddbef1ecb0b7428115ac7e03ab0fb5	gnu/packages/syncthing.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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