Subject: [PATCH 09/14] gnu: Add kmail.

From: Hartmut Goebel <[email-masked]>
Date: Wed, 4 Mar 2020 10:21:28 +0100

* gnu/packages/kde-pim.scm (kmail): New variable.
* gnu/packages/patches/kmail-Fix-missing-link-libraries.patch:
  New file.
* gnu/local.mk: Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/kde-pim.scm                      | 94 +++++++++++++++++++
 .../kmail-Fix-missing-link-libraries.patch    | 41 ++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 gnu/packages/patches/kmail-Fix-missing-link-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e200f30419..840e0e58d6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1057,6 +1057,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/kinit-kdeinit-extra_libs.patch		\
   %D%/packages/patches/kinit-kdeinit-libpath.patch		\
   %D%/packages/patches/kio-search-smbd-on-PATH.patch		\
+  %D%/packages/patches/kmail-Fix-missing-link-libraries.patch \
   %D%/packages/patches/kmod-module-directory.patch		\
   %D%/packages/patches/kmscon-runtime-keymap-switch.patch	\
   %D%/packages/patches/kpackage-allow-external-paths.patch	\
diff --git a/gnu/packages/kde-pim.scm b/gnu/packages/kde-pim.scm
index dbd5c2f48c..0fe0799235 100644
--- a/gnu/packages/kde-pim.scm
+++ b/gnu/packages/kde-pim.scm
@@ -863,6 +863,100 @@ and retrieving certificates from LDAP servers.")
     (license ;; GPL for programs, FDL for documentation
      (list license:gpl2+ license:fdl1.2+))))
 
