diff options
Diffstat (limited to 'macosx-setup.sh')
-rwxr-xr-x | macosx-setup.sh | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/macosx-setup.sh b/macosx-setup.sh index 3735b58845..23263ad79d 100755 --- a/macosx-setup.sh +++ b/macosx-setup.sh @@ -103,6 +103,7 @@ if [ "$QT_VERSION" ]; then QT_MINOR_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`" QT_DOTDOT_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`" QT_MAJOR_MINOR_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION + QT_MAJOR_MINOR_DOTDOT_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION.$QT_DOTDOT_VERSION fi # In case we want to build GTK *and* we don't have Apple's X11 SDK installed @@ -365,7 +366,7 @@ install_cmake() { # 3) it can't be run from the command line; # # so we do it ourselves. - # + # for i in ccmake cmake cmake-gui cmakexbuild cpack ctest do sudo ln -s /Applications/CMake.app/Contents/bin/$i /usr/local/bin/$i @@ -608,14 +609,31 @@ install_qt() { # What you get for this URL might just be a 302 Found reply, so use # -L so we get redirected. # - [ -f qt-opensource-mac-x64-clang-$QT_VERSION.dmg ] || curl -L -O http://download.qt.io/archive/qt/$QT_MAJOR_MINOR_VERSION/$QT_VERSION/qt-opensource-mac-x64-clang-$QT_VERSION.dmg || exit 1 - sudo hdiutil attach qt-opensource-mac-x64-clang-$QT_VERSION.dmg || exit 1 + if [ "$QT_MAJOR_VERSION" -ge 5 ] + then + QT_VOLUME=qt-opensource-mac-x64-clang-$QT_VERSION + else + QT_VOLUME=qt-opensource-mac-$QT_VERSION + fi + [ -f $QT_VOLUME.dmg ] || curl -L -O http://download.qt.io/archive/qt/$QT_MAJOR_MINOR_VERSION/$QT_MAJOR_MINOR_DOTDOT_VERSION/$QT_VOLUME.dmg || exit 1 + sudo hdiutil attach $QT_VOLUME.dmg || exit 1 - # - # Run the executable directly, so that we wait for it to finish. - # - /Volumes/qt-opensource-mac-x64-clang-$QT_VERSION/qt-opensource-mac-x64-clang-$QT_VERSION.app/Contents/MacOS/qt-opensource-mac-x64-clang-$QT_VERSION - sudo hdiutil detach /Volumes/qt-opensource-mac-x64-clang-$QT_VERSION + if [ "$QT_MAJOR_VERSION" -ge 5 ] + then + # + # Run the installer executable directly, so that we wait for + # it to finish. Then unmount the volume. + # + /Volumes/$QT_VOLUME/$QT_VOLUME.app/Contents/MacOS/$QT_VOLUME + sudo hdiutil detach /Volumes/$QT_VOLUME + else + # + # Open the installer package; use -W, so that we wait for + # the installer to finish. Then unmount the volume. + # + open -W "/Volumes/Qt $QT_MAJOR_MINOR_DOTDOT_VERSION/Qt.mpkg" + sudo hdiutil detach "/Volumes/Qt $QT_MAJOR_MINOR_DOTDOT_VERSION" + fi # # Versions 5.3.x through 5.5.0, at least, have bogus .pc files. |