;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Petter <petter@mykolab.ch>
-;;; Copyright © 2016, 2017, 2018, 2019 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 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>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
(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 golang))
+ #: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.2.2")
+ (version "1.15.1")
+ ; XXX After the go-build-system can use "Go modules", stop using bundled
+ ; dependenices for Syncthing.
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/syncthing/syncthing"
"/syncthing-source-v" version ".tar.gz"))
(sha256
(base32
- "1wdjh8xw09s1nfkpc95v04619gqa4dpbygp2y5l35ww4g916lv3s"))
- (modules '((guix build utils)))
- ;; Delete bundled ("vendored") free software source code.
- (snippet '(begin
- (delete-file-recursively "vendor")
- #t))))
+ "04b90zwinl7frxrpjliq41mkbhpnkszmhdc5j2vbqwyhd82warxq"))))
(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"))
- ;; When updating Syncthing, check 'go.mod' in the source distribution to
- ;; ensure we are using the correct versions of these dependencies.
- (inputs
- `(("go-github-com-jackpal-go-nat-pmp"
- ,go-github-com-jackpal-go-nat-pmp)
- ("go-github-com-bkaradzic-go-lz4" ,go-github-com-bkaradzic-go-lz4)
- ("go-github-com-calmh-xdr" ,go-github-com-calmh-xdr)
- ("go-github-com-chmduquesne-rollinghash"
- ,go-github-com-chmduquesne-rollinghash)
- ("go-github-com-gobwas-glob" ,go-github-com-gobwas-glob)
- ("go-github-com-golang-groupcache-lru"
- ,go-github-com-golang-groupcache-lru)
- ("go-github-com-jackpal-gateway" ,go-github-com-jackpal-gateway)
- ("go-github-com-kballard-go-shellquote"
- ,go-github-com-kballard-go-shellquote)
- ("go-github-com-lib-pq" ,go-github-com-lib-pq)
- ("go-github-com-minio-sha256-simd" ,go-github-com-minio-sha256-simd)
- ("go-github-com-oschwald-geoip2-golang"
- ,go-github-com-oschwald-geoip2-golang)
- ("go-github-com-pkg-errors" ,go-github-com-pkg-errors)
- ("go-github-com-rcrowley-go-metrics" ,go-github-com-rcrowley-go-metrics)
- ("go-github-com-sasha-s-go-deadlock" ,go-github-com-sasha-s-go-deadlock)
- ("go-github-com-syncthing-notify" ,go-github-com-syncthing-notify)
- ("go-github-com-syndtr-goleveldb" ,go-github-com-syndtr-goleveldb)
- ("go-github-com-thejerf-suture" ,go-github-com-thejerf-suture)
- ("go-golang-org-x-time" ,go-golang-org-x-time)
- ("go-gopkg.in-ldap.v2" ,go-gopkg.in-ldap.v2)
- ("go-github-com-gogo-protobuf" ,go-github-com-gogo-protobuf)
- ("go-github-com-shirou-gopsutil" ,go-github-com-shirou-gopsutil)
- ("go-github-com-prometheus-client-golang"
- ,go-github-com-prometheus-client-golang)
- ("go-golang-org-x-net" ,go-golang-org-x-net)
- ("go-golang-org-x-text" ,go-golang-org-x-text)
- ("go-github-com-audriusbutkevicius-recli"
- ,go-github-com-audriusbutkevicius-recli)
- ("go-github-com-urfave-cli" ,go-github-com-urfave-cli)
- ("go-github-com-vitrun-qart" ,go-github-com-vitrun-qart)
- ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
- ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
- ("go-github-com-flynn-archive-go-shlex"
- ,go-github-com-flynn-archive-go-shlex)
- ("go-github-com-getsentry-raven-go" ,go-github-com-getsentry-raven-go)
- ("go-github-com-maruel-panicparse" ,go-github-com-maruel-panicparse)
- ("go-github-com-ccding-go-stun" ,go-github-com-ccding-go-stun)
- ("go-github-com-audriusbutkevicius-pfilter" ,go-github-com-audriusbutkevicius-pfilter)
- ("go-github-com-lucas-clemente-quic-go" ,go-github-com-lucas-clemente-quic-go)
-
- ;; For tests
- ("go-github-com-d4l3k-messagediff" ,go-github-com-d4l3k-messagediff)))
-
(arguments
- `(#:import-path "github.com/syncthing/syncthing"
+ `(#: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
(replace 'build
(lambda _
(with-directory-excursion "src/github.com/syncthing/syncthing"
- (invoke "go" "run" "build.go" "-no-upgrade"))))
+ ;; 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 _
(replace 'install
(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)))
+ (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))))
(add-after 'install 'install-docs
(lambda* (#:key outputs #:allow-other-keys)
(home-page "https://github.com/syncthing/syncthing")
(license mpl2.0)))
+(define-public syncthing-gtk
+ ;; The commit used below corresponds to the latest commit of the
+ ;; python3-port branch maintained by Debian. Upstream hasn't bothered
+ ;; porting to Python 3 (see:
+ ;; https://github.com/kozec/syncthing-gtk/issues/487).
+ (let ((revision "1")
+ (commit "c46fbd8ad1d12d409da8942702a2f119cf45514a"))
+ (package
+ (name "syncthing-gtk")
+ (version (git-version "0.9.4.4" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://salsa.debian.org/debian/syncthing-gtk.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1x1c8snf0jpgjmyyidjw0015ksk5ishqn817wx8vs9i0lfgnnbbg"))))
+ (build-system python-build-system)
+ (arguments
+ `(#: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"))))))
+ (add-after 'unpack 'remove-windows.py
+ (lambda _
+ ;; A Windows-specific module that fails to load with
+ ;; "ModuleNotFoundError: No module named 'msvcrt'.
+ (delete-file "syncthing_gtk/windows.py")))
+ (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"))))))))))
+ (inputs
+ `(("gtk+" ,gtk+)
+ ("libappindicator" ,libappindicator)
+ ("libnotify" ,libnotify)
+ ("librsvg" ,librsvg)
+ ("python-bcrypt" ,python-bcrypt)
+ ("python-dateutil" ,python-dateutil)
+ ("python-pycairo" ,python-pycairo)
+ ("python-pygobject" ,python-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))))
+
(define-public go-github-com-jackpal-go-nat-pmp
(package
(name "go-github-com-jackpal-go-nat-pmp")
(define-public go-github-com-jackpal-gateway
(package
(name "go-github-com-jackpal-gateway")
- (version "1.0.5")
+ (version "1.0.6")
(source (origin
(method git-fetch)
(uri (git-reference
(file-name (git-file-name name version))
(sha256
(base32
- "1ird5xmizj632l3dq24s2xgb8w1dn6v8xznlqz252gvngyr2gjl1"))))
+ "1yms2dw4dnz4cvj9vhwh6193d50jhvn5awsp2g3a4lcc3sjrgd6m"))))
(build-system go-build-system)
(arguments
`(#:import-path "github.com/jackpal/gateway"))
"1hfxffnpaw49pr3wrkbzq3pnv3nyzsvk5dxndv0yz70xlrbg8a04"))))
(build-system go-build-system)
(arguments
- `(#:import-path "github.com/rcrowley/go-metrics"))
+ ;; Arbitrary precision tests are known to be broken on aarch64, ppc64le
+ ;; and s390x. See: https://github.com/rcrowley/go-metrics/issues/249
+ `(#:tests? ,(not (string-prefix? "aarch64" (or (%current-target-system)
+ (%current-system))))
+ #:import-path "github.com/rcrowley/go-metrics"))
(propagated-inputs
`(("go-github-com-stathat-go" ,go-github-com-stathat-go)))
(synopsis "Go port of Coda Hale's Metrics library")
(license asl2.0)))
(define-public go-github-com-syndtr-goleveldb
- (let ((commit "c3a204f8e96543bb0cc090385c001078f184fc46")
- (revision "3"))
+ (let ((commit "758128399b1df3a87e92df6c26c1d2063da8fabe")
+ (revision "4"))
(package
(name "go-github-com-syndtr-goleveldb")
(version (git-version "1.0.1" revision commit))
(file-name (git-file-name name version))
(sha256
(base32
- "18cac90dim2z5g28vazzibxa058q2ynihsmf0vbscwzba6l5s5ms"))))
+ "0mnkzrz4di13g6ggd54my7bkb9nwk8f5k672dyasn467wsg7bf8f"))))
(build-system go-build-system)
(propagated-inputs
`(("go-github-com-golang-snappy" ,go-github-com-golang-snappy)))
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/chmduquesne/rollinghash.git")
+ (url "https://github.com/chmduquesne/rollinghash")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/petermattis/goid.git")
+ (url "https://github.com/petermattis/goid")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/kballard/go-shellquote.git")
+ (url "https://github.com/kballard/go-shellquote")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/beorn7/perks.git")
+ (url "https://github.com/beorn7/perks")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/prometheus/client_model.git")
+ (url "https://github.com/prometheus/client_model")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(method git-fetch)
(uri
(git-reference
- (url "https://github.com/matttproud/golang_protobuf_extensions.git")
+ (url "https://github.com/matttproud/golang_protobuf_extensions")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/prometheus/common.git")
+ (url "https://github.com/prometheus/common")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/prometheus/procfs.git")
+ (url "https://github.com/prometheus/procfs")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/prometheus/client_golang.git")
+ (url "https://github.com/prometheus/client_golang")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
,go-github-com-prometheus-client-model)
("go-github-com-prometheus-common"
,go-github-com-prometheus-common)
- ("go-github-com-prometheus-procfs" ,go-github-com-prometheus-procfs)))
+ ("go-github-com-prometheus-procfs" ,go-github-com-prometheus-procfs)
+ ("go-github-com-cespare-xxhash" ,go-github-com-cespare-xxhash)))
(synopsis "HTTP server and client tools for Prometheus")
(description "This package @code{promhttp} provides HTTP client and
server tools for Prometheus metrics.")
(home-page "https://github.com/prometheus/client_golang")
(license asl2.0)))
-(define-public go-gopkg.in-asn1-ber.v1
+(define-public go-github-com-go-asn1-ber-asn1-ber
(package
- (name "go-gopkg.in-asn1-ber.v1")
- (version "1.3")
+ (name "go-github-com-go-asn1-ber-asn1-ber")
+ (version "1.3.1")
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://gopkg.in/asn1-ber.v1")
+ (url "https://github.com/go-asn1-ber/asn1-ber")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
- "00ixms8x3lrhywbvq5v2sagcqsxa1pcnlk17dp5lnwckv3xg4psb"))))
+ "0dxfmgk84fn0p6pz3i0cspynh6rly5pfk9wghm1q07mx99npln02"))))
(build-system go-build-system)
(arguments
- '(#:import-path "gopkg.in/asn1-ber.v1"
- ;; Tests don't pass "vet" on Go since 1.11. See
- ;; https://github.com/go-asn1-ber/asn1-ber/issues/20.
- #:phases
- (modify-phases %standard-phases
- (replace 'check
- (lambda* (#:key import-path #:allow-other-keys)
- (invoke "go" "test"
- "-vet=off"
- import-path))))))
+ '(#:import-path "github.com/go-asn1-ber/asn1-ber"))
(synopsis "ASN.1 BER encoding and decoding in Go")
(description "This package provides ASN.1 BER encoding and decoding in the
Go language.")
- (home-page "https://gopkg.in/asn1-ber.v1")
+ (home-page "https://github.com/go-asn1-ber/asn1-ber")
(license expat)))
-(define-public go-gopkg.in-ldap.v2
+(define-public go-github-com-go-ldap-ldap
(package
- (name "go-gopkg.in-ldap.v2")
- (version "2.5.1")
+ (name "go-github-com-go-ldap-ldap")
+ (version "3.1.7")
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://gopkg.in/ldap.v2")
+ (url "https://github.com/go-ldap/ldap")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
- "1wf81wy04nhkqs0dg5zkivr4sh37r83bxrfwjz9vr4jq6vmljr3h"))))
+ "1z6wxia7a1jkmasa9mm6g4n8f0qqbp5rw6vk0zyh4vzk7azklnj2"))))
(build-system go-build-system)
(arguments
- '(#:import-path "gopkg.in/ldap.v2"
- #:tests? #f)) ; the test suite requires network access
+ '(#:import-path "github.com/go-ldap/ldap/v3"
+ #:tests? #f)) ; test suite requires internet access
(propagated-inputs
- `(("go-gopkg.in-asn1-ber.v1" ,go-gopkg.in-asn1-ber.v1)))
+ `(("go-github-com-go-asn1-ber-asn1-ber" ,go-github-com-go-asn1-ber-asn1-ber)))
+ (home-page "https://github.com/go-ldap/ldap")
(synopsis "LDAP v3 functionality for Go")
(description "This package provides basic LDAP v3 functionality in the Go
language.")
- (home-page "https://gopkg.in/ldap.v2")
(license expat)))
(define-public go-github-com-flynn-archive-go-shlex
(source (origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/flynn-archive/go-shlex.git")
+ (url "https://github.com/flynn-archive/go-shlex")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(license asl2.0))))
(define-public go-github-com-audriusbutkevicius-pfilter
- (let ((commit "c55ef6137fc6f075801eac099cc2687ede0f101d")
- (revision "3"))
- (package
- (name "go-github-com-audriusbutkevicius-pfilter")
- (version (git-version "0.0.0" revision commit))
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/AudriusButkevicius/pfilter.git")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0xzhwyd0w21bhvzl5pinn22hp0y6h44rh3s2ppql69rafc6zd3c6"))))
- (build-system go-build-system)
- (arguments
- '(#:import-path "github.com/AudriusButkevicius/pfilter"))
- (synopsis "Filter packets into multiple virtual connections")
- (description "Pfilter is a Go package for filtering packets into multiple
+ (package
+ (name "go-github-com-audriusbutkevicius-pfilter")
+ (version "0.0.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/AudriusButkevicius/pfilter")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0xzhwyd0w21bhvzl5pinn22hp0y6h44rh3s2ppql69rafc6zd3c6"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/AudriusButkevicius/pfilter"))
+ (synopsis "Filter packets into multiple virtual connections")
+ (description "Pfilter is a Go package for filtering packets into multiple
virtual connections from a single physical connection.")
- (home-page "https://github.com/AudriusButkevicius/pfilter")
- (license expat))))
+ (home-page "https://github.com/AudriusButkevicius/pfilter")
+ (license expat)))
(define-public go-github-com-ccding-go-stun
(let ((commit "be486d185f3dfcb2dbf8429332da50a0da7f95a6")
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/ccding/go-stun.git")
+ (url "https://github.com/ccding/go-stun")
(commit commit)))
(file-name (git-file-name name version))
(sha256
and RFC 5389).")
(home-page "https://github.com/ccding/go-stun")
(license asl2.0))))
+
+(define-public go-github-com-cespare-xxhash
+ (package
+ (name "go-github-com-cespare-xxhash")
+ (version "2.1.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/cespare/xxhash")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "12ad3z7ki9j07c4kx3ywkl6188i2afsjg7sl60wd21p6zkkpfjxq"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/cespare/xxhash"))
+ (synopsis "Go implementation of xxHash")
+ (description "This package provides of Go implementation of the 64-bit
+xxHash algorithm (XXH64).")
+ (home-page "https://github.com/cespare/xxhash/")
+ (license expat)))