-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
30 lines (26 loc) · 911 Bytes
/
build.sh
File metadata and controls
30 lines (26 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -euo pipefail
# Build PyMacroRecorder standalone binary using pyinstaller (Linux/macOS)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$SCRIPT_DIR"
DIST_DIR="$PROJECT_ROOT/dist"
BUILD_DIR="$PROJECT_ROOT/build"
SPEC_FILE="$PROJECT_ROOT/PyMacroRecorder.spec"
ENTRYPOINT="$PROJECT_ROOT/main.py"
ICON_FILE="$PROJECT_ROOT/assets/logo.ico"
APP_NAME="PyMacroRecorder"
# Clean previous outputs
rm -rf "$DIST_DIR" "$BUILD_DIR" "$SPEC_FILE"
# Run pyinstaller with icon and assets
# Add hidden imports for pynput Linux backends
pyinstaller --onefile --noconsole \
--name "$APP_NAME" \
--icon "$ICON_FILE" \
--add-data "assets:assets" \
--hidden-import pynput.keyboard._xorg \
--hidden-import pynput.mouse._xorg \
--distpath "$DIST_DIR" \
--workpath "$BUILD_DIR" \
"$ENTRYPOINT"
# Print result path
echo "Build complete. Binary located at: $DIST_DIR/$APP_NAME"