aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Petter <petter@mykolab.ch>
;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020-2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2023 Benjamin Slade <slade@lambda-y.net>
;;; Copyright © 2024 David Pflug <david@pflug.io>
;;;
;;; 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 gexp)
  #: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 bash)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages golang-build)
  #:use-module (gnu packages golang-compression)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages python-crypto)
  #:use-module (gnu packages time))

(define-public syncthing
  (package
    (name "syncthing")
    (version "1.27.2")
    (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
                "0g418jyqqik8ds8qcrlnmm2bhwwpbrfgd82fg2jyip4zw1aicqia"))))
    (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 ~144 MiB.
    (outputs '("out" "utils"))
    (arguments
     (list #: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"))))

               (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* (#:key tests? #:allow-other-keys)
                 (when tests?
                   (with-directory-excursion "src/github.com/syncthing/syncthing"
                     (invoke "go" "run" "build.go" "test")))))

             (replace 'install
               (lambda _
                 (with-directory-excursion "src/github.com/syncthing/syncthing/bin"
                   (install-file "../syncthing" (string-append #$output "/bin"))
                   (for-each (cut install-file <> (string-append #$output:utils "/bin/"))
                             '("stcompdirs" "stcrashreceiver"
                               "stdisco" "stdiscosrv" "stevents" "stfileinfo"
                               "stfinddevice" "stfindignored" "stgenfiles"
                               "strelaypoolsrv" "strelaysrv" "stsigtool"
                               "stvanity" "stwatchfile" "ursrv")))))

         (add-after 'install 'install-docs
           (lambda _
             (let ((man (string-append #$output "/share/man"))
                   (man:utils (string-append #$output:utils "/share/man")))
               ;; Install all the man pages to "out".
               (for-each
                (lambda (file)
                  (install-file file
                                (string-append man "/man" (string-take-right file 1))))
                (find-files "src/github.com/syncthing/syncthing/man" "\\.[1-9]"))
               ;; Copy all the man pages to "utils"
               (copy-recursively man man:utils)
               ;; Delete extraneous man pages from "out" and "utils",
               ;; respectively.
               (delete-file (string-append man "/man1/stdiscosrv.1"))
               (delete-file (string-append man "/man1/strelaysrv.1"))
               (delete-file (string-append man:utils  "/man1/syncthing.1"))))))))
    (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")
    (properties
     '((release-monitoring-url . "https://syncthing.net/downloads/")
       (upstream-name . "syncthing-source")
       ;; The hashing code greatly benefits from newer architecture support.
       (tunable? . #t)))
    (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 'fix-autostart-path
             ;; Change the autostart .desktop file 'Exec' command so it finds
             ;; the Python wrapper of 'syncthing-gtk', rather than the unwrapped
             ;; '.syncthing-gtk-real'.
             (lambda _
               (substitute* "syncthing_gtk/tools.py"
                 (("return executable")
                   "return \"syncthing-gtk\""))))
           (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
       (list bash-minimal
             gtk+
             libappindicator
             libnotify
             python-bcrypt
             python-dateutil
             python-pycairo
             python-pygobject
             psmisc
             syncthing))
      (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 qsyncthingtray
  (deprecated-package "qsyncthingtray" syncthing-gtk))

(define-public go-github-com-syncthing-notify
  (let ((commit "69c7a957d3e261f9744f46b3dd4d608d8480ad90")
        (revision "5"))
    (package
      (name "go-github-com-syncthing-notify")
      (version (git-version "0.0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                       (url "https://github.com/syncthing/notify")
                       (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1mmdzyfnmjabyhbipl4bggw4w5nlxyyjp0d93qd824kj07kmsr1f"))))
      (build-system go-build-system)
      (arguments
       '(#:import-path "github.com/syncthing/notify"))
      (propagated-inputs
       (list go-golang-org-x-sys))
      (synopsis "File system event notification library")
      (description "This package provides @code{notify}, a file system event
notification library in Go.")
      (home-page "https://github.com/syncthing/notify")
      (license expat))))
d>gnu: Sort module imports in (gnu packages fontutils)....* gnu/packages/fontutils.scm: Sort (gnu ...) module imports. Marius Bakke 2020-11-29Merge remote-tracking branch 'origin/master' into core-updatesChristopher Baines 2020-11-23gnu: libraqm: Update to 0.7.1....* gnu/packages/fontutils.scm (libraqm): Update to 0.7.1. Tobias Geerinckx-Rice 2020-11-19gnu: Don't append '.git' to GitHub uris....* gnu/packages/admin.scm (nmrpflash)[source]: Remove '.git' from URI. * gnu/packages/aidc.scm (zxing-cpp), * gnu/packages/assembly.scm (mbuild), * gnu/packages/audio.scm (opensles, wildmidi, tinyalsa), * gnu/packages/browser-extensions.scm (ublock-origin-chromium), * gnu/packages/check.scm (mutest), * gnu/packages/compression.scm (unshield), * gnu/packages/coq.scm (subset), * gnu/packages/dictionaries.scm (translate-shell), * gnu/packages/disk.scm (memkind), * gnu/packages/documentation.scm (latex2html), * gnu/packages/emacs-xyz.scm (emacs-chronometrist, emacs-flycheck-ledger, emacs-counsel-notmuch, emacs-spaceline, emacs-org-generate), * gnu/packages/embedded.scm (ebusd, ebusd-configuration), * gnu/packages/enchant.scm (nuspell), * gnu/packages/fontutils.scm (woff2), * gnu/packages/geo.scm (memphis), * gnu/packages/gimp.scm (mrg), * gnu/packages/gnome-xyz.scm (gnome-shell-extension-appindicator), * gnu/packages/gnome.scm (parlatype), * gnu/packages/golang.scm (go-github-com-tv42-httpunix, go-github-com-ayufan-golang-kardianos-service), * gnu/packages/graphics.scm (eglexternalplatform, egl-wayland, mmm, directfb, flux), * gnu/packages/gstreamer.scm (openni2, ccextractor, libvisual, graphene), * gnu/packages/guile-xyz.scm (guile-srfi-180, guile-torrent), * gnu/packages/image.scm (openjpeg-data), * gnu/packages/java.scm (javacc), * gnu/packages/language.scm (liblouis, liblouisutdml), * gnu/packages/linux.scm (pamela, ttyebus), * gnu/packages/lxqt.scm (lxqt-connman-applet), * gnu/packages/mail.scm (libetpan), * gnu/packages/man.scm (ronn), * gnu/packages/music.scm (tascam-gtk, artyfx), * gnu/packages/networking.scm (srt, lksctp-tools, nng, nanomsg), * gnu/packages/python-crypto.scm (pure-python-otr), * gnu/packages/qt.scm (qtspell), * gnu/packages/raspberry-pi.scm (raspi-gpio, raspi-open-firmware), * gnu/packages/rdp.scm (freerdp), * gnu/packages/ruby.scm (ruby-prawn-templates, ruby-treetop, ruby-gimme, ruby-standard, ruby-rubocop-ast, ruby-rexml, ruby-range-compressor, ruby-regexp-property-values, ruby-regexp-parser, ruby-rubocop, ruby-pdf-reader, ruby-pdf-inspector, ruby-prawn), * gnu/packages/syncthing.scm (syncthing-gtk), * gnu/packages/video.scm (svt-hevc, mediasdk, libvideogfx, libde265, tslib), * gnu/packages/xml.scm (libxmlb, libxmlplusplus)[source]: Same. Efraim Flashner 2020-11-08gnu: fontutils: Remove PDF files from the "doc" output....* gnu/packages/fontutils.scm (fontconfig)[arguments]: Add 'remove-pdf-files' phase. Ludovic Courtès 2020-11-08gnu: fontconfig: Add "doc" output....* gnu/packages/fontutils.scm (fontconfig)[outputs]: New field. [arguments]: Add 'move-man-sections'. Ludovic Courtès 2020-11-08gnu: woff-tools: End all phases in #t....* gnu/packages/fontutils.scm (woff-tools)[arguments]: End custom 'install phase with #t. Efraim Flashner 2020-11-08gnu: woff-tools: Fix cross building....* gnu/packages/fontutils.scm (woff-tools)[arguments]: Don't hardcode gcc. Efraim Flashner 2020-10-30gnu: Add lcdf-typetools....* gnu/packages/fontutils.scm (lcdf-typetools): New variable. Julien Lepiller 2020-10-22gnu: freetype: Replace with 2.10.4 [fixes CVE-2020-15999]....* gnu/packages/fontutils.scm (freetype)[replacement]: New field, set to... (freetype/fixed): ...this new variable. Tobias Geerinckx-Rice 2020-10-19Merge branch 'staging'...Conflicts: gnu/packages/admin.scm gnu/packages/commencement.scm gnu/packages/gdb.scm gnu/packages/llvm.scm gnu/packages/package-management.scm gnu/packages/tls.scm Maxim Cournoyer 2020-09-28gnu: libspiro: Replace with 20200505 [fixes CVE-2019-19847]....* gnu/packages/fontutils.scm (libspiro)[replacement]: New field. (libspiro-20200505): New variable. Marius Bakke 2020-09-23gnu: Fix typoes in package descriptions....* gnu/packages/audio.scm (caps-plugins-lv2)[synopsis]: Fix typo. * gnu/packages/bioconductor.scm (r-karyoploter, r-anota, r-gcrma) (r-bigmemoryextras)[description]: Likewise. * gnu/packages/cran.scm (r-geometry)[synopsis]: Likewise. (r-stringdist, r-patchwork, r-depth, r-tea)[description]: Likewise. * gnu/packages/crates-io.scm (rust-assert-fs-0.11, rust-notify-4) (rust-tokio-fs-0.1)[synopsis, description]: Likewise. (rust-blas-sys-0.7)[description]: Likewise. (rust-fs-extra-1.1, rust-xattr-0.2)[synopsis]: Likewise. * gnu/packages/databases.scm (perl-mysql-config)[description]: Likewise. * gnu/packages/disk.scm (hddtemp)[description]: Likewise. * gnu/packages/django.scm (python-djangorestframework)[description]: Likewise. * gnu/packages/documentation.scm (doc++)[description]: Likewise. * gnu/packages/emacs-xyz.scm (emacs-kakoune, emacs-pyim-basedict, eless) (emacs-scpaste)[description]: Likewise. * gnu/packages/file-systems.scm (dbxfs)[description]: Likewise. * gnu/packages/finance.scm (python-stdnum)[description]: Likewise. * gnu/packages/fontutils.scm (woff2)[description]: Likewise. * gnu/packages/games.scm (openttd-opengfx)[description]: Likewise. * gnu/packages/gnome-xyz.scm (gnome-shell-extension-topicons-redux) [description]: Likewise. * gnu/packages/gnome.scm (libgrss)[description]: Likewise. * gnu/packages/golang.scm (go-github-com-mitchellh-reflectwalk) [description]: Likewise. (go-github-com-go-git-go-billy)[synopsis, description]: Likewise. * gnu/packages/haskell-check.scm (ghc-inspection-testing)[description]: Likewise. * gnu/packages/haskell-web.scm (ghc-yesod-form)[description]: Likewise. * gnu/packages/haskell-xyz.scm (ghc-hex)[description]: Likewise. * gnu/packages/hyperledger.scm (hyperledger-iroha-ed25519)[description]: Likewise. * gnu/packages/java.scm (java-mail)[synopsis]: Likewise. (java-native-access-platform)[description]: Likewise. * gnu/packages/kde-frameworks.scm (kactivities-stats)[description]: Likewise. * gnu/packages/kde-utils.scm (krusader)[description]: Likewise. * gnu/packages/language.scm (praat)[description]: Likewise. * gnu/packages/linux.scm (light)[description]: Likewise. * gnu/packages/lisp-xyz.scm (sbcl-hu.dwim.defclass-star)[description]: Likewise. * gnu/packages/mail.scm (dovecot-trees, sieve-connect)[description]: Likewise. * gnu/packages/ocaml.scm (ocaml-opam-file-format, ocaml-cppo) (ocaml4.07-ppx-variants-conv)[description]: Likewise. * gnu/packages/perl.scm (perl-convert-binhex)[description]: Likewise. * gnu/packages/python-crypto.scm (python-ecdsa)[description]: Likewise. * gnu/packages/python-web.scm (python-html5lib)[synopsis, description]: Likewise. (python-venusian)[synopsis]: Likewise. * gnu/packages/python-xyz.scm (python-readlike, python-gssapi) (python-flufl-i18n)[description]: Likewise. (python-pox, python-watchdog, python-xattr)[synopsis, description]: Likewise. * gnu/packages/ruby.scm (ruby-sorcerer)[description]: Likewise. * gnu/packages/rust-apps.scm (watchexec)[description]: Likewise. * gnu/packages/rust.scm (mrustc)[synopsis]: Likewise. * gnu/packages/shells.scm (s-shell)[description]: Likewise. * gnu/packages/ssh.scm (sshpass)[description]: Likewise. * gnu/packages/terminals.scm (beep)[description]: Likewise. * gnu/packages/web.scm (perl-lwp-useragent-cached)[description]: Likewise. * gnu/packages/wv.scm (wv)[description]: Likewise. Tobias Geerinckx-Rice 2020-09-14Merge remote-tracking branch 'origin/master' into core-updatesMaxim Cournoyer 2020-09-01gnu: ttfautohint: Don't build static library....* gnu/packages/fontutils.scm (ttfautohint)[arguments]: Add configure-flag to not build static library. Efraim Flashner 2020-09-01gnu: ttfautohint: Update to 1.8.3....* gnu/packages/fontutils.scm (ttfautohint): Update to 1.8.3. [source]: Remove patch. * gnu/packages/patches/ttfautohint-source-date-epoch.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. Efraim Flashner 2020-08-26Merge remote-tracking branch 'origin/master' into core-updatesMathieu Othacehe 2020-08-19gnu: woff2: Update package definition....* gnu/packages/fontutils.scm (woff2): Update package definition. [outputs]: New output "bin". [arguments]<#:configure-flags>[-DCMAKE_INSTALL_BINDIR]: New flag. [-DCMAKE_INSTALL_INCLUDEDIR]: New flag. [-DCMAKE_INSTALL_LIBDIR]: New flag. [-DBUILD_SHARED_LIBS]: Remove flag. <#:phases>['patch-installation]: New phase. [synopsis]: Modify. [description]: Modify. [home-page]: Modify. [license]: Change to expat. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Raghav Gururajan