gnucash: 2.4.15 -> 3.1-1

This commit is contained in:
Mitsuhiro Nakamura 2018-04-24 01:27:51 +09:00
parent 164b580b36
commit 3434cf40e1
2 changed files with 61 additions and 47 deletions

View File

@ -1,63 +1,81 @@
{ fetchurl, stdenv, pkgconfig, libxml2, gconf, glib, gtk2, libgnomeui, libofx { fetchurl, stdenv, pkgconfig, makeWrapper, cmake, gtest
, libgtkhtml, gtkhtml, libgnomeprint, goffice, enchant, gettext, libbonoboui , boost, icu, libxml2, libxslt, gettext, swig, isocodes, gtk3, glibcLocales
, intltool, perl, guile, slibGuile, swig, isocodes, bzip2, makeWrapper, libglade , webkit, dconf, hicolor-icon-theme, libofx, aqbanking, gwenhywfar, libdbi
, libgsf, libart_lgpl, perlPackages, aqbanking, gwenhywfar , libdbiDrivers, guile, perl, perlPackages
}: }:
/* If you experience GConf errors when running GnuCash on NixOS, see let
* http://wiki.nixos.org/wiki/Solve_GConf_errors_when_running_GNOME_applications
* for a possible solution. # 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 { stdenv.mkDerivation rec {
name = "gnucash-2.4.15"; name = "gnucash-${version}";
version = "3.1-1";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/gnucash/${name}.tar.bz2"; 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
];
propagatedUserEnvPkgs = [ gconf ];
configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3 --disable-dbi --enable-ofx --enable-aqbanking"; buildInputs = [
boost icu libxml2 libxslt gettext swig isocodes gtk3 glibcLocales
webkit dconf hicolor-icon-theme libofx aqbanking gwenhywfar libdbi
libdbiDrivers guile perlWrapper
];
propagatedUserEnvPkgs = [ dconf ];
postPatch = ''
patchShebangs .
'';
makeFlags = [ "GUILE_AUTO_COMPILE=0" ];
postInstall = '' postInstall = ''
# Auto-updaters don't make sense in Nix. # Auto-updaters don't make sense in Nix.
rm $out/bin/gnc-fq-update rm $out/bin/gnc-fq-update
sed -i $out/bin/update-gnucash-gconf \ # Unnecessary in the release build.
-e 's|--config-source=[^ ]* --install-schema-file|--makefile-install-rule|' rm $out/bin/gnucash-valgrind
for prog in $(echo "$out/bin/"*) wrapProgram "$out/bin/gnucash" \
do --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${name}" \
# Don't wrap the gnc-fq-* scripts, since gnucash calls them as --prefix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
# "perl <script>', i.e. they must be Perl scripts. --prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules"
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
''; '';
# The following settings fix failures in the test suite. It's not required otherwise. # TODO: The following tests FAILED:
NIX_LDFLAGS = "-rpath=${guile}/lib -rpath=${glib.out}/lib"; # 61 - test-gnc-timezone (Failed)
preCheck = "export GNC_DOT_DIR=$PWD/dot-gnucash"; # 70 - test-load-c (Failed)
# 71 - test-modsysver (Failed)
doCheck = false; # https://github.com/NixOS/nixpkgs/issues/11084 # 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; enableParallelBuilding = true;

View File

@ -15965,11 +15965,7 @@ with pkgs;
gmrun = callPackage ../applications/misc/gmrun {}; gmrun = callPackage ../applications/misc/gmrun {};
gnucash = callPackage ../applications/office/gnucash { gnucash = callPackage ../applications/office/gnucash {
inherit (gnome2) libgnomeui libgtkhtml gtkhtml libbonoboui libgnomeprint libglade libart_lgpl; inherit (gnome3) dconf;
gconf = gnome2.GConf;
guile = guile_1_8;
slibGuile = slibGuile.override { scheme = guile_1_8; };
goffice = goffice_0_8;
}; };
gnucash26 = lowPrio (callPackage ../applications/office/gnucash/2.6.nix { gnucash26 = lowPrio (callPackage ../applications/office/gnucash/2.6.nix {