diff --git a/dist/macos/bundle/build_dist.sh.in b/dist/macos/bundle/build_dist.sh.in index c96da790..26a93201 100755 --- a/dist/macos/bundle/build_dist.sh.in +++ b/dist/macos/bundle/build_dist.sh.in @@ -1,7 +1,7 @@ #!/bin/sh # Use the same verbose variable as CMake -[ "$VERBOSE" == "1" ] && set -x +[ "$VERBOSE" = "1" ] && set -x # Exit on unset variables or pipe errors set -uo pipefail @@ -14,10 +14,10 @@ B_BARRIERC="Barrier.app/Contents/MacOS/barrierc" B_BARRIERS="Barrier.app/Contents/MacOS/barriers" # Colorized output -function info() { tput bold; echo "$@" ; tput sgr0 ;} -function error() { tput bold; tput setaf 1; echo "$@"; tput sgr0 ; } -function success() { tput bold; tput setaf 2; echo "$@"; tput sgr0 ; } -function warn() { tput bold; tput setaf 3; echo "$@"; tput sgr0 ; } +info() { tput bold; echo "$@"; tput sgr0 ; } +error() { tput bold; tput setaf 1; echo "$@"; tput sgr0 ; } +success() { tput bold; tput setaf 2; echo "$@"; tput sgr0 ; } +warn() { tput bold; tput setaf 3; echo "$@"; tput sgr0 ; } info "Checking for bundle contents" if [ ! -d "Barrier.app/Contents" ]; then @@ -40,7 +40,7 @@ if which -s port ; then info "MacPorts found, searching for macdeployqt" DEPLOYQT="$(port contents qt5-qttools | grep --only --max-count 1 '/.*macdeployqt')" if [ ! -x "$DEPLOYQT" ]; then - error Please install package qt5-qttools + error "Please install package qt5-qttools" exit 1 fi fi @@ -48,15 +48,15 @@ fi # Check for macdeployqt on Homebrew if which -s brew ; then info "Homebrew found, searching for macdeployqt" - DEPLOYQT="$(brew list qt | grep --only '/.*macdeployqt' | head -1)" + DEPLOYQT="$(brew list qt@5 | grep --only '/.*macdeployqt' | head -1)" if [ ! -x "$DEPLOYQT" ]; then - error Please install package qt + error "Please install package qt" exit 1 fi fi # Use macdeployqt to include libraries and create dmg -if [ "$B_BUILDTYPE" == "Release" ]; then +if [ "$B_BUILDTYPE" = "Release" ]; then info "Building Release disk image (dmg)" "$DEPLOYQT" Barrier.app -dmg \ -executable="$B_BARRIERC" \ @@ -70,4 +70,4 @@ else -executable="$B_BARRIERC" \ -executable="$B_BARRIERS" || exit 1 success "Bundle created successfully" -fi \ No newline at end of file +fi diff --git a/osx_environment.sh b/osx_environment.sh index 09fa3479..2ee886da 100644 --- a/osx_environment.sh +++ b/osx_environment.sh @@ -1,7 +1,7 @@ #!/bin/bash # Checks if directory exists, otherwise asks to install package. -function check_dir_exists() { +check_dir_exists() { local path=$1 local package=$2 @@ -11,7 +11,7 @@ function check_dir_exists() { fi } -if [ ! $BARRIER_BUILD_ENV ]; then +if [ -z "$BARRIER_BUILD_ENV" ]; then check_dir_exists '/Applications/Xcode.app' 'Xcode' printf "Modifying environment for Barrier build...\n" @@ -29,18 +29,15 @@ if [ ! $BARRIER_BUILD_ENV ]; then elif command -v brew; then printf "Detected Homebrew\n" - QT_PATH=$(brew --prefix qt) - OPENSSL_PATH=$(brew --prefix openssl) + QT_PATH=$(brew --prefix qt@5) - check_dir_exists "$QT_PATH" 'qt' - check_dir_exists "$OPENSSL_PATH" 'openssl' + check_dir_exists "$QT_PATH" 'qt5' export BARRIER_BUILD_BREW=1 - export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH" - export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH" - export CPATH="$OPENSSL_PATH/include:$CPATH" - export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH" - + export CMAKE_PREFIX_PATH="/opt/procursus:$QT_PATH:$CMAKE_PREFIX_PATH" + export LD_LIBRARY_PATH="/opt/procursus/lib:$LD_LIBRARY_PATH" + export CPATH="/opt/procursus/include:$CPATH" + export PKG_CONFIG_PATH="/opt/procursus/lib/pkgconfig:$PKG_CONFIG_PATH" else printf "Neither Homebrew nor Macports is installed. Can't get dependency paths\n" exit 1