-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-universal.sh
executable file
·64 lines (54 loc) · 1.4 KB
/
build-universal.sh
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
#!/bin/bash
# functions
trash() { osascript -e "tell application \"Finder\" to delete POSIX file \"$(realpath "$1")\"" > /dev/null; }
BUILD_DIR=./build/universal
mkdir -p $BUILD_DIR
BUILD_DIR=$(realpath $BUILD_DIR)
BUILD_TMP_DIR=/tmp/autoarchive-build-universal-$(date +%s)
PYTHON=/usr/bin/python3
export PATH=/usr/bin:$PATH
# Hello
echo "AutoArchive Universal 2 Binary Build Utility"
if [ "$(arch)" == "arm64" ]; then
echo "Running on arm64, switching to x86_64"
arch -x86_64 $0
exit
fi
echo "Running on $(arch)"
echo "Build Directory: $BUILD_DIR"
echo "Copy to temporary directory: $BUILD_TMP_DIR"
if [ -d "./build" ]; then
trash ./build
fi
mkdir $BUILD_TMP_DIR
cp -R ./ $BUILD_TMP_DIR
echo "Move files to $BUILD_DIR"
mkdir -p $BUILD_DIR
mv $BUILD_TMP_DIR/* $BUILD_DIR/
cd $BUILD_DIR
echo "Current Directory: $(pwd)"
echo "Deleting obsolete files..."
# if exist ./dist, ./test ./venv, delete them
if [ -d "./dist" ]; then
trash ./dist
fi
if [ -d "./test" ]; then
trash ./test
fi
if [ -d "./venv" ]; then
trash ./venv
fi
mkdir ./dist
mkdir ./test
echo "Creating virtual environment..."
$PYTHON -m venv ./venv
echo "Installing dependencies..."
source ./venv/bin/activate
pip install -r requirements.txt
deactivate
echo "Patching PyQt6..."
./pyqt6-universal-patch.sh
echo "Running Build Utility..."
./build.sh
echo "Universal 2 Binary Build Utility complete."
echo "Run 'cd ./build/universal' for next steps."