Fix OSX compile and deploy
authorromibi <romibi@bluewin.ch>
Fri, 1 Sep 2017 08:06:10 +0000 (10:06 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 4 Apr 2018 21:14:04 +0000 (23:14 +0200)
Set additional compile flag
Fix DMG creation (sometimes fails if no volume size is provided)

Closes GH-304.

(cherry picked from commit 8a7444f4ed825b65acc874d9c2e8359f82523ac0)

Conflicts:
    .travis.yml
    cmake/FindLdap.cmake

.travis.yml
cmake/QuasselCompileSettings.cmake
scripts/build/macosx_makePackage.sh

index bc92eac..5f48a06 100644 (file)
@@ -1,6 +1,5 @@
 os:
   - linux
-  - osx
 
 sudo: required
 dist: trusty
@@ -17,13 +16,13 @@ env:
   - QT_VERSION=qt5
 
 matrix:
+  include:
+    - os: osx
+      compiler: gcc
+      env: QT_VERSION=qt5
   exclude:
     - compiler: clang
       env: QT_VERSION=qt4
-    - os: osx
-      compiler: clang
-    - os: osx
-      env: QT_VERSION=qt4
 
 install: |-
   if [ "$TRAVIS_OS_NAME" == "linux" ]
@@ -50,12 +49,12 @@ script: |-
     make
   elif [ "$TRAVIS_OS_NAME" == "osx" ]
   then
+    PATH=$PATH:/usr/local/opt/qt5/bin
     if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]
     then
-      PATH=$PATH:/usr/local/opt/qt5/bin
-      cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT5=ON -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON -DDEPLOY=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5
+      cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT5=ON -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON -DDEPLOY=ON
     else
-      cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT5=ON -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5
+      cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT5=ON -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON
     fi
     ninja install
   fi
index f46c515..9f3e00a 100644 (file)
@@ -80,6 +80,5 @@ endif()
 # Mac build stuff
 if (APPLE AND DEPLOY)
     set(CMAKE_OSX_ARCHITECTURES "x86_64")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9")
-    set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9 -stdlib=libc++")
 endif()
index 05a1cd2..4f41171 100755 (executable)
@@ -80,5 +80,6 @@ case $BUILDTYPE in
        exit 1
        ;;
 esac
-hdiutil create -srcfolder ${PACKAGETMPDIR} -format UDBZ -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "${WORKINGDIR}${QUASSEL_DMG}" >/dev/null
+PACKAGESIZE=$(echo "$(du -ms ${PACKAGETMPDIR} | cut -f1) * 1.1" | bc)
+hdiutil create -srcfolder ${PACKAGETMPDIR} -format UDBZ -size ${PACKAGESIZE}M -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "${WORKINGDIR}${QUASSEL_DMG}" >/dev/null
 rm -rf ${PACKAGETMPDIR}