mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-15 00:18:10 +00:00
python3Packages.gnucash: Build from existing gnucash package (#387100)
This commit is contained in:
commit
3cc65eac14
10
pkgs/by-name/gn/gnucash/0005-python-env.patch
Normal file
10
pkgs/by-name/gn/gnucash/0005-python-env.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- a/bindings/python/__init__.py
|
||||
+++ b/bindings/python/__init__.py
|
||||
@@ -1,3 +1,7 @@
|
||||
+import os
|
||||
+os.environ['GNC_DBD_DIR'] = '@gnc_dbd_dir@'
|
||||
+os.environ['GSETTINGS_SCHEMA_DIR'] = '@gsettings_schema_dir@'
|
||||
+
|
||||
# import all the symbols from gnucash_core, so basic gnucash stuff can be
|
||||
# loaded with:
|
||||
# >>> from gnucash import thingy
|
@ -25,6 +25,8 @@
|
||||
swig,
|
||||
webkitgtk_4_0,
|
||||
wrapGAppsHook3,
|
||||
python3,
|
||||
replaceVars,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@ -45,6 +47,11 @@ stdenv.mkDerivation rec {
|
||||
pkg-config
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DWITH_PYTHON=\"ON\""
|
||||
"-DPYTHON_SYSCONFIG_BUILD=\"$out\""
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
aqbanking
|
||||
@ -63,6 +70,7 @@ stdenv.mkDerivation rec {
|
||||
libxslt
|
||||
swig
|
||||
webkitgtk_4_0
|
||||
python3
|
||||
]
|
||||
++ (with perlPackages; [
|
||||
JSONParse
|
||||
@ -79,8 +87,16 @@ stdenv.mkDerivation rec {
|
||||
./0003-remove-valgrind.patch
|
||||
# this patch makes gnucash exec the Finance::Quote wrapper directly
|
||||
./0004-exec-fq-wrapper.patch
|
||||
# this patch adds in env vars to the Python lib that makes it able to find required resource files
|
||||
./0005-python-env.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace bindings/python/__init__.py \
|
||||
--subst-var-by gnc_dbd_dir "${libdbiDrivers}/lib/dbd" \
|
||||
--subst-var-by gsettings_schema_dir ${glib.makeSchemaPath "$out" "gnucash-${version}"};
|
||||
'';
|
||||
|
||||
# this needs to be an environment variable and not a cmake flag to suppress
|
||||
# guile warning
|
||||
env.GUILE_AUTO_COMPILE = "0";
|
||||
|
@ -5618,6 +5618,12 @@ self: super: with self; {
|
||||
|
||||
gntp = callPackage ../development/python-modules/gntp { };
|
||||
|
||||
gnucash = toPythonModule (
|
||||
pkgs.gnucash.override {
|
||||
python3 = python;
|
||||
}
|
||||
);
|
||||
|
||||
gnureadline = callPackage ../development/python-modules/gnureadline { };
|
||||
|
||||
go2rtc-client = callPackage ../development/python-modules/go2rtc-client { };
|
||||
|
Loading…
Reference in New Issue
Block a user