Files

47 lines
2.0 KiB
Bash

#!/usr/bin/env bash
# NetDesk build for Apple Silicon / Intel Macs.
# Run ON the Mac (PyInstaller cannot cross-compile):
# bash scripts/build_mac.sh
# Produces:
# dist/NetDesk.app - desktop control panel (double-click app)
# dist/netdesk-engine - headless agent binary (LaunchAgent / CLI)
# dist/NetDeskServer - server binary (optional, if the Mac is the VPS)
set -euo pipefail
cd "$(dirname "$0")/.." # netdesk root
echo "==> creating build venv"
python3 -m venv .venv-build
./.venv-build/bin/pip install --quiet --upgrade pip
./.venv-build/bin/pip install --quiet aiohttp cryptography mss numpy av pillow pyinstaller
echo "==> building NetDesk.app (desktop control panel, double-click to run)"
./.venv-build/bin/pyinstaller --windowed --name NetDesk \
--distpath dist --workpath build --specpath build host/netdesk_host.py
echo "==> building netdesk-engine (headless agent for LaunchAgent/CLI)"
./.venv-build/bin/pyinstaller --onefile --name netdesk-engine \
--distpath dist --workpath build --specpath build host/netdesk_host.py
echo "==> building NetDeskServer"
./.venv-build/bin/pyinstaller --onefile --name NetDeskServer \
--add-data "server/web:web" \
--distpath dist --workpath build --specpath build server/netdesk_server.py
rm -rf build .venv-build
echo
echo "==> done:"
ls -lh dist/
echo
echo "What you got:"
echo " dist/NetDesk.app - the desktop control panel (double-click)"
echo " dist/netdesk-engine - headless agent (used by Start-at-Login and CLI)"
echo " dist/NetDeskServer - the server binary (optional, if the Mac is the VPS)"
echo
echo "First run: macOS asks for Screen Recording and Accessibility"
echo "(System Settings -> Privacy & Security) - both are required for"
echo "remote control, same as RustDesk/TeamViewer."
echo "If Gatekeeper blocks an app: xattr -cr dist/NetDesk.app"
echo
echo "Autostart: open NetDesk.app -> enter server + key -> Start at Login."
echo "This installs ~/Library/LaunchAgents/com.netdesk.host.plist (invisible engine)."