2021-04-28 06:29:54 +02:00
|
|
|
{ fetchurl, fetchpatch, lib, stdenv, pkg-config, makeWrapper, cmake, gtest
|
2018-04-23 18:27:51 +02:00
|
|
|
, boost, icu, libxml2, libxslt, gettext, swig, isocodes, gtk3, glibcLocales
|
2019-03-05 17:40:00 +01:00
|
|
|
, webkitgtk, dconf, hicolor-icon-theme, libofx, aqbanking, gwenhywfar, libdbi
|
2018-04-23 18:27:51 +02:00
|
|
|
, libdbiDrivers, guile, perl, perlPackages
|
2011-07-11 22:12:02 +02:00
|
|
|
}:
|
|
|
|
|
2018-04-23 18:27:51 +02: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 21:30:12 +02:00
|
|
|
dontUnpack = true;
|
|
|
|
|
2018-04-23 18:27:51 +02: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 16:04:14 +02:00
|
|
|
|
2012-02-18 19:47:42 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gnucash";
|
2021-08-26 20:11:54 +02:00
|
|
|
version = "4.6";
|
2009-09-30 15:11:17 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "mirror://sourceforge/gnucash/${pname}-${version}.tar.bz2";
|
2021-08-26 20:11:54 +02:00
|
|
|
sha256 = "0csp8iddhc901vv09gl5lj970g6ili696vwj4vdpkiprp7gh26r5";
|
2009-09-30 15:11:17 +02:00
|
|
|
};
|
|
|
|
|
2021-08-27 22:28:27 +02: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-07-26 21:30:12 +02:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper cmake gtest swig ];
|
2018-04-23 18:27:51 +02:00
|
|
|
|
2009-09-30 15:11:17 +02:00
|
|
|
buildInputs = [
|
2021-07-26 21:30:12 +02:00
|
|
|
boost icu libxml2 libxslt gettext isocodes gtk3 glibcLocales
|
2019-09-12 16:25:05 +02:00
|
|
|
webkitgtk dconf libofx aqbanking gwenhywfar libdbi
|
2018-06-10 17:43:55 +02:00
|
|
|
libdbiDrivers guile
|
|
|
|
perlWrapper perl
|
|
|
|
] ++ (with perlPackages; [ FinanceQuote DateManip ]);
|
2009-09-30 15:11:17 +02:00
|
|
|
|
2018-04-23 18:27:51 +02:00
|
|
|
propagatedUserEnvPkgs = [ dconf ];
|
|
|
|
|
2019-09-14 22:42:52 +02:00
|
|
|
# glib-2.62 deprecations
|
2019-10-30 03:23:29 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
|
2018-09-22 23:07:02 +02:00
|
|
|
|
2018-04-23 18:27:51 +02:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "GUILE_AUTO_COMPILE=0" ];
|
2009-09-30 15:11:17 +02:00
|
|
|
|
|
|
|
postInstall = ''
|
2013-11-10 16:56:15 +01:00
|
|
|
# Auto-updaters don't make sense in Nix.
|
|
|
|
rm $out/bin/gnc-fq-update
|
|
|
|
|
2018-04-23 18:27:51 +02:00
|
|
|
# Unnecessary in the release build.
|
|
|
|
rm $out/bin/gnucash-valgrind
|
2009-09-30 15:11:17 +02:00
|
|
|
|
2018-04-23 18:27:51 +02:00
|
|
|
wrapProgram "$out/bin/gnucash" \
|
2019-08-15 14:41:18 +02:00
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${pname}-${version}" \
|
2018-04-23 18:27:51 +02:00
|
|
|
--prefix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
|
2018-06-10 17:43:55 +02:00
|
|
|
--prefix PERL5LIB ":" "$PERL5LIB" \
|
2020-05-20 18:33:21 +02:00
|
|
|
--set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd \
|
2021-01-15 06:42:41 +01:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
|
2018-04-23 18:27:51 +02:00
|
|
|
'';
|
2015-11-18 15:25:52 +01:00
|
|
|
|
2018-04-23 18:27:51 +02: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 = ''
|
2020-01-02 01:29:34 +01:00
|
|
|
export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
2018-04-23 18:27:51 +02:00
|
|
|
export NIX_CFLAGS_LINK="-lgtest -lgtest_main"
|
|
|
|
'';
|
|
|
|
doCheck = false;
|
2011-07-11 18:38:07 +02:00
|
|
|
|
2009-09-30 15:11:17 +02:00
|
|
|
meta = {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Personal and small-business financial-accounting application";
|
2009-09-30 15:11:17 +02: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-07 00:05:18 +02:00
|
|
|
Solaris, macOS and Microsoft Windows.
|
2009-09-30 15:11:17 +02: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 06:42:41 +01:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2009-09-30 15:11:17 +02:00
|
|
|
|
2020-04-05 20:59:06 +02:00
|
|
|
homepage = "http://www.gnucash.org/";
|
2009-09-30 15:11:17 +02:00
|
|
|
|
2021-01-15 06:42:41 +01:00
|
|
|
maintainers = [ lib.maintainers.peti lib.maintainers.domenkozar ];
|
|
|
|
platforms = lib.platforms.gnu ++ lib.platforms.linux;
|
2009-09-30 15:11:17 +02:00
|
|
|
};
|
|
|
|
}
|