summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-05-05 23:46:29 +0200
committeraszlig <aszlig@nix.build>2018-05-05 23:46:29 +0200
commit8cf420e62feb9bbd53a91e89a3a579becb41816a (patch)
treeb8436bdd5ab983ae0b9c65d3c317f87cc12ec19d
parent21be546c51d12e13d0e43b78182a2fee66753ad0 (diff)
parent9e883426417b5f249a45a3cdb9fdbbd6625f8e08 (diff)
downloadnixlib-8cf420e62feb9bbd53a91e89a3a579becb41816a.tar
nixlib-8cf420e62feb9bbd53a91e89a3a579becb41816a.tar.gz
nixlib-8cf420e62feb9bbd53a91e89a3a579becb41816a.tar.bz2
nixlib-8cf420e62feb9bbd53a91e89a3a579becb41816a.tar.lz
nixlib-8cf420e62feb9bbd53a91e89a3a579becb41816a.tar.xz
nixlib-8cf420e62feb9bbd53a91e89a3a579becb41816a.tar.zst
nixlib-8cf420e62feb9bbd53a91e89a3a579becb41816a.zip
Merge pull request #39647 (Add KMyMoney)
This adds KMyMoney, a finance manager for KDE plus a few required
dependencies.

I ran the upstream test suite as well as the following manual tests:

  * 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.

On top of that, the application already is being used by the person
requesting me to package this, so I'd guess it works well enough.

I'm merging this without the review from @ttuegel because it only adds
packages and doesn't change anything fundamental about the KDE
ecosystem.

The only change here is to add C++ support to "mpir", where the
maintainer (@7c6f434c) has approved the change.
-rw-r--r--pkgs/applications/office/kmymoney/default.nix70
-rw-r--r--pkgs/development/libraries/alkimia/default.nix31
-rw-r--r--pkgs/development/libraries/kde-frameworks/default.nix1
-rw-r--r--pkgs/development/libraries/kde-frameworks/kdewebkit.nix11
-rw-r--r--pkgs/development/libraries/mpir/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix7
6 files changed, 122 insertions, 0 deletions
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/development/libraries/alkimia/default.nix b/pkgs/development/libraries/alkimia/default.nix
new file mode 100644
index 000000000000..6f4fd09015e5
--- /dev/null
+++ b/pkgs/development/libraries/alkimia/default.nix
@@ -0,0 +1,31 @@
+{ 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";
+    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;
+  };
+}
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" ];
+}
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'';
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9dc4d0952f78..01f666d37fc4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -11229,6 +11229,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 { };
@@ -16533,6 +16535,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 { };