diff options
| author | 2019-07-18 01:31:55 -0400 | |
|---|---|---|
| committer | 2019-07-18 01:31:55 -0400 | |
| commit | 0f98c212db6e4cfd750dc1a52a31ddf9396a5e07 (patch) | |
| tree | bd0bd43b383bccc43d1950fd356472d69f9cd0f1 /osx_environment.sh | |
| parent | d8c416864c505aea70c70fd0d5f7991aa50d2ff9 (diff) | |
| parent | a916009d4b29995ea8ad61ad47a51c2ee1fa80bc (diff) | |
Update upstream source from tag 'upstream/2.3.0+dfsg'
Update to upstream version '2.3.0+dfsg'
with Debian dir f701d582fe3b6bb5189dbf035102670db9c2516b
Diffstat (limited to 'osx_environment.sh')
| -rw-r--r-- | osx_environment.sh | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/osx_environment.sh b/osx_environment.sh index e30a0c0..09fa347 100644 --- a/osx_environment.sh +++ b/osx_environment.sh @@ -1,15 +1,26 @@ #!/bin/bash +# Checks if directory exists, otherwise asks to install package. +function check_dir_exists() { + local path=$1 + local package=$2 + + if [ ! -d "$path" ]; then + echo "Please install $package" + exit 1 + fi +} + if [ ! $BARRIER_BUILD_ENV ]; then + check_dir_exists '/Applications/Xcode.app' 'Xcode' - printf "Modifying environment for Barrier build..." + printf "Modifying environment for Barrier build...\n" if command -v port; then - printf "Detected Macports" + printf "Detected Macports\n" + + check_dir_exists '/opt/local/lib/cmake/Qt5' 'qt5-qtbase port' - if [ ! -d /opt/local/lib/cmake/Qt5 ]; then - printf "Please install qt5-qtbase port" - fi export BARRIER_BUILD_MACPORTS=1 export CMAKE_PREFIX_PATH="/opt/local/lib/cmake/Qt5:$CMAKE_PREFIX_PATH" export LD_LIBRARY_PATH="/opt/local/lib:$LD_LIBRARY_PATH" @@ -17,10 +28,13 @@ if [ ! $BARRIER_BUILD_ENV ]; then export PKG_CONFIG_PATH="/opt/local/libexec/qt5/lib/pkgconfig:$PKG_CONFIG_PATH" elif command -v brew; then - printf "Detected Homebrew" + printf "Detected Homebrew\n" QT_PATH=$(brew --prefix qt) OPENSSL_PATH=$(brew --prefix openssl) + check_dir_exists "$QT_PATH" 'qt' + check_dir_exists "$OPENSSL_PATH" 'openssl' + export BARRIER_BUILD_BREW=1 export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH" export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH" @@ -28,7 +42,7 @@ if [ ! $BARRIER_BUILD_ENV ]; then export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH" else - printf "Neither Homebrew nor Macports is installed. Can't get dependency paths" + printf "Neither Homebrew nor Macports is installed. Can't get dependency paths\n" exit 1 fi |
