2021-12-11 20:52:06 +00:00
|
|
|
{ fetchurl, lib, stdenv, pkg-config, makeWrapper, cmake, gtest
|
2018-04-23 17:27:51 +01:00
|
|
|
, boost, icu, libxml2, libxslt, gettext, swig, isocodes, gtk3, glibcLocales
|
2019-03-05 16:40:00 +00:00
|
|
|
, webkitgtk, dconf, hicolor-icon-theme, libofx, aqbanking, gwenhywfar, libdbi
|
2018-04-23 17:27:51 +01:00
|
|
|
, libdbiDrivers, guile, perl, perlPackages
|
2011-07-11 21:12:02 +01:00
|
|
|
}:
|
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
# Enable gnc-fq-* to run in command line.
|
|
|
|
perlWrapper = stdenv.mkDerivation {
|
|
|
|
name = perl.name + "-wrapper-for-gnucash";
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl ] ++ (with perlPackages; [ FinanceQuote DateManip ]);
|
2021-07-26 20:30:12 +01:00
|
|
|
dontUnpack = true;
|
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
for script in ${perl}/bin/*; do
|
|
|
|
makeWrapper $script $out''${script#${perl}} \
|
|
|
|
--prefix "PERL5LIB" ":" "$PERL5LIB"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2011-07-10 15:04:14 +01:00
|
|
|
|
2012-02-18 18:47:42 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gnucash";
|
2021-12-11 20:52:06 +00:00
|
|
|
version = "4.8";
|
2009-09-30 14:11:17 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "mirror://sourceforge/gnucash/${pname}-${version}.tar.bz2";
|
2021-12-11 20:52:06 +00:00
|
|
|
sha256 = "04pbgx08lfm3l46ndd28ivq5yp3y6zgalbzgi2x8w5inhgzy9f0m";
|
2009-09-30 14:11:17 +01:00
|
|
|
};
|
|
|
|
|
2021-07-26 20:30:12 +01:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper cmake gtest swig ];
|
2018-04-23 17:27:51 +01:00
|
|
|
|
2009-09-30 14:11:17 +01:00
|
|
|
buildInputs = [
|
2021-07-26 20:30:12 +01:00
|
|
|
boost icu libxml2 libxslt gettext isocodes gtk3 glibcLocales
|
2019-09-12 15:25:05 +01:00
|
|
|
webkitgtk dconf libofx aqbanking gwenhywfar libdbi
|
2018-06-10 16:43:55 +01:00
|
|
|
libdbiDrivers guile
|
|
|
|
perlWrapper perl
|
|
|
|
] ++ (with perlPackages; [ FinanceQuote DateManip ]);
|
2009-09-30 14:11:17 +01:00
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
propagatedUserEnvPkgs = [ dconf ];
|
|
|
|
|
2019-09-14 21:42:52 +01:00
|
|
|
# glib-2.62 deprecations
|
2019-10-30 02:23:29 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
|
2018-09-22 22:07:02 +01:00
|
|
|
|
2021-12-11 20:52:06 +00:00
|
|
|
# this patch disables test-gnc-timezone and test-gnc-datetime which fail due to nix datetime challenges
|
|
|
|
patches = [ ./0001-changes.patch ];
|
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "GUILE_AUTO_COMPILE=0" ];
|
2009-09-30 14:11:17 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
2013-11-10 15:56:15 +00:00
|
|
|
# Auto-updaters don't make sense in Nix.
|
|
|
|
rm $out/bin/gnc-fq-update
|
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
# Unnecessary in the release build.
|
|
|
|
rm $out/bin/gnucash-valgrind
|
2009-09-30 14:11:17 +01:00
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
wrapProgram "$out/bin/gnucash" \
|
2019-08-15 13:41:18 +01:00
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${pname}-${version}" \
|
2018-04-23 17:27:51 +01:00
|
|
|
--prefix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
|
2018-06-10 16:43:55 +01:00
|
|
|
--prefix PERL5LIB ":" "$PERL5LIB" \
|
2020-05-20 17:33:21 +01:00
|
|
|
--set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd \
|
2021-01-15 05:42:41 +00:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
|
2018-04-23 17:27:51 +01:00
|
|
|
'';
|
2015-11-18 14:25:52 +00:00
|
|
|
|
2021-12-11 20:52:06 +00:00
|
|
|
/*
|
|
|
|
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.
|
|
|
|
*/
|
2018-04-23 17:27:51 +01:00
|
|
|
preCheck = ''
|
2021-12-11 20:52:06 +00:00
|
|
|
export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test:$PWD/lib/gnucash/test/future''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
2018-04-23 17:27:51 +01:00
|
|
|
export NIX_CFLAGS_LINK="-lgtest -lgtest_main"
|
2021-12-11 20:52:06 +00:00
|
|
|
make test-scm-query test-split-register-copy-ops test-link-ofx test-import-backend test-import-account-matcher test-import-pending-matches test-qofquerycore test-import-map test-gnc-numeric test-gnc-rational test-gnc-int128 test-qofsession test-kvp-value test-gnc-guid test-numeric test-vendor test-job test-employee test-customer test-address test-business test-recurrence test-transaction-voiding test-transaction-reversal test-split-vs-account test-tokenizer test-aqb test-import-parse test-link-module-tax-us test-dynload test-agedver test-incompatdep test-modsysver test-load-c test-gnc-path-util test-xml2-is-file test-load-example-account test-query test-querynew test-lots test-group-vs-book test-account-object test-engine test-qof test-commodities test-object test-guid test-load-engine test-userdata-dir-invalid-home test-userdata-dir test-resolve-file-path test-gnc-glib-utils test-sqlbe test-column-types test-backend-dbi test-xml-transaction test-xml-pricedb test-xml-commodity test-xml-account test-string-converters test-load-backend test-kvp-frames test-dom-converters1 test-autoclear test-sx test-print-parse-amount gncmod-futuremodsys
|
2018-04-23 17:27:51 +01:00
|
|
|
'';
|
2021-12-11 20:52:06 +00:00
|
|
|
doCheck = true;
|
2011-07-11 17:38:07 +01:00
|
|
|
|
2009-09-30 14:11:17 +01:00
|
|
|
meta = {
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "Personal and small-business financial-accounting application";
|
2009-09-30 14:11:17 +01:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GnuCash is personal and small-business financial-accounting software,
|
|
|
|
freely licensed under the GNU GPL and available for GNU/Linux, BSD,
|
2017-08-06 23:05:18 +01:00
|
|
|
Solaris, macOS and Microsoft Windows.
|
2009-09-30 14:11:17 +01:00
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2009-09-30 14:11:17 +01:00
|
|
|
|
2020-04-05 19:59:06 +01:00
|
|
|
homepage = "http://www.gnucash.org/";
|
2009-09-30 14:11:17 +01:00
|
|
|
|
2021-10-14 09:59:33 +01:00
|
|
|
maintainers = [ lib.maintainers.domenkozar ];
|
2021-01-15 05:42:41 +00:00
|
|
|
platforms = lib.platforms.gnu ++ lib.platforms.linux;
|
2009-09-30 14:11:17 +01:00
|
|
|
};
|
|
|
|
}
|