From b8fa610f8f294bbe75b60cfb16ce53284f395977 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Fri, 19 Oct 2018 20:17:04 +0300 Subject: [PATCH] Build full installer via clean_build.sh (#157) * OSX: Fix lack of newlines in build messages * OSX: Build full installer as part of the installer build via cmake --- CMakeLists.txt | 7 +++++++ dist/macos/bundle/build_installer.sh.in | 5 ++++- osx_environment.sh | 10 +++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6f6aa72..11f34690 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -388,6 +388,13 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (BARRIER_BUNDLE_BINARY_DIR ${BARRIER_BUNDLE_APP_DIR}/Contents/MacOS) configure_files (${BARRIER_BUNDLE_SOURCE_DIR} ${BARRIER_BUNDLE_DIR}) + + if (CMAKE_BUILD_TYPE STREQUAL "Release") + add_custom_target(Barrier_dmg ALL + bash build_installer.sh + DEPENDS barrier barriers barrierc + WORKING_DIRECTORY ${BARRIER_BUNDLE_DIR}) + endif() endif() # diff --git a/dist/macos/bundle/build_installer.sh.in b/dist/macos/bundle/build_installer.sh.in index f939b776..40f40745 100755 --- a/dist/macos/bundle/build_installer.sh.in +++ b/dist/macos/bundle/build_installer.sh.in @@ -41,7 +41,10 @@ cp @CMAKE_RUNTIME_OUTPUT_DIRECTORY@/* . || exit 1 # TODO: this is hacky and will probably break if there is more than one qt # version installed. need a better way to find this library B_COCOA=$(find /usr/local/Cellar/qt -type f -name libqcocoa.dylib | head -1) -if [ $? -ne 0 ] || [ "x$B_COCOA" = "x" ]; then +if [ "x$B_COCOA" = "x" ]; then + B_COCOA=$(find /opt/local/libexec/qt5/plugins -type f -name libqcocoa.dylib | head -1) +fi +if [ "x$B_COCOA" = "x" ]; then echo "Could not find cocoa platform plugin" exit 1 fi diff --git a/osx_environment.sh b/osx_environment.sh index e30a0c00..12366c04 100644 --- a/osx_environment.sh +++ b/osx_environment.sh @@ -2,13 +2,13 @@ if [ ! $BARRIER_BUILD_ENV ]; then - 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" if [ ! -d /opt/local/lib/cmake/Qt5 ]; then - printf "Please install qt5-qtbase port" + printf "Please install qt5-qtbase port\n" fi export BARRIER_BUILD_MACPORTS=1 export CMAKE_PREFIX_PATH="/opt/local/lib/cmake/Qt5:$CMAKE_PREFIX_PATH" @@ -17,7 +17,7 @@ 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) @@ -28,7 +28,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