aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Scholten2025-10-14 14:00:51 +1000
committerSam Scholten2025-10-14 14:01:26 +1000
commitcbf91fa2ea43d637b1049ecbb79e752a83bac6ed (patch)
treefd1d230fcd36450d0518370cf690b940c2fb2b08
parent80f94d3c6a88aa59ef3601f0f0bb9a670635d59e (diff)
downloadpicostream-cbf91fa2ea43d637b1049ecbb79e752a83bac6ed.tar.gz
picostream-cbf91fa2ea43d637b1049ecbb79e752a83bac6ed.zip
Automate libffi DLL bundling for PyInstaller on Windows
-rw-r--r--justfile11
1 files changed, 10 insertions, 1 deletions
diff --git a/justfile b/justfile
index 478f4f3..d3fa021 100644
--- a/justfile
+++ b/justfile
@@ -8,5 +8,14 @@ gui:
# Build the picostream GUI executable
build-gui:
uv pip install pyinstaller pyinstaller-hooks-contrib
- uv run pyinstaller --onefile --windowed --name PicoStream picostream/main.py
+ FFI_FLAG := `uv run python -c '
+import sys, os, glob
+if sys.platform == "win32":
+ dlls_dir = os.path.join(os.path.dirname(sys.executable), "DLLs")
+ ffi_dll_path = next(glob.iglob(os.path.join(dlls_dir, "libffi-*.dll")), None)
+ if ffi_dll_path:
+ # The separator for --add-binary is platform-dependent (os.pathsep)
+ print(f"--add-binary \"{ffi_dll_path}{os.pathsep}.\"")
+'`
+ uv run pyinstaller --onefile --windowed --name PicoStream {{FFI_FLAG}} picostream/main.py