Add macOS installation script for DroneCAN GUI Tool#102
Add macOS installation script for DroneCAN GUI Tool#102ryanjAA wants to merge 1 commit intodronecan:masterfrom
Conversation
This script builds the DroneCAN GUI Tool for macOS, including installation of dependencies, creating a DMG installer, and handling application packaging.
joshanne
left a comment
There was a problem hiding this comment.
Of all the comments, I think the ability to allow a user to build any branch, instead of just v1.2.28.
I could see this being used in a github workflow to build the dmg/app.
| # Builds a standalone .app and DMG using PyInstaller and Homebrew Python. | ||
| # This version vendors qtwidgets and patches it to use PyQt5. | ||
|
|
||
| set -e # Exit on any error |
There was a problem hiding this comment.
might be better to use:
| set -e # Exit on any error | |
| set -euo pipefail # Exit on any error/undefined vars; fail pipelines |
it should fail for things like undefined variables, and fail on the first command in a pipeline if something errors.
| # --------------------------------------------------------------------------- | ||
| # Configuration | ||
| # --------------------------------------------------------------------------- | ||
| BUILD_DIR="$HOME/dronecan_build_pyinstaller" |
There was a problem hiding this comment.
I think these should be at the top of the file, after set -e....
It would also be great if these were:
BUILD_DIR="${BUILD_DIR:-$HOME/dronecan_build_pyinstaller}"
REPO_URL="${REPO_URL:-https://github.com/DroneCAN/gui_tool.git}"
BRANCH="${BRANCH:-master}"
APP_NAME="${APP_NAME:-DroneCAN GUI Tool}"
DMG_NAME="${DMG_NAME:-DroneCAN-GUI-Tool-macOS}"This allows the user to specify custom build dir, repo URL (if building from a forked repo) or branch (if building a non-default branch).
App Name and DMG name for completeness, but allows users to build for a custom name if necessary.
| echo -e "${YELLOW}Upgrading pip/setuptools/wheel...${NC}" | ||
| pip install --upgrade pip setuptools wheel | ||
|
|
||
| echo -e "${YELLOW}Installing Python dependencies...${NC}" |
There was a problem hiding this comment.
Do you need to ensure you've got pyserial installed?
| # --------------------------------------------------------------------------- | ||
| # Clone the DroneCAN GUI Tool repo | ||
| # --------------------------------------------------------------------------- | ||
| echo -e "${YELLOW}Cloning DroneCAN GUI Tool repository...${NC}" |
There was a problem hiding this comment.
I think this might be okay to merge as is - but i think we're conflating two different processes here.
The build process, and the acquisition of the macOS DMG/App Generate script.
Ultimately I think this should be similar to the windows build script, that generates an msi file as the end result.
This script builds the DroneCAN GUI Tool for macOS, including installation of dependencies, creating a DMG installer, and handling application packaging.