diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-12-14 11:30:39 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-12-15 07:38:08 +0000 |
commit | e13d8be96284318b95ddafaecd6403a87f618c1c (patch) | |
tree | 01e2fe5325d01fbf32ccca71f2db0d6840d40fed | |
parent | b22da8bc5ddc6813ff4ce968a032953aa62f1fe2 (diff) |
CMake: Make sure we use the same minimum macOS version everywhere.
Add a MIN_MACOS_VERSION variable. Update it and sanity check it
according to CMAKE_OSX_DEPLOYMENT_TARGET and our Qt version. Use it to
set our minimum macOS version in various places.
Change-Id: Icaf0dbe463f34d182986868021e2b56d2239da38
Reviewed-on: https://code.wireshark.org/review/31048
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | CMakeLists.txt | 41 | ||||
-rw-r--r-- | packaging/macosx/Info.plist.in | 2 | ||||
-rw-r--r-- | packaging/macosx/Read_me_first.rtf.in (renamed from packaging/macosx/Read_me_first.rtf) | 79 | ||||
-rwxr-xr-x | packaging/macosx/osx-dmg.sh.in | 4 |
4 files changed, 66 insertions, 60 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index dee3c45fa5..b08c9456a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -419,25 +419,13 @@ if( CMAKE_C_COMPILER_ID MATCHES "MSVC") set(CMAKE_CXX_FLAGS "${_flags} ${CMAKE_CXX_FLAGS}") else() # ! MSVC - if(CMAKE_OSX_DEPLOYMENT_TARGET) - if(APPLE) - if(CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.0") - message(FATAL_ERROR "We don't support building for Mac OS X 10.0") - elseif(CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.1") - message(FATAL_ERROR "We don't support building for Mac OS X 10.1") - elseif(CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.2") - message(FATAL_ERROR "We don't support building for Mac OS X 10.2") - elseif(CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.4" OR CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.5") - # - # Only 32-bit builds are supported. 10.5 - # (and 10.4?) had a bug that causes some BPF - # functions not to work with 64-bit userland - # code, so capturing won't work. - # - set(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}") - set(WS_LINK_FLAGS "-m32 ${WS_LINK_FLAGS}") + if(APPLE) + set(MIN_MACOS_VERSION 10.6) # Arbitrary. + if(CMAKE_OSX_DEPLOYMENT_TARGET) + if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS MIN_MACOS_VERSION) + message(FATAL_ERROR "We don't support building for macOS < ${MIN_MACOS_VERSION}") endif() + set(MIN_MACOS_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET}) message(STATUS "Building for Mac OS X/OS X/macOS ${CMAKE_OSX_DEPLOYMENT_TARGET}") else() message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET only applies when building for macOS") @@ -1234,6 +1222,7 @@ endif() if(SNAPPY_FOUND) set(HAVE_SNAPPY 1) endif() + if (Qt5Widgets_FOUND) if (Qt5Widgets_VERSION VERSION_LESS 5.2) message(FATAL_ERROR "Qt 5.2 or later is required.") @@ -1291,6 +1280,21 @@ if (Qt5Widgets_FOUND) HINTS "${QT_BIN_PATH}" DOC "Path to the macdeployqt utility." ) + # https://doc.qt.io/qt-5.11/supported-platforms-and-configurations.html + if(Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.12.0") + set(MIN_MACOS_VERSION 10.12) + elseif(Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.10.0") + set(MIN_MACOS_VERSION 10.11) + elseif(Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.9.0") + set(MIN_MACOS_VERSION 10.10) + elseif(Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.8.0") + set(MIN_MACOS_VERSION 10.9) + elseif(Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.5.0") + set(MIN_MACOS_VERSION 10.8) + endif() + if(CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS MIN_MACOS_VERSION) + message(FATAL_ERROR "Qt version ${Qt5Widgets_VERSION} requires CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) >= ${MIN_MACOS_VERSION}") + endif() endif() endif() @@ -1519,6 +1523,7 @@ set(CFG_OUT_FILES packaging/macosx/Info.plist packaging/macosx/osx-app.sh packaging/macosx/osx-dmg.sh + packaging/macosx/Read_me_first.rtf packaging/macosx/Wireshark_package.pmdoc/index.xml wireshark.pc ) diff --git a/packaging/macosx/Info.plist.in b/packaging/macosx/Info.plist.in index 6acc5f4cad..d018aabae1 100644 --- a/packaging/macosx/Info.plist.in +++ b/packaging/macosx/Info.plist.in @@ -238,6 +238,6 @@ <key>NSRequiresAquaSystemAppearance</key> <true/> <key>LSMinimumSystemVersion</key> - <string>10.6</string> + <string>@MIN_MACOS_VERSION@</string> </dict> </plist> diff --git a/packaging/macosx/Read_me_first.rtf b/packaging/macosx/Read_me_first.rtf.in index 6ecc0d5421..d6d7885866 100644 --- a/packaging/macosx/Read_me_first.rtf +++ b/packaging/macosx/Read_me_first.rtf.in @@ -1,7 +1,8 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170 +{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600 \cocoascreenfonts1{\fonttbl\f0\froman\fcharset0 TimesNewRomanPSMT;\f1\fswiss\fcharset0 Helvetica;\f2\fnil\fcharset0 Menlo-Regular; } -{\colortbl;\red255\green255\blue255;} +{\colortbl;\red255\green255\blue255;\red38\green38\blue38;\red242\green242\blue242;} +{\*\expandedcolortbl;;\cssrgb\c20000\c20000\c20000;\cssrgb\c96078\c96078\c96078;} {\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid1\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid1} {\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2} {\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3} @@ -9,86 +10,86 @@ {\list\listtemplateid5\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid401\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid5}} {\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}} \margl1440\margr1440\vieww13060\viewh12960\viewkind0 -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f0\b\fs28 \cf0 Before You Begin\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 -\f1\b0\fs24 \cf0 This release of Wireshark requires Mac OS X 10.5.5 or later. If you are running Mac OS X 10.5.4 or older you can install using another packaging system such as MacPorts or Homebrew. +\f1\b0\fs24 \cf0 This release of Wireshark requires macOS @MIN_MACOS_VERSION@ or later. If you are running an earlier version of macOS you can install using another packaging system such as Homebrew or MacPorts. \f0\b\fs28 \ \ Quick Setup\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \b0\fs24 \cf0 \ -\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0 \ls1\ilvl0 \f1 \cf0 Simply double-click the Wireshark package. For details about the installation read below.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \cf0 \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f0\b\fs28 \cf0 What changes does the installer make?\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \b0\fs24 \cf0 \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f1 \cf0 The installer writes to the following locations:\ \ -\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural -\ls2\ilvl0\cf0 {\listtext \'95 } +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0 +\ls2\ilvl0\cf0 {\listtext \uc0\u8226 } \i /Applications/Wireshark.app \i0 . The main Wireshark application.\ -{\listtext \'95 } +{\listtext \uc0\u8226 } \i /Library/LaunchDaemons/org.wireshark.ChmodBPF.plist \i0 . A launch daemon that adjusts permissions on the system's packet capture devices ( \i /dev/bpf \i0 *) when the system starts up.\ -{\listtext \'95 } +{\listtext \uc0\u8226 } \i /Library/Application Support/Wireshark/ChmodBPF \i0 A copy of the launch daemon property list, and the script that the launch daemon runs.\ -{\listtext \'95 } +{\listtext \uc0\u8226 } \i /usr/local/bin \i0 . A wrapper script and symbolic links which will let you run Wireshark and its associated utilities from the command line. You can access them directly or by adding /usr/local/bin to your PATH if it's not already in your PATH.\ -\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural -\ls3\ilvl0\cf0 {\listtext \'95 } +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0 +\ls3\ilvl0\cf0 {\listtext \uc0\u8226 } \i /etc/paths.d/Wireshark \i0 . The folder name in this file is automatically added to PATH\ -{\listtext \'95 } +{\listtext \uc0\u8226 } \i /etc/manpaths.d/Wireshark \i0 . The folder name in this file is used by the man command.\ -\pard\tx560\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx560\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \cf0 \ -Additionally a group named +Additionally a group named \i access_bpf \i0 is created. The user who opened the package is added to the group.\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f0\b\fs28 \cf0 How do I uninstall?\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \b0\fs24 \cf0 \ -\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0 \ls4\ilvl0 -\f1 \cf0 {\listtext 1. }Remove +\f1 \cf0 {\listtext 1. }Remove \i /Applications/Wireshark.app \i0 \ -{\listtext 2. }Remove +{\listtext 2. }Remove \i /Library/Application Support/Wireshark \i0 \ -{\listtext 3. }Remove the wrapper scripts from +{\listtext 3. }Remove the wrapper scripts from \i /usr/local/bin \i0 \ -{\listtext 4. }Unload the +{\listtext 4. }Unload the \i org.wireshark.ChmodBPF.plist \i0 launchd job\ -{\listtext 5. }Remove +{\listtext 5. }Remove \i /Library/LaunchDaemons/org.wireshark.ChmodBPF.plist \i0 \ -{\listtext 6. }Remove the +{\listtext 6. }Remove the \i access_bpf \i0 group.\ {\listtext 7. }Remove @@ -97,23 +98,23 @@ Additionally a group named {\listtext 8. }Remove \i /etc/manpaths.d/Wireshark \i0 \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f0\b\fs28 \cf0 \ How does the wrapper script work? What if I move Wireshark.app?\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \b0\fs24 \cf0 \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f1 \cf0 The script should find the Wireshark application bundle and run the appropriate executable automatically. It looks for Wireshark.app in the following locations:\ \ -\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural -\ls5\ilvl0\cf0 {\listtext \'95 }The path set in the WIRESHARK_APP_DIR environment variable\ -{\listtext \'95 }/Applications/Wireshark.app\ -{\listtext \'95 }The first path returned by +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0 +\ls5\ilvl0\cf0 {\listtext \uc0\u8226 }The path set in the WIRESHARK_APP_DIR environment variable\ +{\listtext \uc0\u8226 }/Applications/Wireshark.app\ +{\listtext \uc0\u8226 }The first path returned by \f2 mdfind "kMDItemCFBundleIdentifier == 'org.wireshark.Wireshark'" \f1 \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \cf0 \ -If you move Wireshark.app the script should automatically find it. If it doesn't you will have to set WIRESHARK_APP_DIR to the path to (and including) Wireshark.app. Automatic discovery might fail if you have multiple copies of Wireshark installed on your system or if Spotlight indexing isn't working properly.}
\ No newline at end of file +If you move Wireshark.app the script should automatically find it. If it doesn't you will have to set WIRESHARK_APP_DIR to the path to (and including) Wireshark.app. Automatic discovery might fail if you have multiple copies of Wireshark installed on your system or if Spotlight indexing isn't working properly.} diff --git a/packaging/macosx/osx-dmg.sh.in b/packaging/macosx/osx-dmg.sh.in index 431f4a94a1..b1535e286b 100755 --- a/packaging/macosx/osx-dmg.sh.in +++ b/packaging/macosx/osx-dmg.sh.in @@ -163,7 +163,7 @@ $packagemaker --doc "Wireshark_package.pmdoc" \ --title "$pkg_title" \ --id "org.wireshark.pkg.Wireshark" \ --version "$version" \ - --target 10.5 \ + --target @MIN_MACOS_VERSION@ \ --verbose || exit 1 if [ -n "$CODE_SIGN_IDENTITY" ] ; then @@ -191,7 +191,7 @@ echo -e "Copying files to temp directory" # Copy the installer package cp "$pkg_file" "$tmp_dir"/ || exit 1 # Copy the readme -cp "$src_dir/Read_me_first.rtf" "$tmp_dir/Read me first.rtf" || exit 1 +cp "../packaging/macos/Read_me_first.rtf" "$tmp_dir/Read me first.rtf" || exit 1 # If the appearance settings are not to be modified we just copy them if [ ${set_ds_store} = "false" ]; then |