@@ -1,9 +1,10 @@
1−{ fetchurl
2−, lib
1+{ lib
32, stdenv
3+, fetchurl
44, aqbanking
55, boost
66, cmake
7+, gettext
78, glib
89, glibcLocales
910, gtest
@@ -16,7 +17,6 @@
1617, libxml2
1718, libxslt
1819, makeWrapper
19−, perl
2020, perlPackages
2121, pkg-config
2222, swig
@@ -28,13 +28,15 @@ stdenv.mkDerivation rec {
2828 pname = "gnucash";
2929 version = "4.9";
3030
31+ # raw source code doesn't work out of box; fetchFromGitHub not usable
3132 src = fetchurl {
32− url = "https://github.com/Gnucash/gnucash/releases/download/${version}/gnucash-${version}.tar.bz2";
33− sha256 = "0bdpzb0wc9bjph5iff7133ppnkcqzfd10yi2qagij4mpq4q1qmcs";
33+ url = "https://github.com/Gnucash/gnucash/releases/download/${version}/${pname}-${version}.tar.bz2";
34+ hash = "sha256-mlUcMMG3EhmfwiJ6EJr7mE177xjhOBcLvHIlxsH6ty0=";
3435 };
3536
3637 nativeBuildInputs = [
3738 cmake
39+ gettext
3840 makeWrapper
3941 wrapGAppsHook
4042 ];
@@ -53,11 +55,15 @@ stdenv.mkDerivation rec {
5355 libofx
5456 libxml2
5557 libxslt
56− perl
5758 pkg-config
5859 swig
5960 webkitgtk
60− ] ++ (with perlPackages; [ FinanceQuote DateManip ]);
61+ ]
62+ ++ (with perlPackages; [
63+ DateManip
64+ FinanceQuote
65+ perl
66+ ]);
6167
6268 patches = [
6369 # this patch disables test-gnc-timezone and test-gnc-datetime which fail due to nix datetime challenges
@@ -68,16 +74,14 @@ stdenv.mkDerivation rec {
6874 ./0003-remove-valgrind.patch
6975 ];
7076
71− preConfigure = ''
72− export GUILE_AUTO_COMPILE=0 # this needs to be an env variable and not a cmake flag to suppress guile warning
73− '';
77+ # this needs to be an environment variable and not a cmake flag to suppress
78+ # guile warning
79+ GUILE_AUTO_COMPILE="0";
7480
81+ # `make check` target does not define its prerequisites but expects them to
82+ # have already been built. The list of targets below was built through trial
83+ # and error based on failing tests.
7584 doCheck = true;
76−
77− /*
78− GNUcash's `make check` target does not define its prerequisites but expects them to have already been built.
79− The list of targets below was built through trial and error based on failing tests.
80− */
8185 preCheck = ''
8286 make \
8387 test-account-object \
@@ -156,12 +160,15 @@ stdenv.mkDerivation rec {
156160
157161 preFixup = ''
158162 gappsWrapperArgs+=(
159− --set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd # specify where db drivers are
160− --set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"} # specify where nix puts the gnome settings schemas
163+ # db drivers location
164+ --set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd
165+ # gnome settings schemas location on Nix
166+ --set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"}
161167 )
162168 '';
163169
164− # wrapGAppsHook would wrap all binaries including the cli utils which need Perl wrapping
170+ # wrapGAppsHook would wrap all binaries including the cli utils which need
171+ # Perl wrapping
165172 dontWrapGApps = true;
166173
167174 # gnucash is wrapped using the args constructed for wrapGAppsHook.
@@ -176,15 +183,31 @@ stdenv.mkDerivation rec {
176183 '';
177184
178185 meta = with lib; {
179− description = "Personal and small business double entry accounting application.";
186+ homepage = "https://www.gnucash.org/";
187+ description = "Free software for double entry accounting";
180188 longDescription = ''
181− Designed to be easy to use, yet powerful and flexible, GnuCash allows you to track bank accounts, stocks, income and expenses.
182− As quick and intuitive to use as a checkbook register, it is based on professional accounting principles to ensure balanced books and accurate reports.
183− '';
189+ GnuCash is personal and small-business financial-accounting software,
190+ freely licensed under the GNU GPL and available for GNU/Linux, BSD,
191+ Solaris, Mac OS X and Microsoft Windows.
184192
185− homepage = "https://www.gnucash.org/";
193+ Designed to be easy to use, yet powerful and flexible, GnuCash allows you
194+ to track bank accounts, stocks, income and expenses. As quick and
195+ intuitive to use as a checkbook register, it is based on professional
196+ accounting principles to ensure balanced books and accurate reports.
197+
198+ Some interesting features:
199+
200+ - Double-Entry Accounting
201+ - Stock/Bond/Mutual Fund Accounts
202+ - Small-Business Accounting
203+ - Reports, Graphs
204+ - QIF/OFX/HBCI Import, Transaction Matching
205+ - Scheduled Transactions
206+ - Financial Calculations
207+ '';
186208 license = licenses.gpl2Plus;
187− maintainers = [ maintainers.domenkozar ];
188− platforms = platforms.linux;
209+ maintainers = with maintainers; [ domenkozar AndersonTorres ];
210+ platforms = platforms.unix;
189211 };
190212}
213+# TODO: investigate Darwin support