guix/gnu/packages/patches/trytond-add-guix_trytond_path.patch
Hartmut Goebel 4d86f0a312
gnu: trytond: Downgrade to 7.0.37 (latest LTS version).
Discussion <https://codeberg.org/guix/guix/issues/1438> resulted in the
decision to maintain the LTS version, which is 7.0.

* gnu/packages/tryton.scm(tryton): Downgrade to 7.0.37.
[arguments][#:phases][preperations]: Set DB_CACHE.
[propagated-inputs] Add python-psycopg2.
[native-inputs] Add python-html2text, remove python-wheel.
[native-search-paths] Add guix-pythonpath-search-path.
* gnu/packages/patches/trytond-add-guix_trytond_path.patch: Add modules in
GUIX_TRYTOND_MODULES_PATH directly to trytond.modules.__path__. Delete helper
function after it's done.

Change-Id: Ib2902c8e204467f08135885c793371105aeed7e5
2025-10-19 19:09:56 +02:00

23 lines
601 B
Diff

Make trytond add all paths listed in GUIX_TRYTOND_MODULES_PATH to sys.path.
*** a/trytond/modules/__init__.py
--- b/trytond/modules/__init__.py
***************
*** 31,36 ****
--- 31,45 ----
EGG_MODULES = {}
+ def __extend_python_path__():
+ trytond_modules_path = os.environ.get("GUIX_TRYTOND_MODULES_PATH")
+ if trytond_modules_path:
+ # make tryton.module behave like a namespace package
+ __path__.extend(trytond_modules_path.split(os.pathsep))
+
+ __extend_python_path__()
+ del __extend_python_path__
+
def update_egg_modules():
global EGG_MODULES
l