2022-02-20 05:27:41 +00:00
|
|
|
{ lib
|
2022-01-22 01:22:15 +00:00
|
|
|
, stdenv
|
2022-02-20 05:27:41 +00:00
|
|
|
, fetchurl
|
2022-01-22 01:22:15 +00:00
|
|
|
, aqbanking
|
|
|
|
, boost
|
|
|
|
, cmake
|
2022-02-20 05:27:41 +00:00
|
|
|
, gettext
|
2022-01-22 01:22:15 +00:00
|
|
|
, glib
|
|
|
|
, glibcLocales
|
|
|
|
, gtest
|
|
|
|
, guile
|
|
|
|
, gwenhywfar
|
|
|
|
, icu
|
|
|
|
, libdbi
|
|
|
|
, libdbiDrivers
|
|
|
|
, libofx
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, makeWrapper
|
|
|
|
, perlPackages
|
|
|
|
, pkg-config
|
|
|
|
, swig
|
|
|
|
, webkitgtk
|
|
|
|
, wrapGAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gnucash";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "5.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
# raw source code doesn't work out of box; fetchFromGitHub not usable
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2022-02-20 05:27:41 +00:00
|
|
|
url = "https://github.com/Gnucash/gnucash/releases/download/${version}/${pname}-${version}.tar.bz2";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-FFjLCMWF6unXJL7G8oErzAO76D7SlKRqeJeqqwGm8Vo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-22 01:22:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-02-20 05:27:41 +00:00
|
|
|
gettext
|
2022-01-22 01:22:15 +00:00
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
2022-10-21 18:38:19 +00:00
|
|
|
pkg-config
|
2022-01-22 01:22:15 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2022-01-22 01:22:15 +00:00
|
|
|
aqbanking
|
|
|
|
boost
|
|
|
|
glib
|
|
|
|
glibcLocales
|
|
|
|
gtest
|
|
|
|
guile
|
|
|
|
gwenhywfar
|
|
|
|
icu
|
|
|
|
libdbi
|
|
|
|
libdbiDrivers
|
|
|
|
libofx
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
swig
|
|
|
|
webkitgtk
|
2022-02-20 05:27:41 +00:00
|
|
|
]
|
|
|
|
++ (with perlPackages; [
|
2023-05-24 13:37:59 +00:00
|
|
|
JSONParse
|
2022-02-20 05:27:41 +00:00
|
|
|
FinanceQuote
|
|
|
|
perl
|
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-22 01:22:15 +00:00
|
|
|
patches = [
|
|
|
|
# this patch disables test-gnc-timezone and test-gnc-datetime which fail due to nix datetime challenges
|
|
|
|
./0001-disable-date-and-time-tests.patch
|
|
|
|
# this patch prevents the building of gnc-fq-update, a utility which updates the GnuCash cli utils
|
|
|
|
./0002-disable-gnc-fq-update.patch
|
|
|
|
# this patch prevents the building of gnucash-valgrind
|
|
|
|
./0003-remove-valgrind.patch
|
2023-05-24 13:37:59 +00:00
|
|
|
# this patch makes gnucash exec the Finance::Quote wrapper directly
|
|
|
|
./0004-exec-fq-wrapper.patch
|
|
|
|
# this patch removes the online_wiggle GncQuotes test
|
|
|
|
./0005-remove-gncquotes-online-wiggle.patch
|
2022-01-22 01:22:15 +00:00
|
|
|
];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
# this needs to be an environment variable and not a cmake flag to suppress
|
|
|
|
# guile warning
|
2023-05-24 13:37:59 +00:00
|
|
|
env.GUILE_AUTO_COMPILE = "0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
|
2023-02-16 17:41:37 +00:00
|
|
|
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc
|
|
|
|
"-Wno-error=use-after-free"
|
2023-03-04 12:14:45 +00:00
|
|
|
]);
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2022-01-22 01:22:15 +00:00
|
|
|
doCheck = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
enableParallelChecking = true;
|
|
|
|
checkTarget = "check";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-22 01:22:15 +00:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
2022-02-20 05:27:41 +00:00
|
|
|
# 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}"}
|
2022-01-22 01:22:15 +00:00
|
|
|
)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
# wrapGAppsHook would wrap all binaries including the cli utils which need
|
|
|
|
# Perl wrapping
|
2022-01-22 01:22:15 +00:00
|
|
|
dontWrapGApps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-22 01:22:15 +00:00
|
|
|
# gnucash is wrapped using the args constructed for wrapGAppsHook.
|
|
|
|
# gnc-fq-* are cli utils written in Perl hence the extra wrapping
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/gnucash "''${gappsWrapperArgs[@]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
wrapProgram $out/bin/finance-quote-wrapper \
|
|
|
|
--prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ JSONParse FinanceQuote ]}"
|
2022-01-22 01:22:15 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-22 01:22:15 +00:00
|
|
|
meta = with lib; {
|
2022-02-20 05:27:41 +00:00
|
|
|
homepage = "https://www.gnucash.org/";
|
|
|
|
description = "Free software for double entry accounting";
|
2022-01-22 01:22:15 +00:00
|
|
|
longDescription = ''
|
2022-02-20 05:27:41 +00:00
|
|
|
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.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00: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.
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
2022-01-22 01:22:15 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ domenkozar AndersonTorres rski nevivurn ];
|
2022-02-20 05:27:41 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|
2022-02-20 05:27:41 +00:00
|
|
|
# TODO: investigate Darwin support
|