guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

40/143: gnu: akonadi: Enable tests.


From: guix-commits
Subject: 40/143: gnu: akonadi: Enable tests.
Date: Mon, 21 Nov 2022 16:10:43 -0500 (EST)

mbakke pushed a commit to branch master
in repository guix.

commit 98fd85c0320f849ad174e4e45c5c86dd81cfcbd2
Author: Petr Hodina <phodina@protonmail.com>
AuthorDate: Sat Sep 24 17:11:04 2022 +0200

    gnu: akonadi: Enable tests.
    
    * gnu/packages/kde-pim.scm (akonadi)[arguments]: Enable tests and use gexp.
    [inputs]: Add LIBACCOUNTS-QT and SIGNOND.
    
    Co-authored-by: Marius Bakke <marius@gnu.org>
---
 gnu/packages/kde-pim.scm | 83 +++++++++++++++++++++++++++---------------------
 1 file changed, 47 insertions(+), 36 deletions(-)

diff --git a/gnu/packages/kde-pim.scm b/gnu/packages/kde-pim.scm
index 6c5e73bb07..11b6acdc7c 100644
--- a/gnu/packages/kde-pim.scm
+++ b/gnu/packages/kde-pim.scm
@@ -23,6 +23,7 @@
 (define-module (gnu packages kde-pim)
   #:use-module (guix build-system qt)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
@@ -47,22 +48,26 @@
   (package
     (name "akonadi")
     (version "22.08.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "mirror://kde/stable/release-service/" version
-                           "/src/akonadi-" version ".tar.xz"))
-       (sha256
-        (base32 "1yfy0b6kyiq82zkfkx9ldgjlbwg3lgg4di53fqjllmqhzaj1xy91"))
-       (patches (search-patches
-                 "akonadi-paths.patch"
-                 "akonadi-timestamps.patch"
-                 "akonadi-not-relocatable.patch"))))
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://kde/stable/release-service/"
+                                  version "/src/akonadi-" version ".tar.xz"))
+              (sha256
+               (base32
+                "1yfy0b6kyiq82zkfkx9ldgjlbwg3lgg4di53fqjllmqhzaj1xy91"))
+              (patches (search-patches "akonadi-paths.patch"
+                                       "akonadi-timestamps.patch"
+                                       "akonadi-not-relocatable.patch"))))
     (build-system qt-build-system)
     (native-inputs
-     (list dbus extra-cmake-modules qttools-5 shared-mime-info pkg-config))
+     (list dbus
+           extra-cmake-modules
+           qttools-5
+           shared-mime-info
+           pkg-config))
     (inputs
      (list boost
+           libaccounts-qt
            kconfig
            kconfigwidgets
            kcoreaddons
@@ -80,33 +85,39 @@
            ;; Do NOT add mysql or postgresql to the inputs. Otherwise the 
binaries
            ;; and wrapped files will refer to them, even if the user choices 
none
            ;; of these.  Executables are searched on $PATH then.
-           qtbase-5
-           sqlite))
+           signond
+           qtbase-5))
+    (propagated-inputs (list sqlite kaccounts-integration))
     (arguments
-     `(#:tests? #f ;; TODO 135/167 tests fail
-       #:configure-flags '("-DDATABASE_BACKEND=SQLITE") ; lightweight
-       #:modules ((ice-9 textual-ports)
-                  ,@%qt-build-system-modules)
-       #:phases
-       (modify-phases (@ (guix build qt-build-system) %standard-phases)
-         (add-before 'configure 'add-definitions
-           (lambda* (#:key outputs inputs #:allow-other-keys)
-             (let ((out   (assoc-ref outputs "out")))
-               (with-output-to-file "CMakeLists.txt.new"
-                 (lambda _
-                   (display
-                    (string-append
-                     "add_compile_definitions(\n"
-                     "NIX_OUT=\"" out "\"\n"
-                     ;; pin binaries for mysql backend
-                     ")\n\n"))
-                   (display
-                    (call-with-input-file "CMakeLists.txt"
-                      get-string-all))))
-               (rename-file "CMakeLists.txt.new" "CMakeLists.txt")))))))
+     (list #:tests? #f
+           #:configure-flags #~'("-DDATABASE_BACKEND=SQLITE") ;lightweight
+           #:modules `((ice-9 textual-ports)
+                       ,@%qt-build-system-modules)
+           #:phases
+           #~(modify-phases (@ (guix build qt-build-system) %standard-phases)
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (setenv "PATH"
+                             (string-append (getcwd) "/bin" ":"
+                                            (getenv "PATH")))
+                     (invoke "dbus-launch" "ctest" "-E"
+                             
"(AkonadiServer-dbconfigtest|mimetypecheckertest|entitytreemodeltest|akonadi-sqlite-testenvironmenttest|akonadi-sqlite-autoincrementtest|akonadi-sqlite-attributefactorytest|akonadi-sqlite-collectionpathresolvertest|akonadi-sqlite-collectionattributetest|akonadi-sqlite-itemfetchtest|akonadi-sqlite-itemappendtest|akonadi-sqlite-itemstoretest|akonadi-sqlite-itemdeletetest|akonadi-sqlite-entitycachetest|akonadi-sqlite-monitortest|akonadi-sqlite-changerecordertest
 [...]
+               (add-before 'configure 'add-definitions
+                 (lambda* (#:key outputs inputs #:allow-other-keys)
+                   (with-output-to-file "CMakeLists.txt.new"
+                     (lambda _
+                       (display (string-append
+                                 "add_compile_definitions(\n"
+                                 "NIX_OUT=\""
+                                 #$output "\"\n" ")\n\n"))
+                       (display (call-with-input-file "CMakeLists.txt"
+                                  get-string-all))))
+                   (rename-file "CMakeLists.txt.new" "CMakeLists.txt"))))))
     (home-page "https://kontact.kde.org/components/akonadi/";)
     (synopsis "Extensible cross-desktop storage service for PIM")
-    (description "Akonadi is an extensible cross-desktop Personal Information
+    (description
+     "Akonadi is an extensible cross-desktop Personal Information
 Management (PIM) storage service.  It provides a common framework for
 applications to store and access mail, calendars, addressbooks, and other PIM
 data.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]