about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-02-09 19:21:52 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-02-10 10:20:31 -0300
commitb4c1cf5e3671e8fee1a55a1cc1f0258152e62a4f (patch)
treebd7fbef8df2c67bc576b8615ba7b76d166bd6a28 /pkgs/applications/office
parentc4384583ea0cfdc5ca64f58b9597dc2e3495f928 (diff)
gnucash: refactor
Also add myself as maintainer.
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/gnucash/default.nix73
1 files changed, 48 insertions, 25 deletions
diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix
index d6e5c4143a4a2..a9d532a27c24a 100644
--- a/pkgs/applications/office/gnucash/default.nix
+++ b/pkgs/applications/office/gnucash/default.nix
@@ -1,9 +1,10 @@
-{ fetchurl
-, lib
+{ lib
 , stdenv
+, fetchurl
 , aqbanking
 , boost
 , cmake
+, gettext
 , glib
 , glibcLocales
 , gtest
@@ -16,7 +17,6 @@
 , libxml2
 , libxslt
 , makeWrapper
-, perl
 , perlPackages
 , pkg-config
 , swig
@@ -28,13 +28,15 @@ stdenv.mkDerivation rec {
   pname = "gnucash";
   version = "4.9";
 
+  # raw source code doesn't work out of box; fetchFromGitHub not usable
   src = fetchurl {
-    url = "https://github.com/Gnucash/gnucash/releases/download/${version}/gnucash-${version}.tar.bz2";
-    sha256 = "0bdpzb0wc9bjph5iff7133ppnkcqzfd10yi2qagij4mpq4q1qmcs";
+    url = "https://github.com/Gnucash/gnucash/releases/download/${version}/${pname}-${version}.tar.bz2";
+    hash = "sha256-mlUcMMG3EhmfwiJ6EJr7mE177xjhOBcLvHIlxsH6ty0=";
   };
 
   nativeBuildInputs = [
     cmake
+    gettext
     makeWrapper
     wrapGAppsHook
   ];
@@ -53,11 +55,15 @@ stdenv.mkDerivation rec {
     libofx
     libxml2
     libxslt
-    perl
     pkg-config
     swig
     webkitgtk
-  ] ++ (with perlPackages; [ FinanceQuote DateManip ]);
+  ]
+  ++ (with perlPackages; [
+    DateManip
+    FinanceQuote
+    perl
+  ]);
 
   patches = [
     # this patch disables test-gnc-timezone and test-gnc-datetime which fail due to nix datetime challenges
@@ -68,16 +74,14 @@ stdenv.mkDerivation rec {
     ./0003-remove-valgrind.patch
   ];
 
-  preConfigure = ''
-    export GUILE_AUTO_COMPILE=0 # this needs to be an env variable and not a cmake flag to suppress guile warning
-  '';
+  # this needs to be an environment variable and not a cmake flag to suppress
+  # guile warning
+  GUILE_AUTO_COMPILE="0";
 
+  # `make check` target does not define its prerequisites but expects them to
+  # have already been built.  The list of targets below was built through trial
+  # and error based on failing tests.
   doCheck = true;
-
-  /*
-    GNUcash's `make check` target does not define its prerequisites but expects them to have already been built.
-    The list of targets below was built through trial and error based on failing tests.
-  */
   preCheck = ''
     make \
       test-account-object \
@@ -156,12 +160,15 @@ stdenv.mkDerivation rec {
 
   preFixup = ''
     gappsWrapperArgs+=(
-      --set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd                                      # specify where db drivers are
-      --set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"}  # specify where nix puts the gnome settings schemas
+      # db drivers location
+      --set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd
+      # gnome settings schemas location on Nix
+      --set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"}
     )
   '';
 
-  # wrapGAppsHook would wrap all binaries including the cli utils which need Perl wrapping
+  # wrapGAppsHook would wrap all binaries including the cli utils which need
+  # Perl wrapping
   dontWrapGApps = true;
 
   # gnucash is wrapped using the args constructed for wrapGAppsHook.
@@ -176,15 +183,31 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    description = "Personal and small business double entry accounting application.";
+    homepage = "https://www.gnucash.org/";
+    description = "Free software for double entry accounting";
     longDescription = ''
-      Designed to be easy to use, yet powerful and flexible, GnuCash allows you to track bank accounts, stocks, income and expenses.
-      As quick and intuitive to use as a checkbook register, it is based on professional accounting principles to ensure balanced books and accurate reports.
-    '';
+      GnuCash is personal and small-business financial-accounting software,
+      freely licensed under the GNU GPL and available for GNU/Linux, BSD,
+      Solaris, Mac OS X and Microsoft Windows.
 
-    homepage = "https://www.gnucash.org/";
+      Designed to be easy to use, yet powerful and flexible, GnuCash allows you
+      to track bank accounts, stocks, income and expenses. As quick and
+      intuitive to use as a checkbook register, it is based on professional
+      accounting principles to ensure balanced books and accurate reports.
+
+      Some interesting features:
+
+      - Double-Entry Accounting
+      - Stock/Bond/Mutual Fund Accounts
+      - Small-Business Accounting
+      - Reports, Graphs
+      - QIF/OFX/HBCI Import, Transaction Matching
+      - Scheduled Transactions
+      - Financial Calculations
+    '';
     license = licenses.gpl2Plus;
-    maintainers = [ maintainers.domenkozar ];
-    platforms = platforms.linux;
+    maintainers = with maintainers; [ domenkozar AndersonTorres ];
+    platforms = platforms.unix;
   };
 }
+# TODO: investigate Darwin support