Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions pkgs/by-name/gn/gnucash/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
gettext,
glib,
glibcLocales,
gobject-introspection,
gtest,
guile,
gwenhywfar,
Expand All @@ -24,12 +25,17 @@
perlPackages,
pkg-config,
swig,
webkitgtk_4_0,
webkitgtk_4_1,
wrapGAppsHook3,
python3,
replaceVars,
}:

let
py = python3.withPackages (
ps: with ps; [
pygobject3.out
]
);
in
stdenv.mkDerivation rec {
pname = "gnucash";
version = "5.11";
Expand All @@ -43,6 +49,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
cmake
gettext
gobject-introspection
makeWrapper
wrapGAppsHook3
pkg-config
Expand All @@ -69,8 +76,8 @@ stdenv.mkDerivation rec {
libxml2
libxslt
swig
webkitgtk_4_0
python3
webkitgtk_4_1
py
]
++ (with perlPackages; [
JSONParse
Expand Down Expand Up @@ -151,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 : "${
Expand All @@ -165,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;
Expand Down
Loading