diff options
author | Matthew Justin Bauer <mjbauer95@gmail.com> | 2018-05-01 10:23:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 10:23:21 -0500 |
commit | 83f035cf2941a91d3d00e63ef58f06b2c0561677 (patch) | |
tree | d5d4e79f531a6b0136fd74731648222c989dfd23 /pkgs/applications | |
parent | 4e58e23262f69d809a27af843c38e47aed524b68 (diff) | |
parent | 3434cf40e12d8c99d35bd7ef4272ff7cf0f9a64c (diff) |
Merge pull request #39616 from mnacamura/gnucash3
gnucash: 2.4.15 -> 3.1-1
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/office/gnucash/default.nix | 100 |
1 files changed, 59 insertions, 41 deletions
diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix index 252c6d878d0c..d12b1327e8f7 100644 --- a/pkgs/applications/office/gnucash/default.nix +++ b/pkgs/applications/office/gnucash/default.nix @@ -1,63 +1,81 @@ -{ fetchurl, stdenv, pkgconfig, libxml2, gconf, glib, gtk2, libgnomeui, libofx -, libgtkhtml, gtkhtml, libgnomeprint, goffice, enchant, gettext, libbonoboui -, intltool, perl, guile, slibGuile, swig, isocodes, bzip2, makeWrapper, libglade -, libgsf, libart_lgpl, perlPackages, aqbanking, gwenhywfar +{ 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 }: -/* If you experience GConf errors when running GnuCash on NixOS, see - * http://wiki.nixos.org/wiki/Solve_GConf_errors_when_running_GNOME_applications - * for a possible solution. - */ +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 { - name = "gnucash-2.4.15"; + name = "gnucash-${version}"; + version = "3.1-1"; src = fetchurl { url = "mirror://sourceforge/gnucash/${name}.tar.bz2"; - sha256 = "058mgfwic6a2g7jq6iip5hv45md1qaxy25dj4lvlzjjr141wm4gx"; + sha256 = "0qfjpmr6hnr0v7l2fi00rilnlyan4kqiyygyidxlpdxqqg76dvx1"; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig makeWrapper cmake gtest ]; + buildInputs = [ - libxml2 gconf glib gtk2 libgnomeui libgtkhtml gtkhtml - libgnomeprint goffice enchant gettext intltool perl guile slibGuile - swig isocodes bzip2 makeWrapper libofx libglade libgsf libart_lgpl - perlPackages.DateManip perlPackages.FinanceQuote aqbanking gwenhywfar + boost icu libxml2 libxslt gettext swig isocodes gtk3 glibcLocales + webkit dconf hicolor-icon-theme libofx aqbanking gwenhywfar libdbi + libdbiDrivers guile perlWrapper ]; - propagatedUserEnvPkgs = [ gconf ]; - configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3 --disable-dbi --enable-ofx --enable-aqbanking"; + propagatedUserEnvPkgs = [ dconf ]; + + postPatch = '' + patchShebangs . + ''; + + makeFlags = [ "GUILE_AUTO_COMPILE=0" ]; postInstall = '' # Auto-updaters don't make sense in Nix. rm $out/bin/gnc-fq-update - sed -i $out/bin/update-gnucash-gconf \ - -e 's|--config-source=[^ ]* --install-schema-file|--makefile-install-rule|' - - for prog in $(echo "$out/bin/"*) - do - # Don't wrap the gnc-fq-* scripts, since gnucash calls them as - # "perl <script>', i.e. they must be Perl scripts. - if [[ $prog =~ gnc-fq ]]; then continue; fi - wrapProgram "$prog" \ - --set SCHEME_LIBRARY_PATH "$SCHEME_LIBRARY_PATH" \ - --prefix GUILE_LOAD_PATH ":" "$GUILE_LOAD_PATH" \ - --prefix LD_LIBRARY_PATH ":" "${libgnomeui}/lib/libglade/2.0" \ - --prefix LD_LIBRARY_PATH ":" "${libbonoboui}/lib/libglade/2.0" \ - --prefix PERL5LIB ":" "$PERL5LIB" \ - --set GCONF_CONFIG_SOURCE 'xml::~/.gconf' \ - --prefix PATH ":" "$out/bin:${stdenv.lib.makeBinPath [ perl gconf ]}" - done - - rm $out/share/icons/hicolor/icon-theme.cache - ''; + # Unnecessary in the release build. + rm $out/bin/gnucash-valgrind - # The following settings fix failures in the test suite. It's not required otherwise. - NIX_LDFLAGS = "-rpath=${guile}/lib -rpath=${glib.out}/lib"; - preCheck = "export GNC_DOT_DIR=$PWD/dot-gnucash"; + 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" + ''; - doCheck = false; # https://github.com/NixOS/nixpkgs/issues/11084 + # 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; enableParallelBuilding = true; |