-
Notifications
You must be signed in to change notification settings - Fork 3
Development
The purpose of this page is to provide notes for users interested in modifying or helping develop Ortho4XP.
PyInstaller is used to bundle Ortho4XP its dependencies into a single package allowing a user to run Ortho4XP without any additional setup.
The following arguments were used with PyInstaller to build the package (macOS example):
pyinstaller --noconfirm \
--paths=:src \
--add-data="./Utils:./Utils" \
--add-data="./Extents:./Extents" \
--add-data="./Filters:./Filters" \
--add-data="./Licence:./Licence" \
--add-data="./Patches:./Patches" \
--add-data="./Previews:./Previews" \
--add-data="./Providers:./Providers" \
--hidden-import=PIL \
Ortho4XP.py
When building the package on Windows, it has to be accomplished outside of a Python virtual environment (if used).
When building the package on macOS, it can be accomplished either outside or inside of a Python virtual environment, but an additional step is required to get GDAL to work. Once the Ortho4XP package is built, copy the *.so files from your venv site-packages, /Users/user_name/Projects/Ortho4XP/venv/lib/python3.12/site-packages/osgeo
and replace the ones in the package dist/Ortho4XP/_internal/osgeo
folder. It's unknown at this time as to why this is required but was the only way to get GDAL to work properly.
Since each package is specific to the operating system and architecture, unnecessary files can be deleted before distribution to reduce file size. The current files that are being removed:
- The
win
,mac
and/orlin
folder inside theOrtho4XP/Utils
directory, depending on which platform it's being built for. - If building for Windows, removing the *.whl files that this forked version added in the
win
folder. -
Old
folder insideOrtho4XP/Utils/mac
folder since they are unused.