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 "137h65sn4ixspbblvn0r2ngg8234yk582bppkkr87c3krfp21gx4"))
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)
137 ((guix build glib-or-gtk-build-system)
138 ,@%qt-build-system-modules)
140 (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
141 (guix build qt-build-system)
144 (modify-phases %standard-phases
145 (add-after 'unpack 'patch-cmake
146 (lambda* (#:key inputs #:allow-other-keys)
147 ;; Patch install directory for dbus service files.
148 (substitute* "shell_integration/libcloudproviders/CMakeLists.txt"
149 (("PKGCONFIG_GETVAR\\(.+ _install_dir\\)")
150 (string-append "set(_install_dir \"${CMAKE_INSTALL_PREFIX}"
151 "/share/dbus-1/services\")")))
152 (substitute* "shell_integration/dolphin/CMakeLists.txt"
153 ;; Make sure, that Qt modules are installed under $prefix.
154 (("ON CACHE") "OFF CACHE"))
155 (substitute* "src/gui/CMakeLists.txt"
156 (("@kwidgetsaddons@")
157 (search-input-directory inputs
158 "/include/KF5/KWidgetsAddons/")))))
159 (add-before 'check 'pre-check
161 ;; Tests write to $HOME.
162 (setenv "HOME" (getcwd))
164 (add-after 'install 'glib-or-gtk-compile-schemas
165 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
166 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
167 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
172 ("extra-cmake-modules" ,extra-cmake-modules)
173 ("glib:bin" ,glib "bin")
175 ("pkg-config" ,pkg-config)
176 ("python" ,python-wrapper)
177 ("qttools-5" ,qttools-5)
204 (list qtwebengine-5))
205 (synopsis "Desktop sync client for Nextcloud")
206 (description "Nextcloud-Desktop is a tool to synchronize files from
207 Nextcloud Server with your computer.")
208 (home-page "https://nextcloud.com")
209 (license (list license:expat ; QProgressIndicator
210 license:lgpl2.1+ ; qtokenizer
213 (define-public megacmd
221 (url "https://github.com/meganz/MEGAcmd")
222 (commit (string-append version "_Linux"))
226 "004j8m3xs6slx03g2g6wzr97myl2v3zc09wxnfar5c62a625pd53"))
227 (file-name (git-file-name name version))))
228 (build-system gnu-build-system)
229 ;; XXX: Disabling tests because they depend on libgtest.la from googletest,
230 ;; which is not installed for unclear reasons.
233 #:configure-flags '("--with-pcre")))
235 (list autoconf automake libtool))
238 ("crypto++" ,crypto++)
240 ("freeimage" ,freeimage)
241 ("gtest" ,googletest)
244 ("readline" ,readline)
245 ("sodium" ,libsodium)
248 (home-page "https://mega.nz/cmd")
250 "Command Line Interactive and Scriptable Application to access mega.nz")
251 (description "MEGAcmd provides non UI access to MEGA services. It intends
252 to offer all the functionality of a MEGA account via commands. It features
253 synchronization, backup of local folders into a MEGA account and a
254 webdav/streaming server.
256 See also: megatools, a third-party alternative more commonly packaged in other
258 (license (list license:bsd-2 license:gpl3+))))
260 (define-public megatools
267 (uri (string-append "https://megatools.megous.com/builds/megatools-"
271 "1nwbalc54iz6616liyxfalf5yafwx0iv6cmqgvg4kz9khqscmhcd"))))
272 (build-system gnu-build-system)
275 (modify-phases %standard-phases
276 (add-after 'install 'install-completions
277 (lambda* (#:key outputs #:allow-other-keys)
278 (install-file "contrib/bash-completion/megatools"
279 (string-append (assoc-ref outputs "out")
280 "/etc/bash_completion.d"))
287 (list curl glib openssl))
288 (home-page "https://megatools.megous.com/")
289 (synopsis "Command line client application for mega.nz")
290 (description "Megatools is a collection of programs for accessing the mega.nz service
291 from the command line.
293 Megatools allow you to copy individual files as well as entire directory trees to and from
294 the cloud. You can also perform streaming downloads for example to preview videos and
295 audio files, without needing to download the entire file first.
297 Megatools are robust and optimized for fast operation - as fast as Mega servers allow.
298 Memory requirements and CPU utilization are kept at minimum.
300 See also: megacmd, the official tool set by MEGA.")
301 (license license:gpl2)))
303 (define-public owncloud-client
305 (name "owncloud-client")
306 (version "2.9.0.5150")
310 (uri (string-append "https://download.owncloud.com/desktop/ownCloud/stable/"
311 version "/source/ownCloud-" version ".tar.xz"))
313 (base32 "0nf68x840p30yng4fh1nlyiqg40z0rkcv0lskpz8dd4pj1iw5jjs"))
314 (patches (search-patches "owncloud-disable-updatecheck.patch"))))
315 ;; TODO: unbundle qprogessindicator, qlockedfile, qtokenizer and
316 ;; qtsingleapplication which have not yet been packaged, but all are
317 ;; explicitly used from the 3rdparty folder during build.
318 (build-system cmake-build-system)
321 (modify-phases %standard-phases
322 (add-after 'unpack 'delete-failing-tests
323 ;; "Could not create autostart folder"
325 (substitute* "test/CMakeLists.txt"
326 (("owncloud_add_test\\(Utility\\)" test)
327 (string-append "#" test)))
329 (add-after 'unpack 'dont-embed-store-path
331 (substitute* "src/common/utility_unix.cpp"
332 (("QCoreApplication::applicationFilePath\\()") "\"owncloud\""))
334 (delete 'patch-dot-desktop-files))
335 #:configure-flags `("-DUNIT_TESTING=ON"
336 ;; build without qtwebkit, which causes the
337 ;; package to FTBFS while looking for QWebView.
339 ;; Fix sync-exclude.list problem, see
340 ;; <https://github.com/owncloud/client/issues/8373>
341 ;; <https://issues.guix.gnu.org/47672>
342 ,(string-append "-DSYSCONF_INSTALL_DIR="
343 (assoc-ref %outputs "out")
347 ("extra-cmake-modules" ,extra-cmake-modules)
349 ("pkg-config" ,pkg-config)
350 ("qtlinguist" ,qttools-5)))
352 (list qtbase-5 qtkeychain sqlite zlib))
353 (home-page "https://owncloud.org")
354 (synopsis "Folder synchronization with an ownCloud server")
355 (description "The ownCloudSync system lets you always have your latest
356 files wherever you are. Just specify one or more folders on the local machine
357 to and a server to synchronize to. You can configure more computers to
358 synchronize to the same server and any change to the files on one computer will
359 silently and reliably flow across to every other.")
360 (license license:gpl2+)))
362 (define-public lsyncd
370 (url "https://github.com/axkibe/lsyncd")
371 (commit (string-append "release-" version))))
372 (file-name (git-file-name name version))
374 (base32 "1q2ixp52r96ckghgmxdbms6xrq8dbziimp8gmgzqfq4lk1v1w80y"))))
375 (build-system cmake-build-system)
377 `(;; The "tests" target is broken and assumes that tests are run in the
380 #:test-target "tests"
382 (modify-phases %standard-phases
383 (add-after 'unpack 'search-$PATH-for-binaries
384 ;; lsyncd requires and hard-codes absolute file names to binaries.
385 ;; Make it fall back to searching $PATH for relative file names.
387 (substitute* "lsyncd.c"
388 (("execv\\(") "execvp("))
389 (substitute* (list "lsyncd.lua"
392 "default-rsyncssh.lua")
393 (("(|/usr)/bin/") ""))
396 ;; No install target.
397 (lambda* (#:key outputs #:allow-other-keys)
398 (let* ((out (assoc-ref outputs "out"))
399 (bin (string-append out "/bin"))
400 (man (string-append out "/share/man/man1")))
401 (install-file "lsyncd" bin)
402 (install-file "../source/doc/manpage/lsyncd.1" man)
406 (home-page "https://github.com/axkibe/lsyncd")
407 (synopsis "Synchronize local directories with remote targets")
408 (description "Lsyncd watches a local directory trees event monitor
409 interface (inotify or fsevents). It aggregates and combines events for a few
410 seconds and then spawns one (or more) process(es) to synchronize the changes.
411 By default this is rsync, which must be installed on all source and target
412 machines. Lsyncd is thus a light-weight live mirror solution that is
413 comparatively easy to install not requiring new file systems or block devices
414 and does not hamper local file system performance.")
415 (license license:gpl2+)))
419 (commit "09a8059a1adc22666d3ecf7872e22e6846c3ac9e"))
422 (version (git-version "0" revision commit))
427 (url "https://github.com/ebzzry/usync")
429 (file-name (git-file-name name version))
431 (base32 "16i1q8f0jmfd43rb8d70l2b383vr5ib4kh7iq3yd345q7xjz9c2j"))))
432 (build-system copy-build-system)
438 `(#:install-plan '(("usync" "bin/usync"))
439 #:phases (modify-phases %standard-phases
440 (add-before 'install 'patch-usync-shebang
443 (("/usr/bin/env scsh")
444 (which "scsh"))))))))
445 (home-page "https://github.com/ebzzry/usync")
446 (synopsis "Command line site-to-site synchronization tool")
448 "@command{usync} is a simple site-to-site synchronization program
449 written in @command{scsh}. It makes use of @command{unison} and
450 @command{rsync} for bi- and uni-directional synchronizations.")
451 (license license:expat))))
453 (define-public casync
454 (let ((commit "99559cd1d8cea69b30022261b5ed0b8021415654")
458 (version (git-version "2" revision commit))
459 (home-page "https://github.com/systemd/casync/")
467 "139g82rkwv1kzss6crfmw3p01xnyjzz66b1ckprpbfncxb24047w"))
468 (file-name (string-append name "-" version "-checkout"))))
469 (build-system meson-build-system)
472 (let ((out (assoc-ref %outputs "out")))
473 (list (string-append "-Dudevrulesdir="
474 out "/lib/udev/rules.d")))))
476 (list pkg-config python python-sphinx rsync)) ;for tests
478 (list xz ;for liblzma
487 (synopsis "File synchronization and backup system")
489 "casync is a @dfn{content-addressable data synchronizer} that can be used
490 as the basis of a backup system. It is:
493 @item A combination of the rsync algorithm and content-addressable storage;
494 @item An efficient way to store and retrieve multiple related versions of
495 large file systems or directory trees;
496 @item An efficient way to deliver and update OS, VM, IoT and container images
497 over the Internet in an HTTP and CDN friendly way;
498 @item An efficient backup system.
500 (license license:lgpl2.1+))))
502 (define-public rclone
509 (uri (string-append "https://github.com/rclone/rclone/releases/download/"
510 "v" version "/rclone-v" version ".tar.gz"))
512 (base32 "1pdhsxzc5ch2brfylghc602h9ba3x5dshxm3vcaldrgfac0rx0zl"))))
513 ;; FIXME: Rclone bundles some libraries Guix already provides. Need to
515 (build-system go-build-system)
517 '(#:import-path "github.com/rclone/rclone"
518 #:install-source? #f))
519 (synopsis "@code{rsync} for cloud storage")
520 (description "@code{Rclone} is a command line program to sync files and
521 directories to and from different cloud storage providers.
525 @item MD5/SHA1 hashes checked at all times for file integrity
526 @item Timestamps preserved on files
527 @item Partial syncs supported on a whole file basis
528 @item Copy mode to just copy new/changed files
529 @item Sync (one way) mode to make a directory identical
530 @item Check mode to check for file hash equality
531 @item Can sync to and from network, e.g., two different cloud accounts
532 @item Optional encryption (Crypt)
533 @item Optional cache (Cache)
534 @item Optional FUSE mount (rclone mount)
536 (home-page "https://rclone.org/")
537 (license license:expat)))