diff --git a/Packaging/BuildAppImage.sh b/Packaging/BuildAppImage.sh index 1765ab5..1128f31 100755 --- a/Packaging/BuildAppImage.sh +++ b/Packaging/BuildAppImage.sh @@ -19,6 +19,7 @@ podman run --rm --security-opt label=disable -v "$PWD:/src" -w /src \ uv pip install --quiet --python build/Container/venv -r requirements.txt pyinstaller build/Container/venv/bin/pyinstaller --noconfirm --clean --log-level WARN \ --onefile --windowed --name SaraTune --collect-data flet \ + --runtime-hook "$PWD/Packaging/RestoreLibraryPath.py" \ --add-data "$PWD/assets:assets" \ --distpath build/PyInstaller/dist --workpath build/PyInstaller/work --specpath build/PyInstaller \ "$PWD/Main.py"' diff --git a/Packaging/RestoreLibraryPath.py b/Packaging/RestoreLibraryPath.py new file mode 100644 index 0000000..446798a --- /dev/null +++ b/Packaging/RestoreLibraryPath.py @@ -0,0 +1,11 @@ +# PyInstaller runtime hook. The frozen app runs with LD_LIBRARY_PATH pointing +# at its bundled libraries, and programs it starts inherit that: Flet's +# desktop client then loads the bundled (older) libstdc++ instead of the +# system's and won't start ("GLIBCXX_3.4.29 not found"). Give them the +# original value back; the app itself has already loaded what it needs. +import os + +if "LD_LIBRARY_PATH_ORIG" in os.environ: + os.environ["LD_LIBRARY_PATH"] = os.environ["LD_LIBRARY_PATH_ORIG"] +else: + os.environ.pop("LD_LIBRARY_PATH", None)