From 1575488f5a47485483d4ac2a1a58ae1540f3451d Mon Sep 17 00:00:00 2001 From: Balletie Date: Mon, 18 Aug 2014 12:45:13 +0200 Subject: [PATCH 1/3] Add fallback to MacPorts if brew isn't installed --- install.sh | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index f74e9bcf92..97b25a9af7 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,5 @@ #!/bin/bash -set -e - SDL2_PV=2.0.3 cachedir=.cache @@ -11,13 +9,37 @@ echo `uname` if [[ `uname` == "Darwin" ]]; then echo "Installation of OpenRCT2 assumes you have homebrew and use it to install packages." + + echo "Check if brew is installed" + package_command="brew" + which -s brew + if [ $? -eq 1 ]; then + echo "brew is not installed, or is not in your \$PATH" + echo "Check if MacPorts is installed" + which -s port + if [ $? -eq 1 ]; then + echo "MacPorts not found either, abort" + exit + else + echo "MacPorts found" + package_command="sudo port" + fi + else + echo "brew was found" + fi + + # Install packages with whatever command was found. # Very possible I'm missing some dependencies here. - brew install cmake wine + eval "$package_command install cmake wine" if [[ ! -d /usr/include/wine ]]; then # This will almost certainly break as brew changes. Better ideas # welcome. - sudo ln -s /usr/local/Cellar/wine/1.6.2/include/wine /usr/include + wine_path="/usr/local/Cellar/wine/1.6.2/include/wine" + if [ $package_command == "sudo port" ]; then + wine_path="/opt/local/include/wine" + fi + sudo ln -s $wine_path /usr/include fi mingw_dmg=gcc-4.8.0-qt-4.8.4-for-mingw32.dmg @@ -68,7 +90,7 @@ if [[ ! -f $cachedir/i686-w64-mingw32-pkg-config ]]; then # If this fails to work because of newlines, be sure you are running this # script with Bash, and not sh. We should really move this to a separate # file. - echo -e "#! /bin/sh\nexport PKG_CONFIG_LIBDIR=/usr/local/cross-tools/i686-w64-mingw32/lib/pkgconfig\npkg-config \$@" > $cachedir/i686-w64-mingw32-pkg-config; + echo -e "#!/bin/sh\nexport PKG_CONFIG_LIBDIR=/usr/local/cross-tools/i686-w64-mingw32/lib/pkgconfig\npkg-config \$@" > $cachedir/i686-w64-mingw32-pkg-config; fi chmod +x $cachedir/i686-w64-mingw32-pkg-config From 7563601050895ed6e52cafab39010b6c5988dde7 Mon Sep 17 00:00:00 2001 From: Balletie Date: Mon, 18 Aug 2014 12:46:03 +0200 Subject: [PATCH 2/3] Install wget if it's not found --- install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.sh b/install.sh index 97b25a9af7..7f4357c233 100755 --- a/install.sh +++ b/install.sh @@ -28,6 +28,13 @@ if [[ `uname` == "Darwin" ]]; then echo "brew was found" fi + echo "Check if wget is installed" + which -s wget + if [ $? -eq 1 ]; then + echo "wget is not installed, installing wget.." + eval "$package_command install wget" + fi + # Install packages with whatever command was found. # Very possible I'm missing some dependencies here. eval "$package_command install cmake wine" From 6208aeb57a1c6a4e5e61a2f0d7fb913cc684d59c Mon Sep 17 00:00:00 2001 From: Balletie Date: Mon, 18 Aug 2014 12:51:31 +0200 Subject: [PATCH 3/3] Untabify the file --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 7f4357c233..3439d41eef 100755 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ if [[ `uname` == "Darwin" ]]; then echo "Check if wget is installed" which -s wget if [ $? -eq 1 ]; then - echo "wget is not installed, installing wget.." + echo "wget is not installed, installing wget.." eval "$package_command install wget" fi