Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KDE PIM Applications #27224

Merged
merged 100 commits into from
Aug 21, 2017
Merged

KDE PIM Applications #27224

merged 100 commits into from
Aug 21, 2017

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Jul 7, 2017

Motivation

This would add the KDE PIM application suite to Nixpkgs.

Testing

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This is my second attempt. It is correctly rebased to master this time! Again, credit here should go to @vandenoever.

@mention-bot
Copy link

@ttuegel, thanks for your PR! By analyzing the history of the files in this pull request, we identified @peterhoeg, @vandenoever and @phunehehe to be potential reviewers.

@vandenoever
Copy link
Contributor

@ttuegel Wow, that's a lot of work again. I noticed today that this is now on top of the merged 'Unwrap Qt 5 packages' PR. I'll put a vm to work so I can test this.

@0xABAB
Copy link
Contributor

0xABAB commented Jul 8, 2017

It looks as if it's program output.

@vandenoever
Copy link
Contributor

When I start kmail in clean environment on a non-kde desktop (lumina), it crashes when doing the first run wizard. It says: "The Email program encountered a fatal error and will terminate now.
The error was:
Invalid parent"

Maybe it's due to the kuiserver not being found.

@vandenoever
Copy link
Contributor

kmail has no icons. Installing oxygen with nix-env does not solve that issue.

I can run kmail for a second time and then it does not crash. I can then choose a maildir. This causes 1000's of messages to the console:

org.kde.pim.akonadicore: Resource id's don't match: "akonadi_maildir_resource_1" "akonadi.maildir_resource_0"

This is in a clean home directory.

The 'invalid parent' error also happens when running in a plasma5 environment.

In a plasma5 environment, the icons are present and I can configure a maildir and read mails there. This is more functionality than any previous attempt! In fact, it's better than kmail 1 because search works.

@ttuegel
Copy link
Member Author

ttuegel commented Jul 10, 2017

Installing oxygen with nix-env does not solve that issue.

oxygen is not used by KF5 applications. Does it work with breeze-icons? You will probably also have to set up a Qt 5 theme using, e.g. qt5ct to select a platform integration. The default platform integration shipped with Qt 5 doesn't use icons AFAICT.

The 'invalid parent' error also happens when running in a plasma5 environment.

Is this really the ultimate cause? When kmail starts, I get lots of warnings about "invalid parent" due to kwallet, but everything proceeds to start. I wonder if it is just reporting the last message as the "error".

@vandenoever
Copy link
Contributor

Simply installing 'breeze-icons' does not give kmail icons.

'qt5ct' on lumina tells me 'The QT_QPA_PLATFORMTHEME environment variable is not set correctly'.

But most importantly, without the rest of kde, the maildir does not work. Probably other mail plugins also do not work.

One of the errors is "Error loading KCM plugin "kcm_kmail" "The shared library was not found."

The 'invalid parent' only happens the first time when logging into a fresh plasma and starting kmail for the first time.

@ttuegel
Copy link
Member Author

ttuegel commented Jul 12, 2017

Simply installing 'breeze-icons' does not give kmail icons.

'qt5ct' on lumina tells me 'The QT_QPA_PLATFORMTHEME environment variable is not set correctly'.

Yes, there is some special value you must set for QT_QPA_PLATFORMTHEME to have qt5ct work correctly. I don't remember the magic word, but it is in the documentation on the qt5ct homepage.

I am going to try to track down this error,

But most importantly, without the rest of kde, the maildir does not work. Probably other mail plugins also do not work.

One of the errors is "Error loading KCM plugin "kcm_kmail" "The shared library was not found."

assuming for the moment that the missing icons are not related to this problem, because I have gotten that error before, yet I see all the icons!

@grahamc
Copy link
Member

grahamc commented Jul 22, 2017

@ttuegel how can I help get this merged?

@vandenoever
Copy link
Contributor

/me is at akademy atm and could discuss any issues with kde pim people in person.

@silverhook
Copy link
Contributor

