From 6134887bef5357ccda4d81aef78182217df4c3ed Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 27 Apr 2018 15:52:00 +0200 Subject: [PATCH 1/5] mpir: Build with C++ support This is needed by Alkimia which I'm going to package soon as part of KMyMoney. I enabled this by default, because it doesn't increase the closure size a whole lot (only around 150 KiB): $ nix-store -q --size /nix/store/...old...-mpir-3.0.0 1223248 $ nix-store -q --size /nix/store/...new...-mpir-3.0.0 1377136 Introducing an option for enabling/disabling this is not worth it, because it doesn't conflict with anything and the size increase is the only drawback and we can still make it configurable if we want someday. Signed-off-by: aszlig Cc: @7c6f434c --- pkgs/development/libraries/mpir/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/mpir/default.nix b/pkgs/development/libraries/mpir/default.nix index cbcf83f1d322..b9b25e7f43b3 100644 --- a/pkgs/development/libraries/mpir/default.nix +++ b/pkgs/development/libraries/mpir/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { sha256 = "1fvmhrqdjs925hzr2i8bszm50h00gwsh17p2kn2pi51zrxck9xjj"; }; + configureFlags = [ "--enable-cxx" ]; + meta = { inherit version; description = ''A highly optimised library for bignum arithmetic forked from GMP''; From 5370b8267c94bf5762683746f537c002f0ea3ac6 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 28 Apr 2018 01:21:25 +0200 Subject: [PATCH 2/5] kdewebkit: Add package expression This is one of the requirements of KMyMoney and packaging is quite straightforward with no unexpected traps. Signed-off-by: aszlig Cc: @ttuegel --- pkgs/development/libraries/kde-frameworks/default.nix | 1 + .../libraries/kde-frameworks/kdewebkit.nix | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 pkgs/development/libraries/kde-frameworks/kdewebkit.nix diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix index f54139836b1d..d780fc30a4c2 100644 --- a/pkgs/development/libraries/kde-frameworks/default.nix +++ b/pkgs/development/libraries/kde-frameworks/default.nix @@ -155,6 +155,7 @@ let kded = callPackage ./kded.nix {}; kdesignerplugin = callPackage ./kdesignerplugin.nix {}; kdesu = callPackage ./kdesu.nix {}; + kdewebkit = callPackage ./kdewebkit.nix {}; kemoticons = callPackage ./kemoticons.nix {}; kglobalaccel = callPackage ./kglobalaccel.nix {}; kiconthemes = callPackage ./kiconthemes {}; diff --git a/pkgs/development/libraries/kde-frameworks/kdewebkit.nix b/pkgs/development/libraries/kde-frameworks/kdewebkit.nix new file mode 100644 index 000000000000..b7dcfb7fe64c --- /dev/null +++ b/pkgs/development/libraries/kde-frameworks/kdewebkit.nix @@ -0,0 +1,11 @@ +{ mkDerivation, extra-cmake-modules +, kconfig, kcoreaddons, kio, kparts, qtwebkit +}: + +mkDerivation { + name = "kdewebkit"; + nativeBuildInputs = [ extra-cmake-modules ]; + buildInputs = [ kconfig kcoreaddons kio kparts ]; + propagatedBuildInputs = [ qtwebkit ]; + outputs = [ "out" "dev" ]; +} From d2b8d8bddc40734b14e9b04039a1ae5415a60b4d Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 28 Apr 2018 01:32:32 +0200 Subject: [PATCH 3/5] alkimia: init at 7.0.1 This is used by KMyMoney and also the reason why I needed to add C++ support to MPIR in the parent commit. The reason why I didn't add myself as a maintainer is because I'm not personally using KMyMoney and thus Alkimia. Signed-off-by: aszlig --- .../development/libraries/alkimia/default.nix | 24 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/libraries/alkimia/default.nix diff --git a/pkgs/development/libraries/alkimia/default.nix b/pkgs/development/libraries/alkimia/default.nix new file mode 100644 index 000000000000..495c5118e742 --- /dev/null +++ b/pkgs/development/libraries/alkimia/default.nix @@ -0,0 +1,24 @@ +{ mkDerivation, fetchurl, lib +, extra-cmake-modules, doxygen, graphviz, qtbase, mpir +}: + +mkDerivation rec { + name = "alkimia-${version}"; + version = "7.0.1"; + + src = fetchurl { + url = "mirror://kde/stable/alkimia/${version}/src/${name}.tar.xz"; + sha256 = "1fri76465058fgsyrmdrc3hj1javz4g10mfzqp5rsj7qncjr1i22"; + }; + + nativeBuildInputs = [ extra-cmake-modules doxygen graphviz ]; + + buildInputs = [ qtbase ]; + propagatedBuildInputs = [ mpir ]; + + meta = { + description = "Library used by KDE finance applications"; + license = lib.licenses.lgpl21Plus; + platforms = qtbase.meta.platforms; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3795cce452a9..213bdcc784ea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11181,6 +11181,8 @@ with pkgs; accounts-qt = callPackage ../development/libraries/accounts-qt { }; + alkimia = callPackage ../development/libraries/alkimia { }; + fcitx-qt5 = callPackage ../tools/inputmethods/fcitx/fcitx-qt5.nix { }; qgpgme = callPackage ../development/libraries/gpgme { }; From 93042b7376139fca94e1223a7a5803399806ef61 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 28 Apr 2018 02:21:22 +0200 Subject: [PATCH 4/5] kmymoney: init at 5.0.1 I tried to use -DENABLE_SQLCIPHER and also passed the right directories to the Qt 5 source of the QSQLiteDriver but CMake then failed to run qt4_automoc, by which I'd imply that SQLCipher is not maintained anymore (after all KMyMoney using qgpgme as well, which doesn't require sources). Another odd thing is that CMake reports that the weboob plugin is disabled, but after inspecting it turns out that the reporting is just wrong. This is already fixed upstream but not yet released in KDE/kmymoney@8b086cf921879770971e9331f005339bfacdc84c. In addition of running the upstream test suite I have manually tested a few things in a VM by using the following Nix expression: (import { configuration = { pkgs, ... }: { environment.systemPackages = with pkgs; [ kmymoney aqbanking gwenhywfar libchipcard python2Packages.weboob kgpg ]; users.users.test.isNormalUser = true; virtualisation.diskSize = 4096; virtualisation.memorySize = 2048; services.xserver = { enable = true; inherit ((import {}).config.services.xserver) layout; displayManager.sddm.enable = true; displayManager.sddm.autoLogin.enable = true; displayManager.sddm.autoLogin.user = "test"; desktopManager.default = "plasma5"; desktopManager.plasma5.enable = true; }; }; }).vm The things I have tested in particular are: * Basic startup * Completing the wizard * Add some test transactions * GPG encryption * Generation of charts and reports * Rough check whether OFX integration lists supported financial institutions. * Small check of AqBanking implementation, whether accounts and users can be configured, but didn't test actual connectivity with a financial institution. * Check of Weboob integration with a test PayPal backend, however also just with a dummy account and without actually connecting to PayPal. One of the upstream tests "reports-chart-test" seems to fail even though generating charts and reports are working when testing manually. It also seems that this is the case on other distributions, for example Gentoo has disabled that test as well: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5169cec68fa6fd67841 Note that I didn't add myself as a maintainer because I'm not personally using KMyMoney but just packaged it for someone else. I hope this is useful for other people, so that maybe someday[TM] there will be a proper maintainer. Signed-off-by: aszlig Cc: @ttuegel --- pkgs/applications/office/kmymoney/default.nix | 70 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++ 2 files changed, 75 insertions(+) create mode 100644 pkgs/applications/office/kmymoney/default.nix diff --git a/pkgs/applications/office/kmymoney/default.nix b/pkgs/applications/office/kmymoney/default.nix new file mode 100644 index 000000000000..212aaa5fa2c4 --- /dev/null +++ b/pkgs/applications/office/kmymoney/default.nix @@ -0,0 +1,70 @@ +{ stdenv, lib, fetchurl, doxygen, extra-cmake-modules, graphviz, kdoctools + +, akonadi, alkimia, aqbanking, gmp, gwenhywfar, kactivities, karchive +, kcmutils, kcontacts, kdewebkit, kdiagram, kholidays, kidentitymanagement +, kitemmodels, libical, libofx, qgpgme + +# Needed for running tests: +, qtbase, xvfb_run + +# For weboob, which only supports Python 2.x: +, python2Packages +}: + +stdenv.mkDerivation rec { + name = "kmymoney-${version}"; + version = "5.0.1"; + + src = fetchurl { + url = "mirror://kde/stable/kmymoney/${version}/src/${name}.tar.xz"; + sha256 = "1c9apnvc07y17pzy4vygry1dai5ass2z7j354lrcppa85b18yvnx"; + }; + + # Hidden dependency that wasn't included in CMakeLists.txt: + NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5"; + + enableParallelBuilding = true; + + nativeBuildInputs = [ + doxygen extra-cmake-modules graphviz kdoctools python2Packages.wrapPython + ]; + + buildInputs = [ + akonadi alkimia aqbanking gmp gwenhywfar kactivities karchive kcmutils + kcontacts kdewebkit kdiagram kholidays kidentitymanagement kitemmodels + libical libofx qgpgme + + # Put it into buildInputs so that CMake can find it, even though we patch + # it into the interface later. + python2Packages.weboob + ]; + + weboobPythonPath = [ python2Packages.weboob ]; + + postInstall = '' + buildPythonPath "$weboobPythonPath" + patchPythonScript "$out/share/kmymoney/weboob/kmymoneyweboob.py" + + # Within the embedded Python interpreter, sys.argv is unavailable, so let's + # assign it to a dummy value so that the assignment of sys.argv[0] injected + # by patchPythonScript doesn't fail: + sed -i -e '1i import sys; sys.argv = [""]' \ + "$out/share/kmymoney/weboob/kmymoneyweboob.py" + ''; + + doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform; + installCheckPhase = let + pluginPath = "${qtbase.bin}/${qtbase.qtPluginPrefix}"; + in lib.optionalString doInstallCheck '' + QT_PLUGIN_PATH=${lib.escapeShellArg pluginPath} CTEST_OUTPUT_ON_FAILURE=1 \ + ${xvfb_run}/bin/xvfb-run -s '-screen 0 1024x768x24' make test \ + ARGS="-E '(reports-chart-test)'" # Test fails, so exclude it for now. + ''; + + meta = { + description = "Personal finance manager for KDE"; + homepage = https://kmymoney.org/; + platforms = lib.platforms.linux; + license = lib.licenses.gpl2Plus; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 213bdcc784ea..329c6fb81056 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16476,6 +16476,11 @@ with pkgs; kmplayer = libsForQt5.callPackage ../applications/video/kmplayer { }; + kmymoney = libsForQt5.callPackage ../applications/office/kmymoney { + inherit (kdeApplications) kidentitymanagement; + inherit (kdeFrameworks) kdewebkit; + }; + kodestudio = callPackage ../applications/editors/kodestudio { }; konversation = libsForQt5.callPackage ../applications/networking/irc/konversation { }; From 9e883426417b5f249a45a3cdb9fdbbd6625f8e08 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 28 Apr 2018 13:53:07 +0200 Subject: [PATCH 5/5] alkimia: Add meta.longDescription @7c6f434c wrote in [1]: Maybe copy-paste the upstream "Alkimia is the infrastructure for common storage and business logic that will be used by all financial applications in KDE. The target is to share financial related information over application bounderies." as longDescription for Alkimia? The current description makes me want to look up the homepage to find out what it actually is (then I do, and despair). [1]: https://github.com/NixOS/nixpkgs/pull/39647#issuecomment-385169261 Signed-off-by: aszlig --- pkgs/development/libraries/alkimia/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/alkimia/default.nix b/pkgs/development/libraries/alkimia/default.nix index 495c5118e742..6f4fd09015e5 100644 --- a/pkgs/development/libraries/alkimia/default.nix +++ b/pkgs/development/libraries/alkimia/default.nix @@ -18,6 +18,13 @@ mkDerivation rec { meta = { description = "Library used by KDE finance applications"; + longDescription = '' + Alkimia is the infrastructure for common storage and business + logic that will be used by all financial applications in KDE. + + The target is to share financial related information over + application bounderies. + ''; license = lib.licenses.lgpl21Plus; platforms = qtbase.meta.platforms; };