| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 |
|
| 28 | (define-module (gnu packages syncthing)
|
| 29 | #:use-module (guix build-system go)
|
| 30 | #:use-module (guix build-system pyproject)
|
| 31 | #:use-module (guix gexp)
|
| 32 | #:use-module (guix packages)
|
| 33 | #:use-module (guix download)
|
| 34 | #:use-module (guix git-download)
|
| 35 | #:use-module (guix licenses)
|
| 36 | #:use-module (gnu packages)
|
| 37 | #:use-module (gnu packages bash)
|
| 38 | #:use-module (gnu packages freedesktop)
|
| 39 | #:use-module (gnu packages glib)
|
| 40 | #:use-module (gnu packages gnome)
|
| 41 | #:use-module (gnu packages golang)
|
| 42 | #:use-module (gnu packages golang-build)
|
| 43 | #:use-module (gnu packages golang-compression)
|
| 44 | #:use-module (gnu packages gtk)
|
| 45 | #:use-module (gnu packages linux)
|
| 46 | #:use-module (gnu packages python-crypto)
|
| 47 | #:use-module (gnu packages python-build)
|
| 48 | #:use-module (gnu packages time))
|
| 49 |
|
| 50 | (define-public syncthing
|
| 51 | (package
|
| 52 | (name "syncthing")
|
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | (version "2.1.2")
|
| 58 | (source (origin
|
| 59 | (method url-fetch)
|
| 60 | (uri (string-append "https://github.com/syncthing/syncthing"
|
| 61 | "/releases/download/v" version
|
| 62 | "/syncthing-source-v" version ".tar.gz"))
|
| 63 | (sha256
|
| 64 | (base32
|
| 65 | "13k73wlmhxgwrzxf5dwb526dw8c5zw5s2jv29cn9lnvhgkmn2hjq"))))
|
| 66 | |
| 67 | (build-system go-build-system)
|
| 68 | |
| 69 | |
| 70 | |
| 71 | (outputs '("out" "utils"))
|
| 72 | (arguments
|
| 73 | (list
|
| 74 | #:modules '((srfi srfi-26) |
| 75 | (guix build utils)
|
| 76 | (guix build go-build-system))
|
| 77 | #:import-path "github.com/syncthing/syncthing"
|
| 78 | |
| 79 | |
| 80 | #:install-source? #f
|
| 81 | #:phases
|
| 82 | #~(modify-phases %standard-phases
|
| 83 | (add-before 'build 'increase-test-timeout
|
| 84 | (lambda _
|
| 85 | (substitute* "src/github.com/syncthing/syncthing/build.go"
|
| 86 | (("120s") "999s"))))
|
| 87 |
|
| 88 | (replace 'build
|
| 89 | (lambda _
|
| 90 | (with-directory-excursion "src/github.com/syncthing/syncthing"
|
| 91 | |
| 92 | (invoke "go" "run" "build.go" "-no-upgrade" "build" "syncthing")
|
| 93 | |
| 94 | (for-each (cut invoke "go" "run" "build.go" "build" <>)
|
| 95 | '("stcrashreceiver" "strelaypoolsrv" "stupgrades"
|
| 96 | "strelaysrv" "stdiscosrv" "ursrv")))))
|
| 97 |
|
| 98 | (replace 'check
|
| 99 | (lambda* (#:key tests? #:allow-other-keys)
|
| 100 | (when tests?
|
| 101 | (with-directory-excursion "src/github.com/syncthing/syncthing"
|
| 102 | (invoke "go" "run" "build.go" "test")))))
|
| 103 |
|
| 104 | (replace 'install
|
| 105 | (lambda _
|
| 106 | (with-directory-excursion "src/github.com/syncthing/syncthing"
|
| 107 | (install-file "syncthing" (string-append #$output "/bin"))
|
| 108 | (for-each (cut install-file <> (string-append #$output:utils "/bin/"))
|
| 109 | '("stdiscosrv" "strelaysrv" "ursrv" "stupgrades"
|
| 110 | "strelaypoolsrv" "stcrashreceiver")))))
|
| 111 |
|
| 112 | (add-after 'install 'install-docs
|
| 113 | (lambda _
|
| 114 | (let ((man (string-append #$output "/share/man"))
|
| 115 | (man:utils (string-append #$output:utils "/share/man")))
|
| 116 | |
| 117 | (for-each
|
| 118 | (lambda (file)
|
| 119 | (install-file file
|
| 120 | (string-append man "/man" (string-take-right file 1))))
|
| 121 | (find-files "src/github.com/syncthing/syncthing/man" "\\.[1-9]"))
|
| 122 | |
| 123 | (copy-recursively man man:utils)
|
| 124 | |
| 125 | |
| 126 | (delete-file (string-append man "/man1/stdiscosrv.1"))
|
| 127 | (delete-file (string-append man "/man1/strelaysrv.1"))
|
| 128 | (delete-file (string-append man:utils "/man1/syncthing.1"))))))))
|
| 129 | (synopsis "Decentralized continuous file system synchronization")
|
| 130 | (description "Syncthing is a peer-to-peer file synchronization tool that
|
| 131 | supports a wide variety of computing platforms. It uses the Block Exchange
|
| 132 | Protocol.")
|
| 133 | (home-page "https://github.com/syncthing/syncthing")
|
| 134 | (properties
|
| 135 | '((release-monitoring-url . "https://syncthing.net/downloads/")
|
| 136 | (upstream-name . "syncthing-source")
|
| 137 | |
| 138 | (tunable? . #t)))
|
| 139 | (license mpl2.0)))
|
| 140 |
|
| 141 | (define-public syncthing-gtk
|
| 142 | |
| 143 | |
| 144 | |
| 145 | (let ((revision "2")
|
| 146 | (commit "1e84f332e413ba123bcd443443ffc2b435ffafd2"))
|
| 147 | (package
|
| 148 | (name "syncthing-gtk")
|
| 149 | (version (git-version "0.9.4.4" revision commit))
|
| 150 | (source (origin
|
| 151 | (method git-fetch)
|
| 152 | (uri (git-reference
|
| 153 | (url "https://salsa.debian.org/debian/syncthing-gtk.git")
|
| 154 | (commit commit)))
|
| 155 | (file-name (git-file-name name version))
|
| 156 | (sha256
|
| 157 | (base32
|
| 158 | "1b77rdmx74zyz3lfhzzvdf3rrm7lfc7246varnr5xi366z3410ha"))))
|
| 159 | (build-system pyproject-build-system)
|
| 160 | (arguments
|
| 161 | (list
|
| 162 | #:tests? #f |
| 163 | #:phases
|
| 164 | #~(modify-phases %standard-phases
|
| 165 | (add-after 'unpack 'hardcode-dependencies
|
| 166 | (lambda* (#:key inputs #:allow-other-keys)
|
| 167 | (let ((psmisc (assoc-ref inputs "psmisc"))
|
| 168 | (syncthing (assoc-ref inputs "syncthing")))
|
| 169 | |
| 170 | (substitute* "syncthing_gtk/tools.py"
|
| 171 | (("killall") (string-append psmisc "/bin/killall")))
|
| 172 | (substitute* "syncthing_gtk/configuration.py"
|
| 173 | (("/usr/bin/syncthing") (string-append syncthing
|
| 174 | "/bin/syncthing"))))))
|
| 175 | (add-after 'unpack 'fix-autostart-path
|
| 176 | |
| 177 | |
| 178 | |
| 179 | (lambda _
|
| 180 | (substitute* "syncthing_gtk/tools.py"
|
| 181 | (("return executable")
|
| 182 | "return \"syncthing-gtk\""))
|
| 183 | |
| 184 | |
| 185 | |
| 186 | (substitute* "setup.py"
|
| 187 | (("return version")
|
| 188 | (string-append
|
| 189 | "return \"" (car (string-split #$version #\-)) "\"")))))
|
| 190 | (add-after 'unpack 'remove-windows.py
|
| 191 | (lambda _
|
| 192 | |
| 193 | |
| 194 | (delete-file "syncthing_gtk/windows.py")))
|
| 195 | (add-after 'wrap 'wrap-libs
|
| 196 | (lambda* (#:key outputs #:allow-other-keys)
|
| 197 | (let ((out (assoc-ref outputs "out")))
|
| 198 | (wrap-program (string-append out "/bin/syncthing-gtk")
|
| 199 | `("GUIX_GDK_PIXBUF_MODULE_FILES" ":" suffix
|
| 200 | (,(getenv "GUIX_GDK_PIXBUF_MODULE_FILES")))
|
| 201 | `("GI_TYPELIB_PATH" ":" suffix
|
| 202 | (,(getenv "GI_TYPELIB_PATH"))))))))))
|
| 203 | (native-inputs (list python-setuptools))
|
| 204 | (inputs
|
| 205 | (list bash-minimal
|
| 206 | gtk+
|
| 207 | libappindicator
|
| 208 | libnotify
|
| 209 | python-bcrypt
|
| 210 | python-dateutil
|
| 211 | python-pycairo
|
| 212 | python-pygobject-3.50
|
| 213 | psmisc
|
| 214 | syncthing))
|
| 215 | (home-page "https://github.com/kozec/syncthing-gtk")
|
| 216 | (synopsis "GTK3 based GUI and notification area icon for Syncthing")
|
| 217 | (description "@code{syncthing-gtk} is a GTK3 Python based GUI and
|
| 218 | notification area icon for Syncthing. Supported Syncthing features:
|
| 219 |
|
| 220 | @itemize
|
| 221 | @item Everything that WebUI can display
|
| 222 | @item Adding, editing and deleting nodes
|
| 223 | @item Adding, editing and deleting repositories
|
| 224 | @item Restart, shutdown server
|
| 225 | @item Editing daemon settings
|
| 226 | @end itemize\n")
|
| 227 | (license gpl2))))
|