From aa1f314464d7c490fc0f07d5bfc831af98be4315 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 12 Feb 2019 19:02:07 -0800 Subject: [PATCH] Fix directory containing compiled plugins in macOS. They weren't getting put in the version-number subdirectory, so the plugin loader wasn't finding them. If that causes problems with codesign, then we need to either 1) figure out how to make it work with codesign or 2) for macOS, not put plugins in a version-number subdirectory ***AND*** change the plugin loading process not to look for compiled in a version-number subdirectory. Change-Id: I58d344b728d05369d35edef4e4e530f10034e930 Reviewed-on: https://code.wireshark.org/review/32000 Reviewed-by: Guy Harris --- CMakeLists.txt | 17 +++++++++++------ packaging/macosx/osx-app.sh.in | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d937d724d9..c8ea2ea39b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1409,14 +1409,19 @@ else() endif() if(ENABLE_APPLICATION_BUNDLE) - # codesign barfs if we put our plugins in a dotted version subdirectory, - # e.g. PlugIns/Wireshark/3.1/epan so leave the version component out - # for now. + # + # XXX - codesign barfs if we put our plugins in a dotted version + # subdirectory, e.g. PlugIns/Wireshark/3.1/epan, so we either + # need to figure out how to make it work, or need to leave the + # version component out *AND*, on macOS, look for compiled + # plugins in the plugins directory rather than in the dotted + # version subdirectory. + # if(CMAKE_CFG_INTDIR STREQUAL ".") - set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark") + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_RELEASE_VERSION}") else() - # Xcode - set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$/Wireshark.app/Contents/PlugIns/wireshark") + # Xcode + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_RELEASE_VERSION}") endif() elseif(WIN32 AND NOT CMAKE_CFG_INTDIR STREQUAL ".") set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$/${PLUGIN_VERSION_DIR}") diff --git a/packaging/macosx/osx-app.sh.in b/packaging/macosx/osx-app.sh.in index 4ed87e1dd8..d4d5024ad1 100755 --- a/packaging/macosx/osx-app.sh.in +++ b/packaging/macosx/osx-app.sh.in @@ -123,7 +123,7 @@ exclude_prefixes="$exclude_prefixes|$qt_frameworks_dir" pkgexec="$bundle/Contents/MacOS" #pkgres="$bundle/Contents/Resources" pkglib="$bundle/Contents/Frameworks" -pkgplugin="$bundle/Contents/PlugIns/wireshark" +pkgplugin="$bundle/Contents/PlugIns/wireshark/@VERSION_MAJOR@.@VERSION_MINOR@" # Set the 'macosx' directory, usually the current directory. #resdir=$( pwd )