forked from sarah-walker-pcem/arculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac-install.sh
executable file
·79 lines (64 loc) · 2.51 KB
/
mac-install.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -e
ROMFILE='../../../riscos.rom' # PATH to RISOCS ROM file
# Check if running on MacOS
if [ "$(uname)" != "Darwin" ]; then
echo "This script must be run on a MacOS machine"
exit 1
fi
# Install Xcode
echo "Installing Xcode if needed.."
xcode-select --install || true
# Check for or install homebrew
if test ! $(which brew); then
echo "Installing homebrew.."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo "Installing Mac dependencies.."
brew install sdl2 libx11 gcc automake autoconf cmake libtool hunspell wget coreutils || true
# export LIBRARY_PATH="/usr/local/lib:/usr/local/Cellar/sdl2:/usr/local/lib:/usr/local/Cellar/sdl2:/opt/homebrew/lib:$(brew info libx11 | grep /usr | cut -d" " -f1)/lib:$(brew info sdl2 | grep /usr | cut -d" " -f1):/usr/local/include/wx-3.1"
# export LD_LIBRARY_PATH=/usr/local/lib
export LDFLAGS="-lX11"
# export C_INCLUDE_PATH=/usr/local/include/wx-3.1
# export CFLAGS="-I/usr/local/include"
# export CXXFLAGS="-I/usr/local/include -I/usr/local/include/wx-3.1"
# check if wxWidgets directory already exists
if [ ! -d "/usr/local/include/wx-3.2" ]; then
brew uninstall wxwidgets || true # Install wxwidgets from source (the brew version doesn't seem to work)
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.0/wxWidgets-3.2.0.tar.bz2
tar -xjf wxWidgets-3.2.0.tar.bz2 > /dev/null
cd wxWidgets-3.2.0 > /dev/null
echo "Building wxwidgets, this may take a while.."
sleep 2
./configure
make -j$(nproc) > /dev/null
echo ""
echo "Installing wxWidgets, you may be prompted for your password.."
sudo make install
cd -
#TODO: just extract the wx dir under ./src??
fi
# check if libtoolize exists
if [ -f "/usr/local/bin/libtoolize" ]; then
echo "libtoolize already installed."
else
echo "Linking glibtoolize to libtoolize.."
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
fi
autoreconf -i #Fixes "configure: error: cannot find install-sh, install.sh"
echo "Building arculator.."
make clean > /dev/null || true
# Swap the two lines below if you want to use the debug version
# ./configure --enable-release-build
./configure --enable-debug
make -j$(nproc) && clear
# Copy your RiscOS rom to the arculator ROMs folder
# Check ROMFILE exists
if [ -f "$ROMFILE" ]; then
echo "Copying $ROMFILE to arculator/roms dir.."
cp $ROMFILE roms/riscos310/ROM
else
echo "ROMFILE $ROMFILE not found.."
fi
echo ""
printf "Build completed!\n Use ./arculator to run\n\n"