Toggle diff (438 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index acae77326..14aa0303f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -381,6 +381,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/suckless.scm \
%D%/packages/swig.scm \
%D%/packages/sync.scm \
+ %D%/packages/syncthing.scm \
%D%/packages/synergy.scm \
%D%/packages/syndication.scm \
%D%/packages/task-management.scm \
diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
new file mode 100644
index 000000000..bd02e6e9f
--- /dev/null
+++ b/gnu/packages/syncthing.scm
@@ -0,0 +1,1853 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Petter <petter@mykolab.ch>
+;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
+;;;
+;;; 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 trivial)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix git-download)
+ #:use-module (guix licenses))
+
+(define-public syncthing
+ (package
+ (name "syncthing")
+ (version "0.14.37")
+ (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
+ "02xs4x49va9cnapx6g19b62ln85wskxnr94nrz4mxdlsn7qgw92l"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/syncthing/syncthing"
+ #:unpack-path "github.com/syncthing"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'delete-bundled-source-code
+ (lambda _
+ ;; Keep the bundled cznic libraries. There are some "internal"
+ ;; cznic libraries that complicate the use of non-bundled copies.
+ (rename-file "src/github.com/syncthing/syncthing/vendor/github.com/cznic"
+ "cznic")
+ (delete-file-recursively "src/github.com/syncthing/syncthing/vendor")
+ (mkdir-p "src/github.com/syncthing/syncthing/vendor/github.com/")
+ (rename-file "cznic"
+ "src/github.com/syncthing/syncthing/vendor/github.com/cznic")
+ #t))
+
+ ;; We don't need to install the source code for end-user applications.
+ (delete 'install-source)
+
+ (add-before 'build 'increase-test-timeout
+ (lambda _
+ (substitute* "src/github.com/syncthing/syncthing/build.go"
+ (("60s") "999s"))
+ #t))
+
+ (replace 'build
+ (lambda* (#:key inputs #:allow-other-keys)
+ (with-directory-excursion "src/github.com/syncthing/syncthing"
+ (zero? (system* "go" "run" "build.go" "-no-upgrade")))))
+
+ (replace 'check
+ (lambda _
+ (with-directory-excursion "src/github.com/syncthing/syncthing"
+ (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))
+
+ (add-after 'install 'install-docs
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (man (string-append out "/share/man/man"))
+ (src "src/github.com/syncthing/syncthing/man/"))
+ (for-each
+ (lambda (file)
+ (install-file file
+ (string-append man (string-take-right file 1))))
+ (find-files src "\\.[1-9]"))
+ #t))))))
+ (inputs
+ `(("github-com-AudriusButkevicius-go-nat-pmp"
+ ,golang-github-com-audriusbutkevicius-go-nat-pmp)
+ ("golang-github-com-vitrun-qart" ,(golang-github-com-vitrun-qart))
+ ("github-com-thejerf-suture" ,golang-github-com-thejerf-suture)
+ ("github-com-syndtr-goleveldb" ,golang-github-com-syndtr-goleveldb)
+ ("github-com-sasha-s-go-deadlock" ,golang-github-com-sasha-s-go-deadlock)
+ ("github-com-rcrowley-go-metrics" ,golang-github-com-rcrowley-go-metrics)
+ ("github-com-minio-sha256-simd" ,golang-github-com-minio-sha256-simd)
+ ("github-com-kardianos-osext" ,golang-github-com-kardianos-osext)
+ ("golang-github-com-kballard-go-shellquote"
+ ,golang-github-com-kballard-go-shellquote)
+ ("github-com-jackpal-gateway" ,golang-github-com-jackpal-gateway)
+ ("github-com-gobwas-glob" ,golang-github-com-gobwas-glob)
+ ("github-com-calmh-xdr" ,golang-github-com-calmh-xdr)
+ ("github-com-calmh-luhn" ,golang-github-com-calmh-luhn)
+ ("github-com-calmh-du" ,golang-github-com-calmh-du)
+ ("github-com-bkaradzic-go-lz4" ,golang-github-com-bkaradzic-go-lz4)
+ ("github-com-golang-snappy" ,golang-github-com-golang-snappy)
+ ("golang-org-x-crypto" ,(golang-org-x-crypto))
+ ("golang-org-x-text" ,(golang-org-x-text))
+ ("golang.org-x-net" ,(golang-org-x-net))
+ ("golang-github-com-gogo-protobuf-protoc-gen-gogo"
+ ,golang-github-com-gogo-protobuf-protoc-gen-gogo)
+ ("golang-github-com-gogo-protobuf"
+ ,golang-github-com-gogo-protobuf)
+ ("golang-github-com-audriusbutkevicius-pfilter"
+ ,golang-github-com-audriusbutkevicius-pfilter)
+ ("github-com-ccding-go-stun"
+ ,golang-github-com-ccding-go-stun)
+ ("github-com-chmduquesne-rollinghash-adler32"
+ ,golang-github-com-chmduquesne-rollinghash-adler32)
+ ("golang-github-com-xtaci-kcp-go" ,golang-github-com-xtaci-kcp-go)
+ ("golang-github-com-klauspost-reedsolomon"
+ ,golang-github-com-klauspost-reedsolomon)
+ ("golang-github-com-xtaci-smux" ,golang-github-com-xtaci-smux)
+ ("golang-org-x-time-rate" ,golang-org-x-time-rate)
+ ("golang-github-com-oschwald-maxminddb-golang"
+ ,golang-github-com-oschwald-maxminddb-golang)
+ ("golang-org-x-sys-unix" ,golang-org-x-sys-unix)
+ ("golang-github-com-audriusbutkevicius-cli"
+ ,golang-github-com-audriusbutkevicius-cli)
+ ("golang-github-com-lib-pq" ,golang-github-com-lib-pq)
+ ("golang-github-com-oschwald-geoip2-golang"
+ ,golang-github-com-oschwald-geoip2-golang)
+ ("golang-github-com-golang-groupcache-lru"
+ ,golang-github-com-golang-groupcache-lru)
+; ("golang-github-com-cznic-ql" ,golang-github-com-cznic-ql) ; bundled
+ ("golang-github-com-edsrzf-mmap-go" ,golang-github-com-edsrzf-mmap-go)
+ ; Tests
+ ("golang-github-com-d4l3k-messagediff"
+ ,golang-github-com-d4l3k-messagediff)))
+ (synopsis "Decentralized continuous filesystem 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 golang-github-com-audriusbutkevicius-go-nat-pmp
+ (let ((commit "452c97607362b2ab5a7839b8d1704f0396b640ca")
+ (revision "0"))
+ (package
+ (name "golang-github-com-audriusbutkevicius-go-nat-pmp")
+ (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/AudriusButkevicius/go-nat-pmp")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32 "1accmpl1llk16a19nlyy991fqrgfay6l53gb64hgmdfmqljdvbk7"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/AudriusButkevicius/go-nat-pmp"))
+ (synopsis "Port mapping and discovery of the external IP address")
+ (description "Go client for the NAT-PMP internet protocol for port mapping and discovering the external IP address of a firewall")
+ (home-page "https://github.com/AudriusButkevicius/go-nat-pmp")
+ (license asl2.0))))
+
+(define-public golang-github-com-bkaradzic-go-lz4
+ (let ((commit "7224d8d8f27ef618c0a95f1ae69dbb0488abc33a")
+ (revision "0"))
+ (package
+ (name "golang-github-com-bkaradzic-go-lz4")
+ (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/bkaradzic/go-lz4")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "10lmya17vdqg2pvqni0p73iahni48s1v11ya9a0hcz4jh5vw4dkb"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/bkaradzic/go-lz4"))
+ (synopsis "Port of LZ4 lossless compression algorithm")
+ (description "go-lz4 is port of LZ4 lossless compression algorithm to Go")
+ (home-page "https://github.com/bkaradzic/go-lz4")
+ (license bsd-2))))
+
+(define-public golang-github-com-calmh-du
+ (package
+ (name "golang-github-com-calmh-du")
+ (version "1.0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/calmh/du")
+ (commit (string-append "v" version))))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "0qb3a6y3p9nkyn3s66k6zcm16y8n8578qh23ddj14cxf2scrr2n2"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/calmh/du"))
+ (synopsis "Get total and available disk space on a given volume")
+ (description "Du provides disk usage information, such as how much storage
+space is available, free, and used.")
+ (home-page "https://github.com/calmh/du")
+ (license public-domain)))
+
+(define-public golang-github-com-calmh-luhn
+ (package
+ (name "golang-github-com-calmh-luhn")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/calmh/luhn")
+ (commit (string-append "v" version))))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32 "1hfj1lx7wdpifn16zqrl4xml6cj5gxbn6hfz1f46g2a6bdf0gcvs"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/calmh/luhn"))
+ (synopsis "Luhn-mod-N implementation in Go")
+ (description "This packages provides a Luhn-mod-N implementation in Go.")
+ (home-page "https://github.com/calmh/luhn")
+ (license expat)))
+
+(define-public golang-github-com-calmh-xdr
+ (let ((commit "08e072f9cb164f943a92eb59f90f3abc64ac6e8f")
+ (revision "0"))
+ (package
+ (name "golang-github-com-calmh-xdr")
+ (version (string-append "2.0.1-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/calmh/xdr")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "072wqdncz3nd4a3zkhvzzx1y3in1lm29wfvl0d8wrnqs5pyqh0mh"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/calmh/xdr"))
+ (synopsis "XDR marshalling and unmarshalling")
+ (description "XDR is an External Data Representation (XDR)
+marshalling and unmarshalling library in Go. It uses code generation and not
+reflection")
+ (home-page "https://github.com/calmh/xdr")
+ (license expat))))
+
+(define-public golang-github-com-d4l3k-messagediff
+ (let ((commit "29f32d820d112dbd66e58492a6ffb7cc3106312b")
+ (revision "0"))
+ (package
+ (name "golang-github-com-d4l3k-messagediff")
+ (version (string-append "1.1.0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/d4l3k/messagediff")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "104hl8x57ciaz7mzafg1vp9qggxcyfm8hsv9bmlihbz9ml3nyr8v"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/d4l3k/messagediff"))
+ (synopsis "Diff arbitrary Golang structs")
+ (description "Messagediff is a library for calculating diffs of arbitrary
+Golang structs.")
+ (home-page "https://github.com/d4l3k/messagediff")
+ (license expat))))
+
+(define-public golang-github-com-edsrzf-mmap-go
+ (let ((commit "0bce6a6887123b67a60366d2c9fe2dfb74289d2e")
+ (revision "0"))
+ (package
+ (name "golang-github-com-edsrzf-mmap-go")
+ (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/edsrzf/mmap-go")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "1am4m2k451bksnbiqj6lxknk4lsgmrhv0q3ajqac818vj0cpfgs9"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/edsrzf/mmap-go"))
+ (synopsis "Go implementation of mmap")
+ (description "This packages provides a Go implementation of mmap.")
+ (home-page "https://github.com/edsrzf/mmap-go")
+ (license bsd-3))))
+
+(define-public golang-github-com-gobwas-glob
+ (let ((commit "51eb1ee00b6d931c66d229ceeb7c31b985563420")
+ (revision "0"))
+ (package
+ (name "golang-github-com-gobwas-glob")
+ (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gobwas/glob")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "090wzpwsjana1qas8ipwh1pj959gvc4b7vwybzi01f3bmd79jwlp"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/gobwas/glob"))
+ (synopsis "Go globbing library")
+ (description "This packages provides a Go implementation of globs.")
+ (home-page "https://github.com/gobwas/glob")
+ (license expat))))
+
+(define-public golang-github-com-gogo-protobuf
+ (let ((commit "efccd33a0c20aa078705571d5ddbfa14c8395a63")
+ (revision "0"))
+ (package
+ (name "golang-github-com-gogo-protobuf")
+ (version (string-append "0.2-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gogo/protobuf")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "09kfa3aqmhh7p0rc6wd4fw5cjccidsk9vgcy13albv0g8vnbmmgw"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/gogo/protobuf/proto"
+ #:unpack-path "github.com/gogo/protobuf"))
+ (inputs
+ `(("golang-github-com-gogo-protobuf-protoc-gen-gogo"
+ ,golang-github-com-gogo-protobuf-protoc-gen-gogo)))
+ (synopsis "Protocol Buffers for Go with Gadgets")
+ (description "gogoprotobuf is a fork of golang/protobuf with extra code
+generation features. This code generation is used to achieve:
+
+ fast marshalling and unmarshalling
+ more canonical Go structures
+ goprotobuf compatibility
+ less typing by optionally generating extra helper code
+ peace of mind by optionally generating test and benchmark code
+ other serialization formats")
+ (home-page "https://github.com/gogo/protobuf")
+ (license bsd-3))))
+
+(define-public golang-github-com-gogo-protobuf-protoc-gen-gogo
+ (let ((commit "efccd33a0c20aa078705571d5ddbfa14c8395a63")
+ (revision "0"))
+ (package
+ (name "golang-github-com-gogo-protobuf-protoc-gen-gogo")
+ (version (string-append "0.2-" revision "0" (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gogo/protobuf")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "09kfa3aqmhh7p0rc6wd4fw5cjccidsk9vgcy13albv0g8vnbmmgw"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/gogo/protobuf/protoc-gen-gogo"
+ #:unpack-path "github.com/gogo/protobuf"))
+ (synopsis "Protocol Buffers for Go with Gadgets")
+ (description "Gogoprotobuf is a fork of golang/protobuf with extra code
+generation features. This code generation is used to achieve:
+
+ fast marshalling and unmarshalling
+ more canonical Go structures
+ goprotobuf compatibility
+ less typing by optionally generating extra helper code
+ peace of mind by optionally generating test and benchmark code
+ other serialization formats")
+ (home-page "https://github.com/gogo/protobuf")
+ (license bsd-3))))
+
+(define-public golang-github-com-golang-groupcache-lru
+ (let ((commit "72d04f9fcdec7d3821820cc4a6f150eae553639a")
+ (revision "0"))
+ (package
+ (name "golang-github-com-golang-groupcache-lru")
+ (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/golang/groupcache")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "1l3ryh7bq1f2mhr3sd3x1wav99pd27r8l3ydgqh375wn4x7v5qd6"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/golang/groupcache/lru"
+ #:unpack-path "github.com/golang/groupcac