@vandenoever It’d be lovely if you could. KDE PIM is IMHO one of the few big things still missing in NixOS.

P.S. Say hi for me to everyone at Akademy. Sadly this year it clashes with a work retreat, so I can’t attend.

Copy link
Member

@peterhoeg peterhoeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thank you so much for doing this!

}:

mkDerivation {
name = "akonadi";
meta = {
license = [ lib.licenses.lgpl21 ];
maintainers = [ lib.maintainers.ttuegel ];
maintainers = kdepimTeam;
};
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for copying patches to the store?

maintainers = kdepimTeam;
};
output = [ "out" "dev" ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A one-liner on why the patches are needed would be great.

@@ -78,7 +78,7 @@
version = "17.04.2";
src = fetchurl {
url = "${mirror}/stable/applications/17.04.2/src/akregator-17.04.2.tar.xz";
sha256 = "0ngpw432pm57p34y4wcvrxlrlmixlgrpqawgn2b73dhvb2m8ypvy";
sha256 = "0r91kjxggds46s0vzygkvjckqiyw5kx0jbb38paniynviqz72zwi";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are all the checksums changing if the version isn't?

@vandenoever
Copy link
Contributor

nix-shell -p kmail

gives

mkdir: cannot create directory ‘/home/oever/nixpkgs/__nix_qt5__/bin’: File exists

I do not know how to suppress that.

Then running kmail gives:

kmail(25316)/default unknown: This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".                                                                          
                                                                                
Reinstalling the application may fix this problem.                              
Aborted                                                                         

This is because all applications that use QtWebRender require X and the use of xcb is hardcoded even though the desktop maybe using a different QPA (Qt Platform Abstraction plugin).

https://cgit.kde.org/kmail.git/tree/src/main.cpp?h=v17.04.3#n108

One solution is to patch that out, another is to get xcb to work. xcb is currently installed.

/nix/store/*-qtbase-5.9.0-bin/lib/qt-5.9/plugins/platforms/libqxcb.so

@vandenoever
Copy link
Contributor

I can get the GUI of kmail visible with this:

export QT_PLUGIN_PATH="/nix/store/4mr1rflvn9s25h9c6mykry7b422nxh0p-qtbase-5.9.0-bin/lib/qt-5.9/plugins"
kmail

which then gives this error:

The Email program encountered a fatal error and will terminate now. The error was: Unable to obtain agent type ''.

@vandenoever
Copy link
Contributor

I tried patching kmail.nix:

diff --git a/pkgs/applications/kde/kmail.nix b/pkgs/applications/kde/kmail.nix
index ec8c989277..6eb7cca3c1 100644
--- a/pkgs/applications/kde/kmail.nix
+++ b/pkgs/applications/kde/kmail.nix
@@ -1,5 +1,5 @@
 {
-  mkDerivation, lib, kdepimTeam,
+  mkDerivation, makeWrapper, lib, kdepimTeam,
   extra-cmake-modules, kdoctools,
   akonadi-search, kbookmarks, kcalutils, kcmutils, kcompletion, kconfig,
   kconfigwidgets, kcoreaddons, kdelibs4support, kdepim-apps-libs,
@@ -18,6 +18,7 @@ mkDerivation {
   };
   nativeBuildInputs = [ extra-cmake-modules kdoctools ];
   buildInputs = [
+    makeWrapper
     akonadi-search kbookmarks kcalutils kcmutils kcompletion kconfig
     kconfigwidgets kcoreaddons kdelibs4support kdepim-apps-libs kguiaddons ki18n
     kiconthemes kinit kio kldap kmail-account-wizard kmailtransport
@@ -26,4 +27,10 @@ mkDerivation {
     libksieve mailcommon messagelib pim-sieve-editor qtscript qtwebengine
   ];
   propagatedUserEnvPkgs = [ kdepim-runtime kwallet ];
+  installPhase = ''
+    $preInstallHooks
+    wrapProgram $out/bin/kmail \
+        --prefix QT_PLUGIN_PATH "$qtbase/lib/qt-5.9/plugins"
+    $postInstallHooks
+  '';
 }
mv: cannot stat '/nix/store/vdvmzpfgw72vp7n3ggrjzn2qw0nwqky5-kmail-17.04.2/bin/kmail': No such file or directory
builder for ‘/nix/store/msvlp2ggmjzzc5mpj1ycdqf90dfxlrxl-kmail-17.04.2.drv’ failed with exit code 1
error: build of ‘/nix/store/msvlp2ggmjzzc5mpj1ycdqf90dfxlrxl-kmail-17.04.2.drv’ failed

@vandenoever
Copy link
Contributor

It turns out that if you simply install kmail with nix-env -f. -i kmail, it almost works fine.

All that's needed is to add $kmail/share to XDG_DATA_DIRS to make the Settings > Configure KMail menu work.

This small snippet is a workaround for that.

XDG_DATA_DIRS="$(dirname "$(dirname "$(realpath "$(type -P kmail)")")")/share:$XDG_DATA_DIRS" kmail

@vandenoever
Copy link
Contributor

The situation with Configure KMail is even weirder.

it works when kmail is started from KRunner or xterm, but not if it is started from konsole.

And sending mails does not work yet because the kio plugin for smtp is not found.

akonadi_maildispatcher_agent(589)/kf5.kio.core unknown: couldn't create slave: "klauncher said: Kon de plug-in 'kf5/kio/smtp' niet vinden.\n

@vandenoever
Copy link
Contributor

The situation with Configure KMail is even weirder.

it works when kmail is started from KRunner or xterm, but not if it is started from konsole.

And sending mails does not work yet because the kio plugin for smtp is not found.

akonadi_maildispatcher_agent(589)/kf5.kio.core unknown: couldn't create slave: "klauncher said: Kon de plug-in 'kf5/kio/smtp' niet vinden.\n

I've now made one adaptation to my environment which makes this all work.

~/.config/plasma-workspace/env/env.sh

export KDE_FORK_SLAVES=1

@aszlig
Copy link
Member

aszlig commented Jul 27, 2017

@ttuegel: Maybe it's a good idea to use the following one-liner to rewrite the author to @vandenoever:

git filter-branch --env-filter 'export GIT_AUTHOR_NAME="Jos van den Oever" GIT_AUTHOR_EMAIL="jos@vandenoever.info"' master..HEAD

@vandenoever
Copy link
Contributor

Please update to 17.04.3 before merging this. KMail has an annoying bug where moving multiple mails does not update the data model of the user interface.

@zraexy
Copy link
Member

zraexy commented Aug 11, 2017

Is this going to be merged before the 17.09 branch off?

@vandenoever
Copy link
Contributor

I'd be in favor of that. i've been using this package for a few weeks now.

Probably even better would be if 17.09 could include KDE Applications 17.08.

https://community.kde.org/Schedules/Applications/17.08_Release_Schedule

@vandenoever
Copy link
Contributor

Prepackages for 17.08 are here:

https://download.kde.org/unstable/applications/17.07.90/src/

@vandenoever vandenoever mentioned this pull request Aug 19, 2017
8 tasks
QStringLiteral stores strings in UTF-16 encoding. Nix cannot decode such paths,
so we must use QLatin1String for strings that may be paths, or the dependency
graph will be broken!
qgpgme uses Q_ASSERT which causes build inputs to be retained unnecessarily at
runtime unless debugging is disabled.
This reverts commit cb922bbd5855aba00b96f223dce50c4556472a25.
This reverts commit a6d746fbd12a6633e775e2cb52793f4baa8bab36.
Use plain unzip instead of unzipNLS, which is unnecessary and also broken.
@ttuegel
Copy link
Member Author

ttuegel commented Aug 21, 2017

I'm satisfied now that, while this is not perfect, the best way to move forward is to merge to get this into the hands of users.

@ttuegel ttuegel merged commit 50a9f98 into NixOS:master Aug 21, 2017
@ttuegel ttuegel deleted the kdepim branch August 21, 2017 18:47
@vandenoever
Copy link
Contributor

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants