summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/packages/syncthing.scm88
1 files changed, 88 insertions, 0 deletions
diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index ad5f055bbc6..3b5aefe67fa 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -136,6 +136,94 @@ Protocol.")
136 (tunable? . #t))) 136 (tunable? . #t)))
137 (license mpl2.0))) 137 (license mpl2.0)))
138 138
139(define-public syncthing-gtk
140 ;; The commit used below corresponds to the latest commit of the Python 3
141 ;; fork maintained by Debian. Upstream hasn't bothered porting to Python 3
142 ;; (see: https://github.com/kozec/syncthing-gtk/issues/487).
143 (let ((revision "2")
144 (commit "1e84f332e413ba123bcd443443ffc2b435ffafd2"))
145 (package
146 (name "syncthing-gtk")
147 (version (git-version "0.9.4.4" revision commit))
148 (source (origin
149 (method git-fetch)
150 (uri (git-reference
151 (url "https://salsa.debian.org/debian/syncthing-gtk.git")
152 (commit commit)))
153 (file-name (git-file-name name version))
154 (sha256
155 (base32
156 "1b77rdmx74zyz3lfhzzvdf3rrm7lfc7246varnr5xi366z3410ha"))))
157 (build-system pyproject-build-system)
158 (arguments
159 (list
160 #:tests? #f ;has no tests
161 #:phases
162 #~(modify-phases %standard-phases
163 (add-after 'unpack 'hardcode-dependencies
164 (lambda* (#:key inputs #:allow-other-keys)
165 (let ((psmisc (assoc-ref inputs "psmisc"))
166 (syncthing (assoc-ref inputs "syncthing")))
167 ;; Hardcode dependencies paths to avoid propagation.
168 (substitute* "syncthing_gtk/tools.py"
169 (("killall") (string-append psmisc "/bin/killall")))
170 (substitute* "syncthing_gtk/configuration.py"
171 (("/usr/bin/syncthing") (string-append syncthing
172 "/bin/syncthing"))))))
173 (add-after 'unpack 'fix-autostart-path
174 ;; Change the autostart .desktop file 'Exec' command so it finds
175 ;; the Python wrapper of 'syncthing-gtk', rather than the unwrapped
176 ;; '.syncthing-gtk-real'.
177 (lambda _
178 (substitute* "syncthing_gtk/tools.py"
179 (("return executable")
180 "return \"syncthing-gtk\""))
181 ;; Prevent complaints from 'pip3 check':
182 ;; DEPRECATION: syncthing-gtk unknown has a non-standard
183 ;; version number. pip 24.1 will enforce this behaviour change.
184 (substitute* "setup.py"
185 (("return version")
186 (string-append
187 "return \"" (car (string-split #$version #\-)) "\"")))))
188 (add-after 'unpack 'remove-windows.py
189 (lambda _
190 ;; A Windows-specific module that fails to load with
191 ;; "ModuleNotFoundError: No module named 'msvcrt'.
192 (delete-file "syncthing_gtk/windows.py")))
193 (add-after 'wrap 'wrap-libs
194 (lambda* (#:key outputs #:allow-other-keys)
195 (let ((out (assoc-ref outputs "out")))
196 (wrap-program (string-append out "/bin/syncthing-gtk")
197 `("GUIX_GDK_PIXBUF_MODULE_FILES" ":" suffix
198 (,(getenv "GUIX_GDK_PIXBUF_MODULE_FILES")))
199 `("GI_TYPELIB_PATH" ":" suffix
200 (,(getenv "GI_TYPELIB_PATH"))))))))))
201 (native-inputs (list python-setuptools))
202 (inputs
203 (list bash-minimal
204 gtk+
205 libappindicator
206 libnotify
207 python-bcrypt
208 python-dateutil
209 python-pycairo
210 python-pygobject
211 psmisc
212 syncthing))
213 (home-page "https://github.com/kozec/syncthing-gtk")
214 (synopsis "GTK3 based GUI and notification area icon for Syncthing")
215 (description "@code{syncthing-gtk} is a GTK3 Python based GUI and
216notification area icon for Syncthing. Supported Syncthing features:
217
218@itemize
219@item Everything that WebUI can display
220@item Adding, editing and deleting nodes
221@item Adding, editing and deleting repositories
222@item Restart, shutdown server
223@item Editing daemon settings
224@end itemize\n")
225 (license gpl2))))
226
139(define-public go-github-com-syncthing-notify 227(define-public go-github-com-syncthing-notify
140 (package 228 (package
141 (name "go-github-com-syncthing-notify") 229 (name "go-github-com-syncthing-notify")