From c0e4ead3949c3023bdfe5f4dd8ed7c6e7e27dd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 24 Jul 2025 13:55:39 +0200 Subject: [PATCH 1/2] gnucash: use webkitgtk_4_1 --- pkgs/by-name/gn/gnucash/package.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/gn/gnucash/package.nix b/pkgs/by-name/gn/gnucash/package.nix index 51d18d83fb91..7505c28b726e 100644 --- a/pkgs/by-name/gn/gnucash/package.nix +++ b/pkgs/by-name/gn/gnucash/package.nix @@ -24,10 +24,9 @@ perlPackages, pkg-config, swig, - webkitgtk_4_0, + webkitgtk_4_1, wrapGAppsHook3, python3, - replaceVars, }: stdenv.mkDerivation rec { @@ -69,7 +68,7 @@ stdenv.mkDerivation rec { libxml2 libxslt swig - webkitgtk_4_0 + webkitgtk_4_1 python3 ] ++ (with perlPackages; [ From 6df491d41ce74e0a3059d4119e3dfe3b8b4ad8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 24 Jul 2025 21:36:08 +0200 Subject: [PATCH 2/2] gnucash: fix missing gobject-introspection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ➜ ./result/bin/gnucash Traceback (most recent call last): File "/nix/store/1rm7rm8izpdyy8v53ybcr244hm010m07-gnucash-5.11/share/gnucash/python/init.py", line 6, in from gi import require_version ModuleNotFoundError: No module named 'gi' --- pkgs/by-name/gn/gnucash/package.nix | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/gn/gnucash/package.nix b/pkgs/by-name/gn/gnucash/package.nix index 7505c28b726e..fa3d9ea39c22 100644 --- a/pkgs/by-name/gn/gnucash/package.nix +++ b/pkgs/by-name/gn/gnucash/package.nix @@ -10,6 +10,7 @@ gettext, glib, glibcLocales, + gobject-introspection, gtest, guile, gwenhywfar, @@ -28,7 +29,13 @@ wrapGAppsHook3, python3, }: - +let + py = python3.withPackages ( + ps: with ps; [ + pygobject3.out + ] + ); +in stdenv.mkDerivation rec { pname = "gnucash"; version = "5.11"; @@ -42,6 +49,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake gettext + gobject-introspection makeWrapper wrapGAppsHook3 pkg-config @@ -69,7 +77,7 @@ stdenv.mkDerivation rec { libxslt swig webkitgtk_4_1 - python3 + py ] ++ (with perlPackages; [ JSONParse @@ -150,11 +158,16 @@ stdenv.mkDerivation rec { # Perl wrapping dontWrapGApps = true; - # gnucash is wrapped using the args constructed for wrapGAppsHook3. + # We could not find the python entrypoint and somehow it is used from PATH, + # so force to use the one with all dependencies # gnc-fq-* are cli utils written in Perl hence the extra wrapping postFixup = '' - wrapProgram $out/bin/gnucash "''${gappsWrapperArgs[@]}" - wrapProgram $out/bin/gnucash-cli "''${gappsWrapperArgs[@]}" + wrapProgram $out/bin/gnucash \ + --prefix PATH : ${lib.makeBinPath [ py ]} \ + "''${gappsWrapperArgs[@]}" + wrapProgram $out/bin/gnucash-cli \ + --prefix PATH : ${lib.makeBinPath [ py ]} \ + "''${gappsWrapperArgs[@]}" wrapProgram $out/bin/finance-quote-wrapper \ --prefix PERL5LIB : "${ @@ -164,6 +177,9 @@ stdenv.mkDerivation rec { FinanceQuote ] }" + + chmod +x $out/share/gnucash/python/pycons/*.py + patchShebangs $out/share/gnucash/python/pycons/*.py ''; passthru.updateScript = ./update.sh;