gnu: Add texlive-generic-xstring.
[jackhill/guix/guix.git] / gnu / packages / sync.scm
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>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
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.
17 ;;;
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.
22 ;;;
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/>.
25
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))
70
71 (define-public nextcloud-client
72 (package
73 (name "nextcloud-client")
74 (version "3.2.0")
75 (source
76 (origin
77 (method git-fetch)
78 (uri
79 (git-reference
80 (url "https://github.com/nextcloud/desktop")
81 (commit (string-append "v" version))))
82 (file-name
83 (git-file-name name version))
84 (sha256
85 (base32 "137h65sn4ixspbblvn0r2ngg8234yk582bppkkr87c3krfp21gx4"))
86 (modules '((guix build utils)
87 (ice-9 ftw)
88 (srfi srfi-1)))
89 (snippet
90 '(begin
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=?
96 (scandir ".")
97 (cons* "." ".." keep)))))
98 (with-directory-excursion "src/gui"
99 (substitute* "CMakeLists.txt"
100 ;; Remove references of deleted 3rdparties.
101 (("[ \t]*\\.\\./3rdparty/qtlockedfile/?.*\\.cpp")
102 "")
103 (("[ \t]*\\.\\./3rdparty/qtsingleapplication/?.*\\.cpp")
104 "")
105 (("[ \t]*\\.\\./3rdparty/kmessagewidget/?.*\\.cpp")
106 "")
107 (("[ \t]*list\\(APPEND 3rdparty_SRC \\.\\./3rdparty/?.*\\)")
108 "")
109 (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/qtlockedfile")
110 "")
111 (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/qtsingleapplication")
112 "")
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.
116 "@kwidgetsaddons@")
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)")))
130 #t))))
131 (build-system qt-build-system)
132 (arguments
133 `(#:configure-flags
134 (list
135 "-DUNIT_TESTING=ON")
136 #:imported-modules
137 ((guix build glib-or-gtk-build-system)
138 ,@%qt-build-system-modules)
139 #:modules
140 (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
141 (guix build qt-build-system)
142 (guix build utils))
143 #:phases
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
160 (lambda _
161 ;; Tests write to $HOME.
162 (setenv "HOME" (getcwd))
163 #t))
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)))))
168 (native-inputs
169 `(("cmocka" ,cmocka)
170 ("dot" ,graphviz)
171 ("doxygen" ,doxygen)
172 ("extra-cmake-modules" ,extra-cmake-modules)
173 ("glib:bin" ,glib "bin")
174 ("perl" ,perl)
175 ("pkg-config" ,pkg-config)
176 ("python" ,python-wrapper)
177 ("qttools-5" ,qttools-5)
178 ("ruby" ,ruby)))
179 (inputs
180 (list appstream
181 desktop-file-utils
182 glib
183 kconfig
184 kcoreaddons
185 kio
186 kjs
187 kwidgetsaddons
188 libcloudproviders
189 libzip
190 openssl
191 qtbase-5
192 qtdeclarative-5
193 qtgraphicaleffects
194 qtkeychain
195 qtquickcontrols2-5
196 qtsolutions
197 qtsvg-5
198 qtwebchannel-5
199 qtwebsockets-5
200 sqlite
201 xdg-utils
202 zlib))
203 (propagated-inputs
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
211 license:gpl2+))))
212
213 (define-public megacmd
214 (package
215 (name "megacmd")
216 (version "1.1.0")
217 (source
218 (origin
219 (method git-fetch)
220 (uri (git-reference
221 (url "https://github.com/meganz/MEGAcmd")
222 (commit (string-append version "_Linux"))
223 (recursive? #t)))
224 (sha256
225 (base32
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.
231 (arguments
232 `(#:tests? #f
233 #:configure-flags '("--with-pcre")))
234 (native-inputs
235 (list autoconf automake libtool))
236 (inputs
237 `(("c-ares" ,c-ares)
238 ("crypto++" ,crypto++)
239 ("curl" ,curl)
240 ("freeimage" ,freeimage)
241 ("gtest" ,googletest)
242 ("openssl" ,openssl)
243 ("pcre" ,pcre)
244 ("readline" ,readline)
245 ("sodium" ,libsodium)
246 ("sqlite3" ,sqlite)
247 ("zlib" ,zlib)))
248 (home-page "https://mega.nz/cmd")
249 (synopsis
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.
255
256 See also: megatools, a third-party alternative more commonly packaged in other
257 distributions.")
258 (license (list license:bsd-2 license:gpl3+))))
259
260 (define-public megatools
261 (package
262 (name "megatools")
263 (version "1.10.3")
264 (source
265 (origin
266 (method url-fetch)
267 (uri (string-append "https://megatools.megous.com/builds/megatools-"
268 version ".tar.gz"))
269 (sha256
270 (base32
271 "1nwbalc54iz6616liyxfalf5yafwx0iv6cmqgvg4kz9khqscmhcd"))))
272 (build-system gnu-build-system)
273 (arguments
274 '(#:phases
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"))
281 #t)))))
282 (native-inputs
283 (list pkg-config
284 ;; For documentation
285 asciidoc))
286 (inputs
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.
292
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.
296
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.
299
300 See also: megacmd, the official tool set by MEGA.")
301 (license license:gpl2)))
302
303 (define-public owncloud-client
304 (package
305 (name "owncloud-client")
306 (version "2.9.0.5150")
307 (source
308 (origin
309 (method url-fetch)
310 (uri (string-append "https://download.owncloud.com/desktop/ownCloud/stable/"
311 version "/source/ownCloud-" version ".tar.xz"))
312 (sha256
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)
319 (arguments
320 `(#:phases
321 (modify-phases %standard-phases
322 (add-after 'unpack 'delete-failing-tests
323 ;; "Could not create autostart folder"
324 (lambda _
325 (substitute* "test/CMakeLists.txt"
326 (("owncloud_add_test\\(Utility\\)" test)
327 (string-append "#" test)))
328 #t))
329 (add-after 'unpack 'dont-embed-store-path
330 (lambda _
331 (substitute* "src/common/utility_unix.cpp"
332 (("QCoreApplication::applicationFilePath\\()") "\"owncloud\""))
333 #t))
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.
338 "-DNO_SHIBBOLETH=1"
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")
344 "/etc"))))
345 (native-inputs
346 `(("cmocka" ,cmocka)
347 ("extra-cmake-modules" ,extra-cmake-modules)
348 ("perl" ,perl)
349 ("pkg-config" ,pkg-config)
350 ("qtlinguist" ,qttools-5)))
351 (inputs
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+)))
361
362 (define-public lsyncd
363 (package
364 (name "lsyncd")
365 (version "2.2.2")
366 (source
367 (origin
368 (method git-fetch)
369 (uri (git-reference
370 (url "https://github.com/axkibe/lsyncd")
371 (commit (string-append "release-" version))))
372 (file-name (git-file-name name version))
373 (sha256
374 (base32 "1q2ixp52r96ckghgmxdbms6xrq8dbziimp8gmgzqfq4lk1v1w80y"))))
375 (build-system cmake-build-system)
376 (arguments
377 `(;; The "tests" target is broken and assumes that tests are run in the
378 ;; root directory.
379 #:tests? #f
380 #:test-target "tests"
381 #:phases
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.
386 (lambda _
387 (substitute* "lsyncd.c"
388 (("execv\\(") "execvp("))
389 (substitute* (list "lsyncd.lua"
390 "default-direct.lua"
391 "default-rsync.lua"
392 "default-rsyncssh.lua")
393 (("(|/usr)/bin/") ""))
394 #t))
395 (replace 'install
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)
403 #t))))))
404 (native-inputs
405 (list lua-5.2))
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+)))
416
417 (define-public usync
418 (let ((revision "1")
419 (commit "09a8059a1adc22666d3ecf7872e22e6846c3ac9e"))
420 (package
421 (name "usync")
422 (version (git-version "0" revision commit))
423 (source
424 (origin
425 (method git-fetch)
426 (uri (git-reference
427 (url "https://github.com/ebzzry/usync")
428 (commit commit)))
429 (file-name (git-file-name name version))
430 (sha256
431 (base32 "16i1q8f0jmfd43rb8d70l2b383vr5ib4kh7iq3yd345q7xjz9c2j"))))
432 (build-system copy-build-system)
433 (inputs
434 (list scsh))
435 (propagated-inputs
436 (list rsync unison))
437 (arguments
438 `(#:install-plan '(("usync" "bin/usync"))
439 #:phases (modify-phases %standard-phases
440 (add-before 'install 'patch-usync-shebang
441 (lambda _
442 (substitute* "usync"
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")
447 (description
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))))
452
453 (define-public casync
454 (let ((commit "99559cd1d8cea69b30022261b5ed0b8021415654")
455 (revision "0"))
456 (package
457 (name "casync")
458 (version (git-version "2" revision commit))
459 (home-page "https://github.com/systemd/casync/")
460 (source (origin
461 (method git-fetch)
462 (uri (git-reference
463 (url home-page)
464 (commit commit)))
465 (sha256
466 (base32
467 "139g82rkwv1kzss6crfmw3p01xnyjzz66b1ckprpbfncxb24047w"))
468 (file-name (string-append name "-" version "-checkout"))))
469 (build-system meson-build-system)
470 (arguments
471 `(#:configure-flags
472 (let ((out (assoc-ref %outputs "out")))
473 (list (string-append "-Dudevrulesdir="
474 out "/lib/udev/rules.d")))))
475 (native-inputs
476 (list pkg-config python python-sphinx rsync)) ;for tests
477 (inputs
478 (list xz ;for liblzma
479 `(,zstd "lib")
480 curl
481 acl
482 libselinux
483 eudev
484 fuse
485 openssl
486 zlib))
487 (synopsis "File synchronization and backup system")
488 (description
489 "casync is a @dfn{content-addressable data synchronizer} that can be used
490 as the basis of a backup system. It is:
491
492 @itemize
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.
499 @end itemize\n")
500 (license license:lgpl2.1+))))
501
502 (define-public rclone
503 (package
504 (name "rclone")
505 (version "1.52.3")
506 (source
507 (origin
508 (method url-fetch)
509 (uri (string-append "https://github.com/rclone/rclone/releases/download/"
510 "v" version "/rclone-v" version ".tar.gz"))
511 (sha256
512 (base32 "1pdhsxzc5ch2brfylghc602h9ba3x5dshxm3vcaldrgfac0rx0zl"))))
513 ;; FIXME: Rclone bundles some libraries Guix already provides. Need to
514 ;; un-bundle them.
515 (build-system go-build-system)
516 (arguments
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.
522
523 Features include:
524 @itemize
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)
535 @end itemize")
536 (home-page "https://rclone.org/")
537 (license license:expat)))