From 389ef5ac4ada15a7b05a09e0e5023d1eaeea59f3 Mon Sep 17 00:00:00 2001 From: Gigiaj Date: Sun, 23 Mar 2025 20:01:39 -0500 Subject: [PATCH] adjust names and use older qt5 version for now --- gchannel/packages/nextcloud-client-qt6._scm | 234 ++++++++++++++++++++ gchannel/packages/nextcloud-client.scm | 70 ++---- 2 files changed, 257 insertions(+), 47 deletions(-) create mode 100644 gchannel/packages/nextcloud-client-qt6._scm diff --git a/gchannel/packages/nextcloud-client-qt6._scm b/gchannel/packages/nextcloud-client-qt6._scm new file mode 100644 index 0000000..bd513ed --- /dev/null +++ b/gchannel/packages/nextcloud-client-qt6._scm @@ -0,0 +1,234 @@ +(define-module (gchannel packages nextcloud-client) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cmake) + #:use-module (guix build-system copy) + #:use-module (guix build-system gnu) + #:use-module (guix build-system go) + #:use-module (guix build-system meson) + #:use-module (guix build-system qt) + #:use-module (guix gexp) + #:use-module (guix utils) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (gchannel packages libp11) + #:use-module (gnu packages) + #:use-module (gnu packages acl) + #:use-module (gnu packages base) + #:use-module (gnu packages adns) + #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages crypto) + #:use-module (gnu packages curl) + #:use-module (gnu packages dlang) + #:use-module (gnu packages documentation) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages libevent) + #:use-module (gnu packages gl) + #:use-module (gnu packages linux) + #:use-module (gnu packages lua) + #:use-module (gnu packages markup) + #:use-module (gnu packages ocaml) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages qt) + #:use-module (gnu packages readline) + #:use-module (gnu packages rsync) + #:use-module (gnu packages ruby) + #:use-module (gnu packages security-token) + #:use-module (gnu packages selinux) + #:use-module (gnu packages shells) + #:use-module (gnu packages version-control) + #:use-module (gnu packages sphinx) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xorg) + #:use-module (gnu packages vulkan) + #:use-module (gnu packages tls)) + +(define-public nextcloud-client + (package + (name "nextcloud-client") + (version "3.15.3") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/nextcloud/desktop") + (commit (string-append "v" version)))) + (file-name + (git-file-name name version)) + (sha256 + (base32 "1qyzyfwr32w4pamjhl0ssiv444nbqnqxi3fn4bs7agg4217pv6bv")) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1))) + (snippet + '(begin + ;; Not available in Guix. + (let* ((keep '("QProgressIndicator" "qtokenizer" "kirigami"))) + (with-directory-excursion "src/3rdparty" + (for-each delete-file-recursively + (lset-difference string=? + (scandir ".") + (cons* "." ".." keep))))) + (with-directory-excursion "src/gui" + (substitute* "CMakeLists.txt" + ;; Remove references of deleted 3rdparties. + (("[ \t]*\\.\\./3rdparty/qtlockedfile/?.*\\.(cpp|h)") + "") + (("[ \t]*\\.\\./3rdparty/qtsingleapplication/?.*\\.(cpp|h)") + "") + (("[ \t]*\\.\\./3rdparty/kmessagewidget/?.*\\.(cpp|h)") + "") + (("[ \t]*list\\(APPEND 3rdparty_SRC \\.\\./3rdparty/?.*\\)") + "") + (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/qtlockedfile") + "") + (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/qtsingleapplication") + "") + (("\\$\\{CMAKE_SOURCE_DIR\\}/src/3rdparty/kmessagewidget") + ;; For this, we rely on build inputs, so let's just replace + ;; them by an autoconf-style variable. + "@kwidgetsaddons@") + ;; Expand libraries, that used to be statically linked, but + ;; no longer are post-vendoring. + (("KF6::Archive") + (string-append "KF6::Archive " + "QtSolutions_LockedFile " + "QtSolutions_SingleApplication " + "KF6WidgetsAddons"))) + ;; Fix compatibility with QtSingleApplication from QtSolutions. + (substitute* '("application.h" "application.cpp") + (("SharedTools::QtSingleApplication") + "QtSingleApplication") + (("slotParseMessage\\(const QString &(msg)?.*\\)") + "slotParseMessage(const QString &msg)"))) + #t)))) + (build-system qt-build-system) + (arguments + `(#:configure-flags + (list + "-DUNIT_TESTING=ON" "-DBUILD_UPDATER=OFF") + #:imported-modules + ((guix build glib-or-gtk-build-system) + ,@%qt-build-system-modules) + #:modules + (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) + (guix build qt-build-system) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-cmake + (lambda* (#:key inputs #:allow-other-keys) + ;; Patch install directory for dbus service files. + (substitute* "shell_integration/libcloudproviders/CMakeLists.txt" + (("pkg_get_variable\\(_install_dir dbus-1 .*\\)") + (string-append "set(_install_dir \"${CMAKE_INSTALL_PREFIX}" + "/share/dbus-1/services\")"))) + (substitute* "shell_integration/dolphin/CMakeLists.txt" + ;; Make sure, that Qt modules are installed under $prefix. + (("ON CACHE") "OFF CACHE")) + (substitute* "src/gui/CMakeLists.txt" + (("@kwidgetsaddons@") + (search-input-directory inputs + "/include/KF6/KWidgetsAddons/"))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "QT_QPA_PLATFORM" "offscreen") + (invoke "ctest" "-E" "SyncXAttrTest")))) + (add-before 'check 'pre-check + (lambda _ + ;; Tests write to $HOME. + (setenv "HOME" (getcwd)) + #t)) + (add-after 'install 'glib-or-gtk-compile-schemas + (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas)) + (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap + (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)) + (delete 'check) + ))) + (native-inputs + `(("cmocka" ,cmocka) + ("dot" ,graphviz) + ("doxygen" ,doxygen) + ("extra-cmake-modules" ,extra-cmake-modules) + ("glib:bin" ,glib "bin") + ("librsvg" ,(librsvg-for-system)) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python" ,python-wrapper) + ("qttools" ,qttools) + ("ruby" ,ruby))) + (inputs + (list appstream + dbus + desktop-file-utils + glib + karchive + kconfig + kcoreaddons + kguiaddons + kio-5 + kjs + kwidgetsaddons + libcloudproviders + libzip + libxkbcommon + vulkan-headers + pcre + pkg-config + openssl + qt5compat + qtbase + qtdeclarative + qtgraphicaleffects + mesa + which + qtkeychain-qt6 + ;;qtquickcontrols2 + qtsolutions + git + qtsvg + qtwebchannel + libp11 + qtwebsockets + sqlite + python-sphinx + qtwayland + wayland + xdg-utils + zlib + zstd + xcb-util-cursor + libxext + libxcb + libsm + libice + libb2 + md4c + at-spi2-core + )) + (propagated-inputs + (list qtwebengine)) + (synopsis "Desktop sync client for Nextcloud") + (description "Nextcloud-Desktop is a tool to synchronize files from +Nextcloud Server with your computer.") + (home-page "https://nextcloud.com") + (license (list license:expat ; QProgressIndicator + license:lgpl2.1+ ; qtokenizer + license:gpl2+)))) + +nextcloud-client \ No newline at end of file diff --git a/gchannel/packages/nextcloud-client.scm b/gchannel/packages/nextcloud-client.scm index bd513ed..07a05a7 100644 --- a/gchannel/packages/nextcloud-client.scm +++ b/gchannel/packages/nextcloud-client.scm @@ -59,7 +59,7 @@ (define-public nextcloud-client (package (name "nextcloud-client") - (version "3.15.3") + (version "3.13.3") (source (origin (method git-fetch) @@ -70,7 +70,7 @@ (file-name (git-file-name name version)) (sha256 - (base32 "1qyzyfwr32w4pamjhl0ssiv444nbqnqxi3fn4bs7agg4217pv6bv")) + (base32 "1qd2jckk47kym08r8hjjy5iadbz71633i72ixy6zmdwh9wv9s54b")) (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1))) @@ -104,11 +104,11 @@ "@kwidgetsaddons@") ;; Expand libraries, that used to be statically linked, but ;; no longer are post-vendoring. - (("KF6::Archive") - (string-append "KF6::Archive " + (("KF5::Archive") + (string-append "KF5::Archive " "QtSolutions_LockedFile " "QtSolutions_SingleApplication " - "KF6WidgetsAddons"))) + "KF5WidgetsAddons"))) ;; Fix compatibility with QtSingleApplication from QtSolutions. (substitute* '("application.h" "application.cpp") (("SharedTools::QtSingleApplication") @@ -143,7 +143,7 @@ (substitute* "src/gui/CMakeLists.txt" (("@kwidgetsaddons@") (search-input-directory inputs - "/include/KF6/KWidgetsAddons/"))))) + "/include/KF5/KWidgetsAddons/"))))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? @@ -154,12 +154,11 @@ ;; Tests write to $HOME. (setenv "HOME" (getcwd)) #t)) + (delete 'check) ;; Check requires some networking capabilities that aren't granted in a builder sandbox (add-after 'install 'glib-or-gtk-compile-schemas (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas)) (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap - (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)) - (delete 'check) - ))) + (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))))) (native-inputs `(("cmocka" ,cmocka) ("dot" ,graphviz) @@ -170,59 +169,36 @@ ("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python-wrapper) - ("qttools" ,qttools) + ("qttools-5" ,qttools-5) ("ruby" ,ruby))) (inputs (list appstream dbus desktop-file-utils glib - karchive - kconfig - kcoreaddons - kguiaddons - kio-5 + karchive-5 + kconfig-5 + kcoreaddons-5 + kio-5 kjs - kwidgetsaddons + kwidgetsaddons-5 libcloudproviders libzip - libxkbcommon - vulkan-headers - pcre - pkg-config openssl - qt5compat - qtbase - qtdeclarative + qtbase-5 + qtdeclarative-5 qtgraphicaleffects - mesa - which - qtkeychain-qt6 - ;;qtquickcontrols2 + qtkeychain + qtquickcontrols2-5 qtsolutions - git - qtsvg - qtwebchannel - libp11 - qtwebsockets + qtsvg-5 + qtwebchannel-5 + qtwebsockets-5 sqlite - python-sphinx - qtwayland - wayland xdg-utils - zlib - zstd - xcb-util-cursor - libxext - libxcb - libsm - libice - libb2 - md4c - at-spi2-core - )) + zlib)) (propagated-inputs - (list qtwebengine)) + (list qtwebengine-5)) (synopsis "Desktop sync client for Nextcloud") (description "Nextcloud-Desktop is a tool to synchronize files from Nextcloud Server with your computer.")