fix(python-bindings): added darwin duplicate rpath patch and fixed python rpath poiting

due to a current bug in meson-python duplicate rpaths are registered in the shared object files created by meson-python. The new masos dynamic loader refuses to load shared object files with duplicate rpaths. There is a small patch script which removes any duplicates. This is a temporary but effective fix (https://github.com/mesonbuild/meson-python/issues/813). Further, there was an issue due to mixed use of pure python and C++ code with name conflicts. This has been resolved so that both python and C++ code can be imported just find now.
This commit is contained in:
2025-11-03 14:26:39 -05:00
parent 2a8b6c0ba0
commit 4c064445c1
50 changed files with 329 additions and 62 deletions

View File

@@ -19,19 +19,19 @@ subdir('src-pybind')
# Bundle the Python backend for the Electron app
if get_option('electron-build-py-backend')
pyinstaller_exe = find_program('pyinstaller', required : true)
electron_src_dir = meson.current_source_dir() / 'electron'
custom_target('fourdst-backend',
input : electron_src_dir / 'fourdst-backend.spec',
# The output is the directory that PyInstaller creates.
# We are interested in the executable inside it.
output : 'fourdst-backend',
# The command to run. We tell PyInstaller where to put the final executable.
command : [pyinstaller_exe, '--distpath', meson.current_build_dir() / 'electron/dist', '--workpath', meson.current_build_dir() / 'electron/build', '--noconfirm', '@INPUT@'],
# This ensures the backend is built whenever you run 'meson compile'.
build_by_default : true
)
endif
#if get_option('electron-build-py-backend')
# pyinstaller_exe = find_program('pyinstaller', required : true)
# electron_src_dir = meson.current_source_dir() / 'electron'
#
# custom_target('fourdst-backend',
# input : electron_src_dir / 'fourdst-backend.spec',
# # The output is the directory that PyInstaller creates.
# # We are interested in the executable inside it.
# output : 'fourdst-backend',
# # The command to run. We tell PyInstaller where to put the final executable.
# command : [pyinstaller_exe, '--distpath', meson.current_build_dir() / 'electron/dist', '--workpath', meson.current_build_dir() / 'electron/build', '--noconfirm', '@INPUT@'],
# # This ensures the backend is built whenever you run 'meson compile'.
# build_by_default : true
# )
#endif