Subject: [PATCH 6/6] gnu: sync: add seadrive-gui

From: flypaper <[email-masked]>
Date: Sun, 16 Feb 2025 11:38:49 +0200

* gnu/packages/sync.scm (seadrive-gui): New package.

Change-Id: I6dc3ffff73611788e5b40ef4a0d09f2492c2da2b
---
 gnu/packages/sync.scm | 62 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/sync.scm b/gnu/packages/sync.scm
index 6f09ae20b2..25ec140d75 100644
--- a/gnu/packages/sync.scm
+++ b/gnu/packages/sync.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2020 Jakub Kądziołka <[email-masked]>
 ;;; Copyright © 2021 Stefan Reichör <[email-masked]>
+;;; Copyright © 2025 flypaper-ultimat <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -808,3 +809,64 @@ (define-public seadrive-fuse
     (description
      "This package provides the @{seadrive} command, allowing for seadrive libraries to be mounted as FUSE drive.")
     (license license:gpl3+)))
+
+(define-public seadrive-gui
+  (package
+    (name "seadrive-gui")
+    (version "3.0.12")
+    (home-page "https://github.com/haiwen/seadrive-gui")
+    (synopsis "SeaDrive daemon with FUSE interface")
+    (description
+     "This package provides the graphical interface for mounting seadrive libraries as a FUSE drive.")
+    (license license:gpl3+)
+    (native-inputs (list autoconf
+                         automake
+                         libtool
+                         pkg-config
+                         vala
+                         intltool
+                         cmake-minimal))
+    (inputs (list sqlite
+                  gtk
+                  curl
+                  util-linux
+                  openssl
+                  jansson
+                  libevent
+                  fuse-2
+                  libwebsockets
+                  libsearpc
+                  python
+                  qtbase-5
+                  qttools-5
+                  python-simplejson
+                  qtwebengine-5
+                  seadrive-fuse))
+    (arguments
+     (list
+      #:configure-flags #~(list "-DCMAKE_BUILD_TYPE=Release")
+      #:tests? #f ;there are no tests
+      #:phases '(modify-phases %standard-phases
+                  ;; seafile-client expects seaf-daemon in %PATH
+                  ;; but we can just replace it in the source with a path to store
+                  ;; so that we dont anymore.
+                  (add-after 'unpack 'replace-daemon-executable
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (substitute* "src/daemon-mgr.cpp"
+                        (("\"(seadrive)\"" all program)
+                         (string-append "\""
+                                        (search-input-file inputs
+                                                           (string-append
+                                                            "bin/" program))
+                                        "\""))))))))
+    (build-system qt-build-system)
+    (source
+     (origin
+       (method git-fetch)
+       (file-name (git-file-name name version))
+       (modules '((guix build utils)))
+       (uri (git-reference
+             (url home-page)
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "1xaq1rlyfnp7xnq2xbc77hrblpw8apqmf3l5mrnvkhwifgs0p8xs"))))))
-- 
2.46.0