2018-04-23 17:27:51 +01:00
|
|
|
{ fetchurl, stdenv, pkgconfig, makeWrapper, cmake, gtest
|
|
|
|
, boost, icu, libxml2, libxslt, gettext, swig, isocodes, gtk3, glibcLocales
|
|
|
|
, webkit, dconf, hicolor-icon-theme, libofx, aqbanking, gwenhywfar, libdbi
|
|
|
|
, 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 ]);
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
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 {
|
2018-04-23 17:27:51 +01:00
|
|
|
name = "gnucash-${version}";
|
|
|
|
version = "3.1-1";
|
2009-09-30 14:11:17 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2011-07-09 14:02:46 +01:00
|
|
|
url = "mirror://sourceforge/gnucash/${name}.tar.bz2";
|
2018-04-23 17:27:51 +01:00
|
|
|
sha256 = "0qfjpmr6hnr0v7l2fi00rilnlyan4kqiyygyidxlpdxqqg76dvx1";
|
2009-09-30 14:11:17 +01:00
|
|
|
};
|
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper cmake gtest ];
|
|
|
|
|
2009-09-30 14:11:17 +01:00
|
|
|
buildInputs = [
|
2018-04-23 17:27:51 +01:00
|
|
|
boost icu libxml2 libxslt gettext swig isocodes gtk3 glibcLocales
|
|
|
|
webkit dconf hicolor-icon-theme libofx aqbanking gwenhywfar libdbi
|
|
|
|
libdbiDrivers guile perlWrapper
|
2009-09-30 14:11:17 +01:00
|
|
|
];
|
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
propagatedUserEnvPkgs = [ dconf ];
|
|
|
|
|
|
|
|
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" \
|
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${name}" \
|
|
|
|
--prefix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
|
|
|
|
--prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules"
|
|
|
|
'';
|
2015-11-18 14:25:52 +00:00
|
|
|
|
2018-04-23 17:27:51 +01:00
|
|
|
# TODO: The following tests FAILED:
|
|
|
|
# 61 - test-gnc-timezone (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
|
|
|
|
export NIX_CFLAGS_LINK="-lgtest -lgtest_main"
|
|
|
|
'';
|
|
|
|
doCheck = false;
|
2011-07-11 17:38:07 +01:00
|
|
|
|
2011-07-09 14:02:46 +01:00
|
|
|
enableParallelBuilding = true;
|
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.
|
|
|
|
'';
|
|
|
|
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2009-09-30 14:11:17 +01:00
|
|
|
|
|
|
|
homepage = http://www.gnucash.org/;
|
|
|
|
|
2016-05-17 12:57:28 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.peti stdenv.lib.maintainers.domenkozar ];
|
2018-04-30 23:47:47 +01:00
|
|
|
platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
|
2009-09-30 14:11:17 +01:00
|
|
|
};
|
|
|
|
}
|