2021-05-20 23:08:51 +00:00
|
|
|
{ fetchurl, fetchpatch, lib, stdenv, pkg-config, makeWrapper, cmake, gtest
|
2020-04-24 23:36:52 +00:00
|
|
|
, boost, icu, libxml2, libxslt, gettext, swig, isocodes, gtk3, glibcLocales
|
|
|
|
, webkitgtk, dconf, hicolor-icon-theme, libofx, aqbanking, gwenhywfar, libdbi
|
|
|
|
, libdbiDrivers, guile, perl, perlPackages
|
|
|
|
}:
|
|
|
|
|
|
|
|
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-08-05 21:33:18 +00:00
|
|
|
dontUnpack = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
for script in ${perl}/bin/*; do
|
|
|
|
makeWrapper $script $out''${script#${perl}} \
|
|
|
|
--prefix "PERL5LIB" ":" "$PERL5LIB"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gnucash";
|
2021-08-27 14:25:00 +00:00
|
|
|
version = "4.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/gnucash/${pname}-${version}.tar.bz2";
|
2021-08-27 14:25:00 +00:00
|
|
|
sha256 = "0csp8iddhc901vv09gl5lj970g6ili696vwj4vdpkiprp7gh26r5";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes a warning about an initialized variable that kills enableDebugging gnucash builds on nix.
|
|
|
|
# This will most likely be part of the 4.7 release, it will be safe to remove then.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Gnucash/gnucash/commit/b42052464ba9701a3d1834fc58fa0deb32ab9afe.patch";
|
|
|
|
sha256 = "092957c8jqj4v70fv0ia1wpgl6x34hbwjrichxfbk5ja8l6535gc";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper cmake gtest swig ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-08-05 21:33:18 +00:00
|
|
|
boost icu libxml2 libxslt gettext isocodes gtk3 glibcLocales
|
2020-04-24 23:36:52 +00:00
|
|
|
webkitgtk dconf libofx aqbanking gwenhywfar libdbi
|
|
|
|
libdbiDrivers guile
|
|
|
|
perlWrapper perl
|
|
|
|
] ++ (with perlPackages; [ FinanceQuote DateManip ]);
|
|
|
|
|
|
|
|
propagatedUserEnvPkgs = [ dconf ];
|
|
|
|
|
|
|
|
# glib-2.62 deprecations
|
|
|
|
NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "GUILE_AUTO_COMPILE=0" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Auto-updaters don't make sense in Nix.
|
|
|
|
rm $out/bin/gnc-fq-update
|
|
|
|
|
|
|
|
# Unnecessary in the release build.
|
|
|
|
rm $out/bin/gnucash-valgrind
|
|
|
|
|
|
|
|
wrapProgram "$out/bin/gnucash" \
|
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${pname}-${version}" \
|
|
|
|
--prefix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
|
|
|
|
--prefix PERL5LIB ":" "$PERL5LIB" \
|
2020-06-18 07:06:33 +00:00
|
|
|
--set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd \
|
2021-01-15 22:18:51 +00:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: The following tests FAILED:
|
|
|
|
# 70 - test-load-c (Failed)
|
|
|
|
# 71 - test-modsysver (Failed)
|
|
|
|
# 72 - test-incompatdep (Failed)
|
|
|
|
# 73 - test-agedver (Failed)
|
|
|
|
# 77 - test-gnc-module-swigged-c (Failed)
|
|
|
|
# 78 - test-gnc-module-load-deps (Failed)
|
|
|
|
# 80 - test-gnc-module-scm-module (Failed)
|
|
|
|
# 81 - test-gnc-module-scm-multi (Failed)
|
|
|
|
preCheck = ''
|
|
|
|
export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
|
|
|
export NIX_CFLAGS_LINK="-lgtest -lgtest_main"
|
|
|
|
'';
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Personal and small-business financial-accounting application";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GnuCash is personal and small-business financial-accounting software,
|
|
|
|
freely licensed under the GNU GPL and available for GNU/Linux, BSD,
|
|
|
|
Solaris, macOS and Microsoft Windows.
|
|
|
|
|
|
|
|
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 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
homepage = "http://www.gnucash.org/";
|
|
|
|
|
2021-10-17 02:12:59 +00:00
|
|
|
maintainers = [ lib.maintainers.domenkozar ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.gnu ++ lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|