+(define-public kmail
+  (package
+    (name "kmail")
+    (version "19.08.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://kde/stable/applications/" version
+                           "/src/kmail-" version ".tar.xz"))
+       (sha256
+        (base32 "0gsdpv9pf4h031zcawc4qv78a5kl9hxp2amd0spjhs7wc7nl17fk"))
+       (patches (search-patches "kmail-Fix-missing-link-libraries.patch"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("dbus" ,dbus)
+       ("kdoctools" ,kdoctools)))
+    (inputs
+     `(("akonadi" ,akonadi)
+       ("akonadi-contacts" ,akonadi-contacts)
+       ("akonadi-mime" ,akonadi-mime)
+       ("akonadi-search" ,akonadi-search)
+       ("boost" ,boost)
+       ("gpgme" ,gpgme)
+       ("kbookmarks" ,kbookmarks)
+       ("kcalendarcore" ,kcalendarcore)
+       ("kcalutils" ,kcalutils)
+       ("kcmutils" ,kcmutils)
+       ("kcodecs" ,kcodecs)
+       ("kconfig" ,kconfig)
+       ("kconfigwidgets" ,kconfigwidgets)
+       ("kcontacts" ,kcontacts)
+       ("kcrash" ,kcrash)
+       ("kdbusaddons" ,kdbusaddons)
+       ("kdepim-apps-libs" ,kdepim-apps-libs)
+       ("kguiaddons" ,kguiaddons)
+       ("ki18n" ,ki18n)
+       ("kiconthemes" ,kiconthemes)
+       ("kidentitymanagement" ,kidentitymanagement)
+       ("kimap" ,kimap)
+       ("kio" ,kio)
+       ("kitemmodels" ,kitemmodels)
+       ("kitemviews" ,kitemviews)
+       ("kjobwidgets" ,kjobwidgets)
+       ("kldap" ,kldap)
+       ("kmailcommon" ,kmailcommon)
+       ("kmailtransport" ,kmailtransport)
+       ("kmessagelib" ,kmessagelib)
+       ("kmime" ,kmime)
+       ("kmime" ,kmime)
+       ("knotifications" ,knotifications)
+       ("knotifyconfig" ,knotifyconfig)
+       ("kontactinterface" ,kontactinterface)
+       ("kparts" ,kparts)
+       ("kpimcommon" ,kpimcommon)
+       ("kpimtextedit" ,kpimtextedit)
+       ("kservice" ,kservice)
+       ("ksyntaxhighlighting" ,ksyntaxhighlighting)
+       ("ktextwidgets" ,ktextwidgets)
+       ("ktnef" ,ktnef)
+       ("kwallet" ,kwallet)
+       ("kwidgetsaddons" ,kwidgetsaddons)
+       ("kwindowsystem" ,kwindowsystem)
+       ("kxmlgui" ,kxmlgui)
+       ("libgravatar" ,libgravatar)
+       ("libkdepim" ,libkdepim)
+       ("libkleo" ,libkleo)
+       ("libksieve" ,libksieve)
+       ("oxygen-icons" ,oxygen-icons) ; default icon set, required for tests
+       ("qgpgme" ,qgpgme)
+       ("qtbase" ,qtbase)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtwebchannel" ,qtwebchannel)
+       ("qtwebengine" ,qtwebengine)
+       ("sonnet" ,sonnet)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "dbus-launch" "ctest" ".")
+             #t)))))
+    (home-page "https://kontact.kde.org/components/kmail.html")
+    (synopsis "Full featured graphical email client")
+    (description "KMail supports multiple accounts, mail filtering and email
+encryption.  The program let you configure your workflow and it has good
+integration into KDE (Plasma Desktop) but is also useable with other Desktop
+Envionments.
+
+KMail is the email component of Kontact, the integrated personal information
+manager from KDE.")
+    (license ;; GPL for programs, LGPL for libraries, FDL for documentation
+     (list license:gpl2+ license:lgpl2.0+ license:fdl1.2+))))
+
 (define-public kmailcommon
   (package
     (name "kmailcommon")
diff --git a/gnu/packages/patches/kmail-Fix-missing-link-libraries.patch b/gnu/packages/patches/kmail-Fix-missing-link-libraries.patch
new file mode 100644
index 0000000000..fc784d63dd
--- /dev/null
+++ b/gnu/packages/patches/kmail-Fix-missing-link-libraries.patch
@@ -0,0 +1,41 @@
+From 6b0a3a60870499b20ce9ae2ea07cbc5ee53cbdd2 Mon Sep 17 00:00:00 2001
+From: Hartmut Goebel <[email-masked]>
+Date: Tue, 21 Jan 2020 23:23:38 +0100
+Subject: [PATCH] Fix missing link libraries.
+
+See <https://phabricator.kde.org/D26821>
+
+These are only actually missing if the libraries reside in different
+prefixes, as it is the case in Guix or Nix.
+---
+ agents/archivemailagent/CMakeLists.txt      | 1 +
+ agents/followupreminderagent/CMakeLists.txt | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/agents/archivemailagent/CMakeLists.txt b/agents/archivemailagent/CMakeLists.txt
+index 95c6249de..d0ddcd475 100644
+--- a/agents/archivemailagent/CMakeLists.txt
++++ b/agents/archivemailagent/CMakeLists.txt
+@@ -22,6 +22,7 @@ ki18n_wrap_ui(libarchivemailagent_SRCS ui/archivemailwidget.ui )
+ add_library(archivemailagent STATIC ${libarchivemailagent_SRCS})
+ target_link_libraries(archivemailagent
+     KF5::MailCommon
++    KF5::Libkdepim
+     KF5::I18n
+     KF5::Notifications
+     KF5::KIOWidgets
+diff --git a/agents/followupreminderagent/CMakeLists.txt b/agents/followupreminderagent/CMakeLists.txt
+index 9ae7eaa29..527044807 100644
+--- a/agents/followupreminderagent/CMakeLists.txt
++++ b/agents/followupreminderagent/CMakeLists.txt
+@@ -27,6 +27,7 @@ target_link_libraries(followupreminderagent
+     KF5::AkonadiMime
+     KF5::AkonadiAgentBase
+     KF5::DBusAddons
++    KF5::FollowupReminder
+     KF5::XmlGui
+     KF5::KIOWidgets
+     KF5::Notifications
+-- 
+2.21.1
+
-- 
2.21.1