From 3434cf40e12d8c99d35bd7ef4272ff7cf0f9a64c Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Tue, 24 Apr 2018 01:27:51 +0900 Subject: gnucash: 2.4.15 -> 3.1-1 --- pkgs/applications/office/gnucash/default.nix | 100 ++++++++++++++++----------- 1 file changed, 59 insertions(+), 41 deletions(-) (limited to 'pkgs/applications/office/gnucash') 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