-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
101 lines (93 loc) · 3.52 KB
/
Copy pathdev.sh
File metadata and controls
101 lines (93 loc) · 3.52 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
#:& Import lib
source ./lib/lib.sh
#:& Check if user installed rustup / cargo
if ! command -v cargo >/dev/null 2>&1; then
echo -e "\033[33mTrying to install rustup...\033[0m"
#:& Check what package manager is used
if command -v apt >/dev/null 2>&1; then
sudo apt update >/dev/null 2>&1
sudo apt install build-essential
#:& Pull rustup from their website, since Ubuntu was having issues
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y >/dev/null 2>&1
rustup default stable >/dev/null 2>&1
elif command -v pacman >/dev/null 2>&1; then
sudo pacman -Syu --needed rustup base-devel >/dev/null 2>&1
rustup default stable >/dev/null 2>&1
else
echo -e "\e[4;31mYou don't have Rustup :(\e[0m"
exit 1
fi
fi
#:& Check if a cc linker is found on your OS
if ! command -v cc >/dev/null 2>&1; then
echo -e "\e[33mTrying to install "cc" linker...\e[0m"
#:& Check what package manager is used
if command -v apt >/dev/null 2>&1; then
sudo apt update >/dev/null 2>&1
sudo apt install build-essential >/dev/null 2>&1
source "$HOME/.cargo/env"
elif command -v pacman >/dev/null 2>&1; then
sudo pacman -Syu --needed base-devel >/dev/null 2>&1
elif command -v dnf >/dev/null 2>&1; then
# WARNING: Not tested
sudo dnf groupinstall "Development Tools"
elif command -v yum >/dev/null 2>&1; then
# WARNING: Not tested
sudo yum groupinstall "Development Tools"
elif command -v zypper >/dev/null 2>&1; then
# WARNING: Not tested
sudo zypper install -t pattern devel_basis
else
echo -e "\e[31mYou need to install your platform's "cc" linker :(\e[0m"
exit 1
fi
fi
# WARNING: This should be moved to a conditional
echo -e "\e[0;33mSetting Rustup Toolchain version...\e[0m"
rustup default stable >/dev/null 2>&1 || exit 1
echo -e "\e[38;2;25;150;25mSet!\e[0m"
# TODO: Make this better
PS3='Please enter your choice: '
options=(
"Normal Build"
"No LTO Build"
"Normal Build with Bambu Labs"
"No LTO Build with Bambu Labs"
"Unbranded Build"
"Quit"
)
select opt in "${options[@]}"
do
case $opt in
"Normal Build")
cargo build --release --target x86_64-pc-windows-gnu
break;;
"No LTO Build")
cargo build --release --target x86_64-pc-windows-gnu --profile no-lto-release
break;;
"Normal Build with Bambu Labs")
cargo build --release --target x86_64-pc-windows-gnu --features bambulabs
break;;
"No LTO Build with Bambu Labs")
cargo build --release --target x86_64-pc-windows-gnu --profile no-lto-release --features bambulabs
break;;
"Unbranded Build")
cargo build --release --target x86_64-pc-windows-gnu --features unbranded
break;;
"Quit")
echo "We're done"
break;;
*)
echo "Ooops" "${REPLY}";;
esac
done
# WARNING: This needs to be changed if we are going to make this utility configure Linux machines.
#:& Move JSON files into built release folder
bash ./lib/move_json_files.sh
# WARNING: This needs to be changed if we are going to make this utility configure Linux machines.
#:& Move assets into built release folder
bash ./lib/move_assets.sh
# WARNING: This needs to be changed if we are going to make this utility configure Linux machines.
#:& Move vc_runtime.bat into built release folder
bash ./lib/move_vc_runtime.sh