Subject: [bug#70395] [PATCH kde-team 19/63] gnu: Add kcalendarcore-6.

From: Zheng Junjie <[email-masked]>
Date: Mon, 15 Apr 2024 20:46:56 +0800

* gnu/packages/kde-frameworks.scm (kcalendarcore-6): New variable.
(kcalendarcore): Inherit above.

Change-Id: I9382d16f516031e83dfa2a5c8e79aad009dcbbab
---
 gnu/packages/kde-frameworks.scm | 66 ++++++++++++++++++++++++++-------
 1 file changed, 53 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index bab4aaa9ca..443307ecc1 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -536,10 +536,10 @@ (define-public karchive
      (list bzip2 qtbase-5 xz zlib `(,zstd "lib")))
     (synopsis "Qt 5 addon providing access to numerous types of archives")))
 
-(define-public kcalendarcore
+(define-public kcalendarcore-6
   (package
     (name "kcalendarcore")
-    (version "5.114.0")
+    (version "6.1.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -548,29 +548,33 @@ (define-public kcalendarcore
                     name "-" version ".tar.xz"))
               (sha256
                (base32
-                "0aimda01zqw4fz5ldvz4vh767bi10r00kvm62n89nxhsq46wlk7p"))))
+                "16qkl92cqn5q83pj1hgqmvybnv5pzi1j1q85cz17jsq7lhrfzzqw"))))
     (build-system cmake-build-system)
     (native-inputs
      (list extra-cmake-modules perl tzdata-for-tests))
-    (inputs
-     (list libical qtbase-5))
+    (inputs (list libical qtbase))
     (arguments
      (list
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'disable-failing-test
-            (lambda _
-              ;; Reported as https://bugs.kde.org/show_bug.cgi?id=484306
-              (substitute* "autotests/CMakeLists.txt"
-                (("testdateserialization")
-                 ""))))
           (add-before 'check 'check-setup
-            (lambda* (#:key inputs #:allow-other-keys) ;;; XXX: failing test
+            (lambda* (#:key inputs #:allow-other-keys)
               (setenv "QT_QPA_PLATFORM" "offscreen")
               (setenv "TZ" "Europe/Prague")
               (setenv "TZDIR"
                       (search-input-directory inputs
-                                              "share/zoneinfo")))))))
+                                              "share/zoneinfo"))))
+          (replace 'check
+            (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
+              (when tests?
+                ;; alse fail in upstream
+                (invoke "ctest" "-E"
+                        "(testicaltimezones|\
+Compat-AppleICal_1.5.ics|Compat-KOrganizer_3.1a.ics|Compat-Mozilla_1.0.ics)"
+                        "-j"
+                        (if parallel-tests?
+                            (number->string (parallel-job-count))
+                            "1"))))))))
     (home-page "https://community.kde.org/Frameworks")
     (synopsis "Library for interfacing with calendars")
     (description "This library provides access to and handling of calendar
@@ -583,6 +587,42 @@ (define-public kcalendarcore
 and the older vCalendar.")
     (license (list license:lgpl3+ license:bsd-2))))
 
+(define-public kcalendarcore
+  (package
+    (inherit kcalendarcore-6)
+    (name "kcalendarcore")
+    (version "5.114.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://kde/stable/frameworks/"
+                    (version-major+minor version) "/"
+                    name "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "0aimda01zqw4fz5ldvz4vh767bi10r00kvm62n89nxhsq46wlk7p"))))
+    (native-inputs
+     (list extra-cmake-modules perl tzdata-for-tests))
+    (inputs
+     (list libical qtbase-5))
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'disable-failing-test
+            (lambda _
+              ;; Reported as https://bugs.kde.org/show_bug.cgi?id=484306
+              (substitute* "autotests/CMakeLists.txt"
+                (("testdateserialization")
+                 ""))))
+          (add-before 'check 'check-setup
+            (lambda* (#:key inputs #:allow-other-keys) ;;; XXX: failing test
+              (setenv "QT_QPA_PLATFORM" "offscreen")
+              (setenv "TZ" "Europe/Prague")
+              (setenv "TZDIR"
+                      (search-input-directory inputs
+                                              "share/zoneinfo")))))))))
+
 (define-public kcodecs-6
   (package
     (name "kcodecs")
-- 
2.41.0