;;; 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 © 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.5.0")
+ (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
- "1394b8y4nllihnjngc0kjpdy7pvyh6v1h09hkn8rdmwxpsdkqkjb"))
- (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-github-com-go-ldap-ldap" ,go-github-com-go-ldap-ldap)
- ("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)
- ("go-github-com-willf-bloom" ,go-github-com-willf-bloom)
-
- ;; For tests.
- ("go-github-com-d4l3k-messagediff" ,go-github-com-d4l3k-messagediff)))
-
(arguments
`(#:modules ((srfi srfi-26) ; for cut
(guix build utils)
;; 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" "build" "all")
- (delete-file "syncthing")
+ (invoke "go" "run" "build.go")
+ (delete-file "bin/syncthing")
(invoke "go" "run" "build.go" "-no-upgrade" "build" "syncthing"))))
(replace 'check
(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 "src/github.com/syncthing/syncthing/bin"
+ (install-file "../syncthing" (string-append out "/bin"))
(for-each (cut install-file <> (string-append utils "/bin/"))
- '("stcli" "stcompdirs" "stcrashreceiver"
+ '("stcompdirs" "stcrashreceiver"
"stdisco" "stdiscosrv" "stevents" "stfileinfo"
"stfinddevice" "stfindignored" "stgenfiles"
"stindex" "strelaypoolsrv" "strelaysrv" "stsigtool"
(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")
(revision "0"))
(package
(name "go-github-com-bkaradzic-go-lz4")
- (version (git-version "1.0.0" revision commit))
+ (version (git-version "0.0.0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(define-public go-github-com-lib-pq
(package
(name "go-github-com-lib-pq")
- (version "1.5.2")
+ (version "1.2.0")
(source (origin
(method git-fetch)
(uri (git-reference
(file-name (git-file-name name version))
(sha256
(base32
- "1wjw5pfjgc63n9934mgvg8hr1v9381mcdz62jkn9xqxqcv6b95lw"))))
+ "08j1smm6rassdssdks4yh9aspa1dv1g5nvwimmknspvhx8a7waqz"))))
(build-system go-build-system)
(arguments
`(#:import-path "github.com/lib/pq"
(define-public go-github-com-oschwald-maxminddb-golang
(package
(name "go-github-com-oschwald-maxminddb-golang")
- (version "1.6.0")
+ (version "1.4.0")
(source (origin
(method git-fetch)
(uri (git-reference
(file-name (git-file-name name version))
(sha256
(base32
- "1xdqaazxddnajh0qic1c70skad44kxxr7m46fypbnawn61v3f7gc"))))
+ "100wd5qv00pkcm6cb8c4x5gavc9jnn7drh6xrqh85hzci4rils66"))))
(build-system go-build-system)
(propagated-inputs
`(("go-golang-org-x-sys" ,go-golang-org-x-sys)))
(license isc)))
(define-public go-github-com-stathat-go
- (package
- (name "go-github-com-stathat-go")
- (version "1.0.0")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/stathat/go")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "1zzlsl24dyr202qkr2pay22m6d0gb7ssms77wgdx0r0clgm7dihw"))))
- (build-system go-build-system)
- (arguments
- `(#:import-path "github.com/stathat/go"))
- (synopsis "Post statistics to StatHat")
- (description "This is a Go package for posting to a StatHat account.")
- (home-page "https://github.com/stathat/go")
- (license expat)))
+ (let ((commit "74669b9f388d9d788c97399a0824adbfee78400e")
+ (revision "0"))
+ (package
+ (name "go-github-com-stathat-go")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/stathat/go")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1zzlsl24dyr202qkr2pay22m6d0gb7ssms77wgdx0r0clgm7dihw"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/stathat/go"))
+ (synopsis "Post statistics to StatHat")
+ (description "This is a Go package for posting to a StatHat account.")
+ (home-page "https://github.com/stathat/go")
+ (license expat))))
(define-public go-github-com-rcrowley-go-metrics
(let ((commit "cac0b30c2563378d434b5af411844adff8e32960")
"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")
(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
(license expat))))
(define-public go-github-com-beorn7-perks-quantile
- (package
- (name "go-github-com-beorn7-perks-quantile")
- (version "1.0.1")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/beorn7/perks.git")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "17n4yygjxa6p499dj3yaqzfww2g7528165cl13haj97hlx94dgl7"))))
- (build-system go-build-system)
- (arguments
- '(#:import-path "github.com/beorn7/perks/quantile"
- #:unpack-path "github.com/beorn7/perks"))
- (synopsis "Compute approximate quantiles over an unbounded data stream")
- (description "Perks contains the Go package @code{quantile} that computes
+ (let ((commit "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9")
+ (revision "0"))
+ (package
+ (name "go-github-com-beorn7-perks-quantile")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/beorn7/perks")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1hrybsql68xw57brzj805xx2mghydpdiysv3gbhr7f5wlxj2514y"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/beorn7/perks/quantile"
+ #:unpack-path "github.com/beorn7/perks"))
+ (synopsis "Compute approximate quantiles over an unbounded data stream")
+ (description "Perks contains the Go package @code{quantile} that computes
approximate quantiles over an unbounded data stream within low memory and CPU
bounds.")
- (home-page "https://github.com/beorn7/perks")
- (license expat)))
+ (home-page "https://github.com/beorn7/perks")
+ (license expat))))
(define-public go-github-com-prometheus-client-model
(let ((commit "14fe0d1b01d4d5fc031dd4bec1823bd3ebbe8016")
(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
(license asl2.0)))
(define-public go-github-com-prometheus-procfs
- (package
- (name "go-github-com-prometheus-procfs")
- (version "0.0.11")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/prometheus/procfs.git")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "1msc8bfywsmrgr2ryqjdqwkxiz1ll08r3qgvaka2507z1wpcpj2c"))))
- (build-system go-build-system)
- (arguments
- '(#:import-path "github.com/prometheus/procfs"
- ;; The tests require Go modules, which are not yet supported in Guix's
- ;; Go build system.
- #:tests? #f))
- (propagated-inputs
- `(("go-golang-org-x-sys" ,go-golang-org-x-sys)))
- (synopsis "Go library for reading @file{/proc}")
- (description "The @code{procfs} Go package provides functions to retrieve
+ (package
+ (name "go-github-com-prometheus-procfs")
+ (version "0.0.4")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/prometheus/procfs")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1z5jq5rjala0a0di4nwk1rai0z9f73qwqj6mgcbpjbg2qknlb544"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/prometheus/procfs"
+ ;; The tests require Go modules, which are not yet supported in Guix's
+ ;; Go build system.
+ #:tests? #f))
+ (synopsis "Go library for reading @file{/proc}")
+ (description "The @code{procfs} Go package provides functions to retrieve
system, kernel, and process metrics from the @file{/proc} pseudo file system.")
- (home-page "https://github.com/prometheus/procfs")
- (license asl2.0)))
+ (home-page "https://github.com/prometheus/procfs")
+ (license asl2.0)))
(define-public go-github-com-prometheus-client-golang
(package
(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
(define-public go-github-com-go-asn1-ber-asn1-ber
(package
(name "go-github-com-go-asn1-ber-asn1-ber")
- (version "1.4.1")
+ (version "1.3.1")
(source (origin
(method git-fetch)
(uri (git-reference
(file-name (git-file-name name version))
(sha256
(base32
- "0d7yl1f7ak0djkflw8wx1wlhym2whg7bh57m419arfym9ncwrhg1"))))
+ "0dxfmgk84fn0p6pz3i0cspynh6rly5pfk9wghm1q07mx99npln02"))))
(build-system go-build-system)
(arguments
'(#:import-path "github.com/go-asn1-ber/asn1-ber"))
(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
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/AudriusButkevicius/pfilter.git")
+ (url "https://github.com/AudriusButkevicius/pfilter")
(commit version)))
(file-name (git-file-name name version))
(sha256
(license expat)))
(define-public go-github-com-ccding-go-stun
- (package
- (name "go-github-com-ccding-go-stun")
- (version "0.1.2")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/ccding/go-stun.git")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "133r2s4h9vv5lmjd680my2c5973gfi0gg5cxcwzjwdjad83a2dm0"))))
- (build-system go-build-system)
- (arguments
- '(#:import-path "github.com/ccding/go-stun"))
- (synopsis "STUN client implementation")
- (description "Go-stun is a go implementation of the STUN client (RFC 3489
+ (let ((commit "be486d185f3dfcb2dbf8429332da50a0da7f95a6")
+ (revision "2"))
+ (package
+ (name "go-github-com-ccding-go-stun")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ccding/go-stun")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1gr0rw1c1y7wh6913lyn5k4ig023by27i36bly6am8dwgrgp34ww"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/ccding/go-stun"))
+ (synopsis "STUN client implementation")
+ (description "Go-stun is a go implementation of the STUN client (RFC 3489
and RFC 5389).")
- (home-page "https://github.com/ccding/go-stun")
- (license asl2.0)))
+ (home-page "https://github.com/ccding/go-stun")
+ (license asl2.0))))
(define-public go-github-com-cespare-xxhash
(package