forked from fosterbarnes/YTPlusYTweaks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_dependencies.sh
More file actions
executable file
·142 lines (124 loc) · 4.05 KB
/
build_dependencies.sh
File metadata and controls
executable file
·142 lines (124 loc) · 4.05 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
echo "=========================================="
echo "Build Dependencies Setup Script"
echo "=========================================="
echo ""
echo "[Step 1/7] Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo ""
echo "[Step 2/7] Configuring Homebrew..."
#detect homebrew path (Apple Silicon uses /opt/homebrew, Intel uses /usr/local)
if [ -f "/opt/homebrew/bin/brew" ]; then
BREW_PATH="/opt/homebrew/bin/brew"
echo " Detected Apple Silicon Homebrew installation"
elif [ -f "/usr/local/bin/brew" ]; then
BREW_PATH="/usr/local/bin/brew"
echo " Detected Intel Homebrew installation"
else
# Try to find brew in PATH after installation
BREW_PATH=$(which brew)
if [ -z "$BREW_PATH" ]; then
echo "Error: Could not find Homebrew installation"
exit 1
fi
echo " Found Homebrew in PATH: $BREW_PATH"
fi
#add to shell profile (detect which profile to use)
if [ -f "$HOME/.zprofile" ]; then
PROFILE="$HOME/.zprofile"
elif [ -f "$HOME/.zshrc" ]; then
PROFILE="$HOME/.zshrc"
elif [ -f "$HOME/.bash_profile" ]; then
PROFILE="$HOME/.bash_profile"
else
PROFILE="$HOME/.zprofile"
fi
echo " Using shell profile: $PROFILE"
echo >> "$PROFILE"
echo "eval \"\$($BREW_PATH shellenv)\"" >> "$PROFILE"
eval "$($BREW_PATH shellenv)"
echo " Homebrew version: $(brew --version | head -n1)"
echo ""
echo "[Step 3/7] Installing build tools (wget, make, ldid, pipx)..."
echo " Installing wget..."
brew install wget
echo " Installing make, ldid, and pipx..."
brew install make ldid pipx
#update path for new version of make
echo 'export PATH="$(brew --prefix make)/libexec/gnubin:$PATH"' >> "$PROFILE"
source "$PROFILE"
#pipx to path
echo " Configuring pipx..."
pipx ensurepath
echo ""
echo "[Step 4/7] Setting up Theos..."
THEOS_DIR="$HOME/theos"
echo " Creating Theos directory: $THEOS_DIR"
mkdir -p "$THEOS_DIR"
cd "$THEOS_DIR"
echo " Cloning Theos repository (this may take a moment)..."
git clone --recursive https://github.com/theos/theos.git .
echo " Checking out specific Theos version..."
git checkout 67db2ab8d950910161730de77c322658ea3e6b44
echo " Adding Theos to shell profile..."
echo "export THEOS=\"$THEOS_DIR\"" >> "$PROFILE"
echo 'export PATH=$THEOS/bin:$PATH' >> "$PROFILE"
export THEOS="$THEOS_DIR"
echo " Theos installed at: $THEOS"
echo ""
echo "[Step 5/7] Downloading iOS 16.5 SDK..."
cd "$THEOS_DIR"
rm -rf sdks
echo " Cloning iOS SDK repository..."
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/theos/sdks/
cd sdks
echo " Downloading iPhoneOS16.5.sdk..."
git sparse-checkout set --no-cone iPhoneOS16.5.sdk
git checkout
echo " Done!"
echo ""
echo "[Step 6/7] Installing Cyan..."
echo " Installing Cyan via pipx..."
pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip
echo " Done!"
echo ""
echo "[Step 7/7] Verifying installation..."
echo ""
echo "=== Build Environment Test ==="
echo ""
source $PROFILE
echo "1. System Tools:"
echo " Xcode CLI: $(xcode-select -p)"
echo " Homebrew: $(brew --version | head -n1)"
echo " Git: $(git --version)"
echo " wget: $(wget --version | head -n1)"
echo ""
echo "2. Build Tools:"
echo " Make: $(make --version | head -n1)"
echo " ldid: $(ldid 2>&1 | head -n1)"
echo " pipx: $(pipx --version)"
echo ""
echo "3. Theos:"
echo " THEOS: $THEOS"
if [ -d "$THEOS" ]; then
echo " Theos exists: ✓"
echo " SDKs: $(ls $THEOS/sdks/ 2>/dev/null | wc -l | xargs) SDK(s) found"
else
echo " Theos exists: ✗"
fi
echo ""
echo "4. Cyan:"
if command -v cyan &> /dev/null; then
echo " Cyan installed: ✓"
else
echo " Cyan installed: ✗ (Terminal may need to be restarted for changes to take effect)"
fi
echo ""
echo "=== Test Complete ==="
echo ""
echo "=========================================="
echo "Setup Complete!"
echo "=========================================="
echo "All dependencies have been installed and configured."
echo "You may need to restart your terminal or run 'source $PROFILE'"
echo "for all changes to take effect."
echo ""