gnu: All snippets report errors using exceptions, else return #t.
[jackhill/guix/guix.git] / gnu / packages / sync.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
3 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages sync)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix build-system cmake)
24 #:use-module (guix download)
25 #:use-module (guix packages)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages check)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages linux)
31 #:use-module (gnu packages lua)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages qt)
35 #:use-module (gnu packages tls))
36
37 (define-public owncloud-client
38 (package
39 (name "owncloud-client")
40 (version "2.3.4")
41 (source
42 (origin
43 (method url-fetch)
44 (uri (string-append "https://download.owncloud.com/desktop/stable/"
45 "owncloudclient-" version ".tar.xz"))
46 (sha256
47 (base32 "1fpi1mlp2b8sx2993b4mava5c6qw794dmlayih430299z1l9wh49"))
48 (patches (search-patches "owncloud-disable-updatecheck.patch"))
49 (modules '((guix build utils)))
50 (snippet
51 '(begin
52 ;; only allows bundled libcrashreporter-qt
53 (delete-file-recursively "src/3rdparty/libcrashreporter-qt")
54 ;; we already package qtkeychain and sqlite
55 (delete-file-recursively "src/3rdparty/qtkeychain")
56 (delete-file-recursively "src/3rdparty/sqlite3")
57 ;; qjson is packaged, qprogessindicator, qlockedfile, qtokenizer and
58 ;; qtsingleapplication have not yet been packaged, but all are
59 ;; explicitly used from the 3rdparty folder during build.
60 ;; We can also remove the macgoodies folder
61 (delete-file-recursively "src/3rdparty/qtmacgoodies")
62 #t))))
63 (build-system cmake-build-system)
64 (arguments
65 `(#:phases
66 (modify-phases %standard-phases
67 (add-after 'unpack 'change-rpath-dirs
68 (lambda _
69 (substitute* '("src/libsync/CMakeLists.txt"
70 "csync/src/CMakeLists.txt")
71 ;; We store the libs in out/lib and not /usr/lib/appname, so we
72 ;; need the executable to point to the libraries in /lib and not
73 ;; in /lib/appname.
74 (("\\/\\$\\{APPLICATION_EXECUTABLE\\}") ""))
75 (substitute* '("src/cmd/CMakeLists.txt"
76 "src/crashreporter/CMakeLists.txt"
77 "src/gui/CMakeLists.txt")
78 ;; This has the same issue as the substitution above.
79 (("\\/\\$\\{APPLICATION_EXECUTABLE\\}\\\"") "\""))
80 #t))
81 (add-after 'unpack 'delete-failing-tests
82 ;; "Could not create autostart folder"
83 (lambda _
84 (substitute* "test/CMakeLists.txt"
85 (("owncloud_add_test\\(Utility \"\"\\)" test)
86 (string-append "#" test)))
87 #t)))
88 #:configure-flags '("-DUNIT_TESTING=ON")))
89 (native-inputs
90 `(("cmocka" ,cmocka)
91 ("perl" ,perl)
92 ("pkg-config" ,pkg-config)
93 ("qtlinguist" ,qttools)))
94 (inputs
95 `(("inotify-tools" ,inotify-tools)
96 ("openssl" ,openssl)
97 ("qtbase" ,qtbase)
98 ("qtkeychain" ,qtkeychain)
99 ("qtwebkit" ,qtwebkit)
100 ("sqlite" ,sqlite)
101 ("zlib" ,zlib)))
102 (home-page "https://owncloud.org")
103 (synopsis "Folder synchronization with an ownCloud server")
104 (description "The ownCloudSync system lets you always have your latest
105 files wherever you are. Just specify one or more folders on the local machine
106 to and a server to synchronize to. You can configure more computers to
107 synchronize to the same server and any change to the files on one computer will
108 silently and reliably flow across to every other.")
109 (license license:gpl2+)))
110
111 (define-public qsyncthingtray
112 (package
113 (name "qsyncthingtray")
114 (version "0.5.8")
115 (source
116 (origin
117 (method url-fetch)
118 (uri (string-append
119 "https://github.com/sieren/QSyncthingTray/archive/"
120 version ".tar.gz"))
121 (file-name (string-append name "-" version ".tar.gz"))
122 (sha256
123 (base32
124 "1024778ml7q62ziqm4d22z5sc1715l34846pwfyzfpcyl32qlhpz"))))
125 (build-system cmake-build-system)
126 (arguments
127 `(#:configure-flags '("-DQST_BUILD_WEBKIT=1")
128 #:phases
129 (modify-phases %standard-phases
130 ;; The program is meant to be run from the git repo or source tarball.
131 (replace 'install
132 (lambda* (#:key outputs #:allow-other-keys)
133 (let* ((out (assoc-ref outputs "out"))
134 (bin (string-append out "/bin")))
135 (install-file "QSyncthingTray" bin)
136 (install-file (string-append
137 "../QSyncthingTray-"
138 ,(package-version qsyncthingtray)
139 "/resources/images/Icon1024.png")
140 (string-append
141 out "/share/pixmaps/QSyncthingTray.png"))
142 #t))))
143 #:tests? #f)) ; no test target
144 (inputs
145 `(("qtbase" ,qtbase)
146 ("qtwebkit" ,qtwebkit)))
147 (home-page "https://github.com/sieren/QSyncthingTray")
148 (synopsis "Traybar Application for Syncthing")
149 (description
150 "A traybar application for syncthing.
151 @enumerate
152 @item Shows number of connections at a glance.
153 @item Traffic statistics about incoming, outgoing and total throughput.
154 @item Launches Syncthing and Syncthing-iNotifier if specified.
155 @item Quickly pause Syncthing with one click.
156 @item Last Synced Files - Quickly see the recently synchronised files and open
157 their folder.
158 @item Quick Access to all shared folders.
159 @item Presents Syncthing UI in a separate view instead of using the browser.
160 @item Supports authenticated HTTPS connections.
161 @item Uses System Notifications about current connection status.
162 @item Toggle for monochrome icon.
163 @end enumerate\n")
164 (license license:lgpl3+)))
165
166 (define-public lsyncd
167 (package
168 (name "lsyncd")
169 (version "2.2.2")
170 (source
171 (origin
172 (method url-fetch)
173 (uri (string-append "https://github.com/axkibe/lsyncd/archive/release-"
174 version ".tar.gz"))
175 (file-name (string-append name "-" version ".tar.gz"))
176 (sha256
177 (base32
178 "02g054qv8rnbxywd4f0gnd13lrlns9175d3ciqnyslhs1zs15nqb"))))
179 (build-system cmake-build-system)
180 (arguments
181 `(;; The "tests" target is broken and assumes that tests are run in the
182 ;; root directory.
183 #:tests? #f
184 #:test-target "tests"
185 #:phases
186 (modify-phases %standard-phases
187 ;; No install target.
188 (replace 'install
189 (lambda* (#:key outputs #:allow-other-keys)
190 (let* ((out (assoc-ref outputs "out"))
191 (bin (string-append out "/bin"))
192 (man (string-append out "/share/man/man1")))
193 (install-file "lsyncd" bin)
194 (install-file (string-append "../lsyncd-release-"
195 ,version
196 "/doc/manpage/lsyncd.1")
197 man)
198 #t))))))
199 (native-inputs
200 `(("lua" ,lua-5.2)))
201 (home-page "https://github.com/axkibe/lsyncd")
202 (synopsis "Synchronize local directories with remote targets")
203 (description "Lsyncd watches a local directory trees event monitor
204 interface (inotify or fsevents). It aggregates and combines events for a few
205 seconds and then spawns one (or more) process(es) to synchronize the changes.
206 By default this is rsync, which must be installed on all source and target
207 machines. Lsyncd is thus a light-weight live mirror solution that is
208 comparatively easy to install not requiring new file systems or block devices
209 and does not hamper local file system performance.")
210 (license license:gpl2+)))