forked from MeridianOXC/OpenXcom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_macos.sh
More file actions
68 lines (56 loc) · 1.95 KB
/
deploy_macos.sh
File metadata and controls
68 lines (56 loc) · 1.95 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
### x86_64 on arm
# softwareupdate --install-rosetta --agree-to-license
# arch -x86_64 zsh
### 0. Install development software
echo "Installing HomeBrew & CommandLineTools"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [[ `uname -p` == arm ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
else
eval "$(/usr/local/bin/brew shellenv)"
fi
### 1. Prepare environment
# sdl_image and sdl_mixer now disabled in upstream
brew tap --force homebrew/core
brew edit sdl_image # rm disable!
brew edit sdl_mixer # rm disable!
HOMEBREW_NO_INSTALL_FROM_API=1 brew install sdl_image sdl_mixer
# Mojave compatibility
brew install curl
brew install cmake pkg-config sdl12-compat sdl_image sdl_gfx sdl_mixer yaml-cpp doxygen
cd ~
git clone https://github.com/MeridianOXC/OpenXcom.git
mkdir OpenXcom/build && cd OpenXcom/build
cmake .. -DCMAKE_BUILD_TYPE=Release
### 2. Copy SDL2 to bundle
mkdir -p openxcom.app/Contents/Frameworks/
libSDL2=`brew info SDL2 | grep Cellar | awk '{print $1}'`
cp $libSDL2/lib/libSDL2-2.0.0.dylib openxcom.app/Contents/Frameworks
### 3. Make and install
make -j4
# fix SDL distribute
sudo xattr -cr openxcom.app
codesign --force --deep --sign - openxcom.app
mv /Applications/openxcom.app /Applications/openxcom_old.app
mv openxcom.app /Applications
### 4. Clean environment
# git sources
cd ../..
rm -rf ./OpenXcom
# remove development software
read -q "REPLY?Remove HomeBrew and free 1Gb? (y/n) "
read -p "Remove HomeBrew and free 1Gb? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
echo "Clean HomeBrew data"
sudo rm -r /opt/homebrew
sudo rm -r /usr/local/homebrew
fi
read -q "REPLY?Remove CommandLineTools and free 4Gb? (y/n) "
read -p "Remove CommandLineTools and free 4Gb? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo rm -r /Library/Developer/CommandLineTools
fi
echo