nixpkgs/pkgs/applications/office/gnucash/default.nix

110 lines
3.5 KiB
Nix
Raw Normal View History

2018-04-23 18:27:51 +02:00
{ fetchurl, stdenv, pkgconfig, makeWrapper, cmake, gtest
, 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
}:
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 ]);
phases = [ "installPhase" ];
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";
2020-04-25 18:54:07 +02:00
version = "3.10";
src = fetchurl {
url = "mirror://sourceforge/gnucash/${pname}-${version}.tar.bz2";
2020-04-25 18:54:07 +02:00
sha256 = "05kgg7mhizndwn7icnarqk3c19xrzfawf90y9nb3jdm6fv1741xn";
};
2018-04-23 18:27:51 +02:00
nativeBuildInputs = [ pkgconfig makeWrapper cmake gtest ];
buildInputs = [
2018-04-23 18:27:51 +02:00
boost icu libxml2 libxslt gettext swig isocodes gtk3 glibcLocales
webkitgtk dconf libofx aqbanking gwenhywfar libdbi
libdbiDrivers guile
perlWrapper perl
] ++ (with perlPackages; [ FinanceQuote DateManip ]);
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";
patches = [ ./cmake_check_symbol_exists.patch ];
2018-04-23 18:27:51 +02:00
postPatch = ''
patchShebangs .
'';
makeFlags = [ "GUILE_AUTO_COMPILE=0" ];
postInstall = ''
# 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
2018-04-23 18:27:51 +02:00
wrapProgram "$out/bin/gnucash" \
--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" \
--prefix PERL5LIB ":" "$PERL5LIB" \
2018-04-23 18:27:51 +02:00
--prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules"
'';
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 = ''
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;
enableParallelBuilding = true;
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.
'';
license = stdenv.lib.licenses.gpl2Plus;
2020-04-05 20:59:06 +02:00
homepage = "http://www.gnucash.org/";
maintainers = [ stdenv.lib.maintainers.peti stdenv.lib.maintainers.domenkozar ];
platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
};
}