-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD_MAC.command
More file actions
83 lines (70 loc) · 2.12 KB
/
BUILD_MAC.command
File metadata and controls
83 lines (70 loc) · 2.12 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# FloppyManager Build Script for macOS
# This is a .command file which can be double-clicked in Finder
# Ensure we are in the script's directory
cd "$(dirname "$0")"
echo ""
echo "============================="
echo " FloppyManager (Mac)"
echo "============================="
echo ""
# 1. Check Python
echo "[1/3] Checking for Python..."
if ! command -v python3 &> /dev/null; then
echo " [X] Python 3 is NOT installed"
echo ""
echo " Please install Python 3."
echo " Recommended: Install Homebrew (https://brew.sh) then run:"
echo " brew install python"
echo ""
read -p "Press Enter to exit..."
exit 1
else
python3 --version
echo " [OK] Python 3 is installed"
fi
# 2. Check/Install Dependencies
echo ""
echo "[2/3] Checking required packages..."
# Check if modules can be imported
if ! python3 -c "import PySide6; import PyInstaller" &> /dev/null; then
echo " Packages missing. Installing..."
# Try installing to user site
python3 -m pip install -r requirements.txt --user
if [ $? -ne 0 ]; then
echo ""
echo " [!] Standard installation failed."
echo " Attempting with --break-system-packages (for managed environments)..."
echo ""
python3 -m pip install -r requirements.txt --break-system-packages --user
if [ $? -ne 0 ]; then
echo ""
echo " [!] Installation failed."
echo " Please install PySide6 and PyInstaller manually."
echo ""
read -p "Press Enter to exit..."
exit 1
fi
fi
echo " [OK] Package check complete"
else
echo " [OK] Packages already installed."
fi
# 3. Build
echo ""
echo "[3/3] Building executable..."
echo "Please wait..."
echo ""
# Clean previous build artifacts
rm -rf build dist *.spec
# Run PyInstaller
python3 -m PyInstaller --clean --noconfirm floppymanager.spec
echo ""
# Check if build succeeded
if [ -f "dist/FloppyManager" ]; then
echo "SUCCESS! Executable is in the 'dist' folder."
else
echo "BUILD FAILED. Check messages above."
fi
echo ""
read -p "Press Enter to close..."