From 511e76cbe7faa5422cd6ed1a59d1e05cd95c3ff6 Mon Sep 17 00:00:00 2001 From: James O'SHANNESSY <12959316+joshanne@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:35:59 +1000 Subject: [PATCH 1/3] build: add linuxbuild.sh to generate an AppImage file for portable distribution --- linuxbuild.sh | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100755 linuxbuild.sh diff --git a/linuxbuild.sh b/linuxbuild.sh new file mode 100755 index 0000000..2c6111d --- /dev/null +++ b/linuxbuild.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# Linux AppImage build script for DroneCAN GUI Tool +# Produces an AppImage in the dist/ folder. + +set -e + +# Note: If APPIMAGETOOL_RELEASE is updated to a newer version, you MUST also +# update APPIMAGETOOL_SHA256 to match the checksum of the new binary. +APPIMAGETOOL_RELEASE="1.9.1" +APPIMAGETOOL_SHA256="ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0" + +echo "Building DroneCAN GUI Tool AppImage..." + +python3 --version + +# Create and activate a clean virtual environment +python3 -m venv --clear venv +source venv/bin/activate + +# Install pyinstaller and other dependencies +python3 -m pip install -U pip pyinstaller +python3 -m pip install -U pymavlink +python3 -m pip install -U python-can +python3 -m pip install -U . + +# Clean previous build artifacts +rm -rf build dist/DroneCAN_GUI_Tool dist/*.AppImage AppDir + +# Build the binary folder with PyInstaller +echo "Running PyInstaller..." +pyinstaller -y --name "DroneCAN_GUI_Tool" --windowed --icon icons/logo.ico \ + --collect-all dronecan \ + --collect-all dronecan_gui_tool \ + --collect-all pymavlink \ + bin/dronecan_gui_tool + +echo "Setting up AppDir..." +mkdir -p AppDir/usr/bin +cp -r dist/DroneCAN_GUI_Tool/* AppDir/usr/bin/ +cp dronecan_gui_tool/icons/dronecan_gui_tool.png AppDir/dronecan_gui_tool.png + +# Create AppRun +cat << 'EOF' > AppDir/AppRun +#!/bin/bash +HERE="$(dirname "$(readlink -f "${0}")")" +export PATH="${HERE}/usr/bin:${PATH}" +export LD_LIBRARY_PATH="${HERE}/usr/bin:${LD_LIBRARY_PATH}" +exec "${HERE}/usr/bin/DroneCAN_GUI_Tool" "$@" +EOF +chmod +x AppDir/AppRun + +# Create Desktop file +cat << 'EOF' > AppDir/dronecan_gui_tool.desktop +[Desktop Entry] +Name=DroneCAN GUI Tool +Exec=AppRun +Icon=dronecan_gui_tool +Type=Application +Categories=Development;Utility; +EOF + +# Download appimagetool if not exists +if [ ! -f "appimagetool-x86_64.AppImage" ]; then + echo "Downloading appimagetool..." + wget -q "https://github.com/AppImage/appimagetool/releases/download/${APPIMAGETOOL_RELEASE}/appimagetool-x86_64.AppImage" + echo "${APPIMAGETOOL_SHA256} appimagetool-x86_64.AppImage" | sha256sum -c - + chmod +x appimagetool-x86_64.AppImage +fi + +echo "Packaging AppImage..." +# Create the AppImage +./appimagetool-x86_64.AppImage --appimage-extract-and-run AppDir dist/DroneCAN_GUI_Tool-x86_64.AppImage + +echo "Build complete. Artifact: dist/DroneCAN_GUI_Tool-x86_64.AppImage" +ls -lh dist/ From c4ab6ac9fabd75ed617a50909ef36cca46cd2c8e Mon Sep 17 00:00:00 2001 From: James O'SHANNESSY <12959316+joshanne@users.noreply.github.com> Date: Tue, 4 Aug 2026 21:03:53 +1000 Subject: [PATCH 2/3] github: add linuxbuild CI workflow --- .github/workflows/linuxbuild.yml | 38 ++++++++++++++++++++++++++++++++ linuxbuild.sh | 1 + 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/linuxbuild.yml diff --git a/.github/workflows/linuxbuild.yml b/.github/workflows/linuxbuild.yml new file mode 100644 index 0000000..2ea1b33 --- /dev/null +++ b/.github/workflows/linuxbuild.yml @@ -0,0 +1,38 @@ +name: Linux CI + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y fuse file + + - name: Build Linux AppImage + run: bash linuxbuild.sh + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: AppImage Package + path: dist/*.AppImage diff --git a/linuxbuild.sh b/linuxbuild.sh index 2c6111d..3c05651 100755 --- a/linuxbuild.sh +++ b/linuxbuild.sh @@ -32,6 +32,7 @@ pyinstaller -y --name "DroneCAN_GUI_Tool" --windowed --icon icons/logo.ico \ --collect-all dronecan \ --collect-all dronecan_gui_tool \ --collect-all pymavlink \ + --collect-all debugpy \ bin/dronecan_gui_tool echo "Setting up AppDir..." From 54bfebcaf362c337c1dafbb6f90f533b764267c7 Mon Sep 17 00:00:00 2001 From: James O'SHANNESSY <12959316+joshanne@users.noreply.github.com> Date: Thu, 13 Aug 2026 20:58:11 +1000 Subject: [PATCH 3/3] .gitignore: Ignore AppDir from AppImage generation --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index a720064..8073f6f 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,7 @@ target/ .idea/ venv/ + +# AppImage build +AppDir/ +appimagetool-x86_64.AppImage