1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
3 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018, 2021 Ludovic Courtès <ludo@gnu.org>
6 ;;; Copyright © 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
7 ;;; Copyright © 2019 Clément Lassieur <clement@lassieur.org>
8 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
9 ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages sync)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system copy)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system go)
32 #:use-module (guix build-system meson)
33 #:use-module (guix build-system qt)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix packages)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages acl)
39 #:use-module (gnu packages adns)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages crypto)
44 #:use-module (gnu packages curl)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages freedesktop)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages golang)
50 #:use-module (gnu packages graphviz)
51 #:use-module (gnu packages image)
52 #:use-module (gnu packages kde-frameworks)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages lua)
55 #:use-module (gnu packages ocaml)
56 #:use-module (gnu packages pcre)
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-xyz)
61 #:use-module (gnu packages qt)
62 #:use-module (gnu packages readline)
63 #:use-module (gnu packages rsync)
64 #:use-module (gnu packages ruby)
65 #:use-module (gnu packages selinux)
66 #:use-module (gnu packages shells)
67 #:use-module (gnu packages sphinx)
68 #:use-module (gnu packages sqlite)
69 #:use-module (gnu packages tls))
71 (define-public nextcloud-client
73 (name "nextcloud-client")
80 (url "https://github.com/nextcloud/desktop")
81 (commit (string-append "v" version))))
83 (git-file-name name version))
85 (base32 "15ymk3gvfmgwzmqbhlw7jjy9y65ib3391h1dlmpll65iaj2miajk"))
86 (modules '((guix build utils)
91 ;; Not available in Guix.
92 (let* ((keep '("QProgressIndicator" "qtokenizer")))
93 (with-directory-excursion "src/3rdparty"
94 (for-each delete-file-recursively
95 (lset-difference string=?
97 (cons* "." ".." keep)))))
98 (with-directory-excursion "src/gui"
99 (substitute* "CMakeLists.txt"
100 ;; Remove references of deleted 3rdparties.
101 (("[ \t]*\\.\\./3rdparty/qtlockedfile/?.*\\.cpp")
103 (("[ \t]*\\.\\./3rdparty/qtsingleapplication/?.*\\.cpp")
105 (("[ \t]*\\.\\./3rdparty/kmessagewidget/?.*\\.cpp")
107 (("[ \t]*list\\(APPEND 3rdparty_SRC \\.\\./3rdparty/?.*\\)")
109 (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/qtlockedfile")
111 (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/qtsingleapplication")
113 (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/kmessagewidget")
114 ;; For this, we rely on build inputs, so let's just replace
115 ;; them by an autoconf-style variable.
117 ;; Expand libraries, that used to be statically linked, but
118 ;; no longer are post-vendoring.
119 (("\\$\\{synclib_NAME\\}")
120 (string-append "${synclib_NAME} "
121 "QtSolutions_LockedFile "
122 "QtSolutions_SingleApplication "
123 "KF5WidgetsAddons")))
124 ;; Fix compatibility with QtSingleApplication from QtSolutions.
125 (substitute* '("application.h" "application.cpp")
126 (("SharedTools::QtSingleApplication")
127 "QtSingleApplication")
128 (("slotParseMessage\\(const QString &(msg)?.*\\)")
129 "slotParseMessage(const QString &msg)")))
131 (build-system qt-build-system)
136 ;; Upstream Bug: https://github.com/nextcloud/desktop/issues/2885
137 "-DNO_SHIBBOLETH=ON")
139 ((guix build glib-or-gtk-build-system)
140 ,@%qt-build-system-modules)
142 (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
143 (guix build qt-build-system)
146 (modify-phases %standard-phases
147 (add-after 'unpack 'patch-cmake
148 (lambda* (#:key inputs #:allow-other-keys)
149 ;; Patch install directory for dbus service files.
150 (substitute* "shell_integration/libcloudproviders/CMakeLists.txt"
151 (("PKGCONFIG_GETVAR\\(.+ _install_dir\\)")
152 (string-append "set(_install_dir \"${CMAKE_INSTALL_PREFIX}"
153 "/share/dbus-1/services\")")))
154 (substitute* "shell_integration/dolphin/CMakeLists.txt"
155 ;; Make sure, that Qt modules are installed under $prefix.
156 (("ON CACHE") "OFF CACHE"))
157 (substitute* "src/gui/CMakeLists.txt"
158 (("@kwidgetsaddons@")
159 (string-append (assoc-ref inputs "kwidgetsaddons")
160 "/include/KF5/KWidgetsAddons/")))
162 (add-before 'check 'pre-check
164 ;; Tests write to $HOME.
165 (setenv "HOME" (getcwd))
167 (add-after 'install 'glib-or-gtk-compile-schemas
168 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
169 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
170 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
175 ("extra-cmake-modules" ,extra-cmake-modules)
176 ("glib:bin" ,glib "bin")
178 ("pkg-config" ,pkg-config)
179 ("python" ,python-wrapper)
183 `(("appstream" ,appstream)
184 ("desktop-file-utils" ,desktop-file-utils)
187 ("kcoreaddons" ,kcoreaddons)
190 ("kwidgetsaddons" ,kwidgetsaddons)
191 ("libcloudproviders" ,libcloudproviders)
194 ("python-nautilus" ,python-nautilus)
196 ("qtdeclarative" ,qtdeclarative)
197 ("qtgraphicaleffects" ,qtgraphicaleffects)
198 ("qtkeychain" ,qtkeychain)
199 ("qtquickcontrols2" ,qtquickcontrols2)
200 ("qtsolutions" ,qtsolutions)
202 ("qtwebchannel" ,qtwebchannel)
203 ("qtwebsockets" ,qtwebsockets)
204 ("qtwebkit" ,qtwebkit)
206 ("xdg-utils" ,xdg-utils)
209 `(("qtwebengine" ,qtwebengine)))
210 (synopsis "Desktop sync client for Nextcloud")
211 (description "Nextcloud-Desktop is a tool to synchronize files from
212 Nextcloud Server with your computer.")
213 (home-page "https://nextcloud.com")
214 (license (list license:expat ; QProgressIndicator
215 license:lgpl2.1+ ; qtokenizer
218 (define-public megacmd
226 (url "https://github.com/meganz/MEGAcmd")
227 (commit (string-append version "_Linux"))
231 "004j8m3xs6slx03g2g6wzr97myl2v3zc09wxnfar5c62a625pd53"))
232 (file-name (git-file-name name version))))
233 (build-system gnu-build-system)
234 ;; XXX: Disabling tests because they depend on libgtest.la from googletest,
235 ;; which is not installed for unclear reasons.
238 #:configure-flags '("--with-pcre")))
240 `(("autoconf" ,autoconf)
241 ("automake" ,automake)
242 ("libtool" ,libtool)))
245 ("crypto++" ,crypto++)
247 ("freeimage" ,freeimage)
248 ("gtest" ,googletest)
251 ("readline" ,readline)
252 ("sodium" ,libsodium)
255 (home-page "https://mega.nz/cmd")
257 "Command Line Interactive and Scriptable Application to access mega.nz")
258 (description "MEGAcmd provides non UI access to MEGA services. It intends
259 to offer all the functionality of a MEGA account via commands. It features
260 synchronization, backup of local folders into a MEGA account and a
261 webdav/streaming server.
263 See also: megatools, a third-party alternative more commonly packaged in other
265 (license (list license:bsd-2 license:gpl3+))))
267 (define-public megatools
274 (uri (string-append "https://megatools.megous.com/builds/megatools-"
278 "1nwbalc54iz6616liyxfalf5yafwx0iv6cmqgvg4kz9khqscmhcd"))))
279 (build-system gnu-build-system)
282 (modify-phases %standard-phases
283 (add-after 'install 'install-completions
284 (lambda* (#:key outputs #:allow-other-keys)
285 (install-file "contrib/bash-completion/megatools"
286 (string-append (assoc-ref outputs "out")
287 "/etc/bash_completion.d"))
290 `(("pkg-config" ,pkg-config)
292 ("asciidoc" ,asciidoc)))
296 ("openssl" ,openssl)))
297 (home-page "https://megatools.megous.com/")
298 (synopsis "Command line client application for mega.nz")
299 (description "Megatools is a collection of programs for accessing the mega.nz service
300 from the command line.
302 Megatools allow you to copy individual files as well as entire directory trees to and from
303 the cloud. You can also perform streaming downloads for example to preview videos and
304 audio files, without needing to download the entire file first.
306 Megatools are robust and optimized for fast operation - as fast as Mega servers allow.
307 Memory requirements and CPU utilization are kept at minimum.
309 See also: megacmd, the official tool set by MEGA.")
310 (license license:gpl2)))
312 (define-public owncloud-client
314 (name "owncloud-client")
315 (version "2.7.6.3261")
319 (uri (string-append "https://download.owncloud.com/desktop/ownCloud/stable/"
320 version "/source/ownCloud-" version ".tar.xz"))
322 (base32 "19jjlhbzhy4v5h1wj5a87ismxq2p7avb2bb4lfbh2rvl01r432vy"))
323 (patches (search-patches "owncloud-disable-updatecheck.patch"))))
324 ;; TODO: unbundle qprogessindicator, qlockedfile, qtokenizer and
325 ;; qtsingleapplication which have not yet been packaged, but all are
326 ;; explicitly used from the 3rdparty folder during build.
327 (build-system cmake-build-system)
330 (modify-phases %standard-phases
331 (add-after 'unpack 'delete-failing-tests
332 ;; "Could not create autostart folder"
334 (substitute* "test/CMakeLists.txt"
335 (("owncloud_add_test\\(Utility\\)" test)
336 (string-append "#" test)))
338 (add-after 'unpack 'dont-embed-store-path
340 (substitute* "src/common/utility_unix.cpp"
341 (("QCoreApplication::applicationFilePath\\()") "\"owncloud\""))
343 (delete 'patch-dot-desktop-files))
344 #:configure-flags '("-DUNIT_TESTING=ON"
345 ;; build without qtwebkit, which causes the
346 ;; package to FTBFS while looking for QWebView.
347 "-DNO_SHIBBOLETH=1")))
350 ("extra-cmake-modules" ,extra-cmake-modules)
352 ("pkg-config" ,pkg-config)
353 ("qtlinguist" ,qttools)))
356 ("qtkeychain" ,qtkeychain)
359 (home-page "https://owncloud.org")
360 (synopsis "Folder synchronization with an ownCloud server")
361 (description "The ownCloudSync system lets you always have your latest
362 files wherever you are. Just specify one or more folders on the local machine
363 to and a server to synchronize to. You can configure more computers to
364 synchronize to the same server and any change to the files on one computer will
365 silently and reliably flow across to every other.")
366 (license license:gpl2+)))
368 (define-public qsyncthingtray
370 (name "qsyncthingtray")
376 (url "https://github.com/sieren/QSyncthingTray")
378 (file-name (git-file-name name version))
381 "1n9g4j7qznvg9zl6x163pi9f7wsc3x6q76i33psnm7x2v1i22x5w"))))
382 (build-system cmake-build-system)
384 `(#:configure-flags '("-DQST_BUILD_WEBKIT=1")
386 (modify-phases %standard-phases
387 ;; The program is meant to be run from the git repo or source tarball.
389 (lambda* (#:key outputs #:allow-other-keys)
390 (let* ((out (assoc-ref outputs "out"))
391 (bin (string-append out "/bin")))
392 (install-file "QSyncthingTray" bin)
393 (mkdir-p (string-append out "/share/pixmaps"))
394 (copy-file "../source/resources/images/Icon1024.png"
396 out "/share/pixmaps/QSyncthingTray.png"))
398 #:tests? #f)) ; no test target
401 ("qtwebkit" ,qtwebkit)))
402 (home-page "https://github.com/sieren/QSyncthingTray")
403 (synopsis "Traybar Application for Syncthing")
405 "A traybar application for syncthing.
407 @item Shows number of connections at a glance.
408 @item Traffic statistics about incoming, outgoing and total throughput.
409 @item Launches Syncthing and Syncthing-iNotifier if specified.
410 @item Quickly pause Syncthing with one click.
411 @item Last Synced Files - Quickly see the recently synchronised files and open
413 @item Quick Access to all shared folders.
414 @item Presents Syncthing UI in a separate view instead of using the browser.
415 @item Supports authenticated HTTPS connections.
416 @item Uses System Notifications about current connection status.
417 @item Toggle for monochrome icon.
419 (license license:lgpl3+)))
421 (define-public lsyncd
429 (url "https://github.com/axkibe/lsyncd")
430 (commit (string-append "release-" version))))
431 (file-name (git-file-name name version))
433 (base32 "1q2ixp52r96ckghgmxdbms6xrq8dbziimp8gmgzqfq4lk1v1w80y"))))
434 (build-system cmake-build-system)
436 `(;; The "tests" target is broken and assumes that tests are run in the
439 #:test-target "tests"
441 (modify-phases %standard-phases
442 (add-after 'unpack 'search-$PATH-for-binaries
443 ;; lsyncd requires and hard-codes absolute file names to binaries.
444 ;; Make it fall back to searching $PATH for relative file names.
446 (substitute* "lsyncd.c"
447 (("execv\\(") "execvp("))
448 (substitute* (list "lsyncd.lua"
451 "default-rsyncssh.lua")
452 (("(|/usr)/bin/") ""))
455 ;; No install target.
456 (lambda* (#:key outputs #:allow-other-keys)
457 (let* ((out (assoc-ref outputs "out"))
458 (bin (string-append out "/bin"))
459 (man (string-append out "/share/man/man1")))
460 (install-file "lsyncd" bin)
461 (install-file "../source/doc/manpage/lsyncd.1" man)
465 (home-page "https://github.com/axkibe/lsyncd")
466 (synopsis "Synchronize local directories with remote targets")
467 (description "Lsyncd watches a local directory trees event monitor
468 interface (inotify or fsevents). It aggregates and combines events for a few
469 seconds and then spawns one (or more) process(es) to synchronize the changes.
470 By default this is rsync, which must be installed on all source and target
471 machines. Lsyncd is thus a light-weight live mirror solution that is
472 comparatively easy to install not requiring new file systems or block devices
473 and does not hamper local file system performance.")
474 (license license:gpl2+)))
478 (commit "09a8059a1adc22666d3ecf7872e22e6846c3ac9e"))
481 (version (git-version "0" revision commit))
486 (url "https://github.com/ebzzry/usync")
488 (file-name (git-file-name name version))
490 (base32 "16i1q8f0jmfd43rb8d70l2b383vr5ib4kh7iq3yd345q7xjz9c2j"))))
491 (build-system copy-build-system)
498 `(#:install-plan '(("usync" "bin/usync"))
499 #:phases (modify-phases %standard-phases
500 (add-before 'install 'patch-usync-shebang
503 (("/usr/bin/env scsh")
504 (which "scsh"))))))))
505 (home-page "https://github.com/ebzzry/usync")
506 (synopsis "Command line site-to-site synchronization tool")
508 "@command{usync} is a simple site-to-site synchronization program
509 written in @command{scsh}. It makes use of @command{unison} and
510 @command{rsync} for bi- and uni-directional synchronizations.")
511 (license license:expat))))
513 (define-public casync
517 (home-page "https://github.com/systemd/casync/")
522 (commit (string-append "v" version))))
525 "0znkp3fcksrykcsv06y2mjvf2lbwmin25snmvfa8i5qfm3f4rm88"))
526 (file-name (string-append name "-" version "-checkout"))
527 (patches (search-patches "casync-renameat2-declaration.patch"))))
528 (build-system meson-build-system)
530 `(("pkg-config" ,pkg-config)
531 ("python-sphinx" ,python-sphinx)
532 ("rsync" ,rsync))) ;for tests
534 `(("xz" ,xz) ;for liblzma
538 ("libselinux" ,libselinux)
542 (synopsis "File synchronization and backup system")
544 "casync is a @dfn{content-addressable data synchronizer} that can be used
545 as the basis of a backup system. It is:
548 @item A combination of the rsync algorithm and content-addressable storage;
549 @item An efficient way to store and retrieve multiple related versions of
550 large file systems or directory trees;
551 @item An efficient way to deliver and update OS, VM, IoT and container images
552 over the Internet in an HTTP and CDN friendly way;
553 @item An efficient backup system.
555 (license license:lgpl2.1+)))
557 (define-public rclone
564 (uri (string-append "https://github.com/rclone/rclone/releases/download/"
565 "v" version "/rclone-v" version ".tar.gz"))
567 (base32 "1pdhsxzc5ch2brfylghc602h9ba3x5dshxm3vcaldrgfac0rx0zl"))))
568 ;; FIXME: Rclone bundles some libraries Guix already provides. Need to
570 (build-system go-build-system)
572 '(#:import-path "github.com/rclone/rclone"
573 #:install-source? #f))
574 (synopsis "@code{rsync} for cloud storage")
575 (description "@code{Rclone} is a command line program to sync files and
576 directories to and from different cloud storage providers.
580 @item MD5/SHA1 hashes checked at all times for file integrity
581 @item Timestamps preserved on files
582 @item Partial syncs supported on a whole file basis
583 @item Copy mode to just copy new/changed files
584 @item Sync (one way) mode to make a directory identical
585 @item Check mode to check for file hash equality
586 @item Can sync to and from network, e.g., two different cloud accounts
587 @item Optional encryption (Crypt)
588 @item Optional cache (Cache)
589 @item Optional FUSE mount (rclone mount)
591 (home-page "https://rclone.org/")
592 (license license:expat)))