aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt40
-rw-r--r--cmakeconfig.h.in2
-rwxr-xr-xpackaging/macosx/osx-app.sh.in2
-rw-r--r--wsutil/filesystem.c4
4 files changed, 25 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb2b31a8cd..61bc971eac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,23 @@ set(PROJECT_MINOR_VERSION 1)
set(PROJECT_PATCH_VERSION 0)
set(PROJECT_BUILD_VERSION ${GIT_REVISION})
set(PROJECT_VERSION_EXTENSION "")
-set(PROJECT_RELEASE_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
+if(ENABLE_APPLICATION_BUNDLE)
+ #
+ # As https://developer.apple.com/library/archive/technotes/tn2206/_index.html
+ # says,
+ #
+ # "Note that a location where code is expected to reside cannot generally
+ # contain directories full of nested code, because those directories tend
+ # to be interpreted as bundles. So this occasional practice is not
+ # recommended and not officially supported. If you do do this, do not use
+ # periods in the directory names. The code signing machinery interprets
+ # directories with periods in their names as code bundles and will reject
+ # them if they don't conform to the expected code bundle layout."
+ #
+ set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}-${PROJECT_MINOR_VERSION}")
+else(ENABLE_APPLICATION_BUNDLE)
+ set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
+endif(ENABLE_APPLICATION_BUNDLE)
if(DEFINED ENV{WIRESHARK_VERSION_EXTRA})
set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}")
@@ -1328,8 +1344,8 @@ if(WIN32)
else()
set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/plugins" CACHE INTERNAL "The plugin dir")
endif()
-set(PLUGIN_INSTALL_VERSION_LIBDIR "${PLUGIN_INSTALL_LIBDIR}/${PROJECT_RELEASE_VERSION}")
-set(PLUGIN_VERSION_DIR "plugins/${PROJECT_RELEASE_VERSION}")
+set(PLUGIN_INSTALL_VERSION_LIBDIR "${PLUGIN_INSTALL_LIBDIR}/${PLUGIN_PATH_ID}")
+set(PLUGIN_VERSION_DIR "plugins/${PLUGIN_PATH_ID}")
add_subdirectory( capchild )
add_subdirectory( caputils )
@@ -1419,25 +1435,11 @@ else()
endif()
if(ENABLE_APPLICATION_BUNDLE)
- #
- # 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:
- #
- # remove the version component from _plugin_dir;
- #
- # remove the version component from the pkgplugin directory in
- # packaging/macosx/osx-app.sh.in;
- #
- # have get_plugins_dir_with_version() in wsutil/filesystem.c
- # *not* add the version component to plugin_dir_with_version
- # on macOS.
- #
if(CMAKE_CFG_INTDIR STREQUAL ".")
- set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_RELEASE_VERSION}")
+ set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}")
else()
# Xcode
- set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_RELEASE_VERSION}")
+ set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}")
endif()
elseif(WIN32 AND NOT CMAKE_CFG_INTDIR STREQUAL ".")
set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/${PLUGIN_VERSION_DIR}")
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index d1fe805880..945550114e 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -16,7 +16,7 @@
#define VERSION_MINOR ${PROJECT_MINOR_VERSION}
#define VERSION_MICRO ${PROJECT_PATCH_VERSION}
-#define VERSION_RELEASE "${PROJECT_RELEASE_VERSION}"
+#define PLUGIN_PATH_ID "${PLUGIN_PATH_ID}"
#define VERSION_FLAVOR "${VERSION_FLAVOR}"
/* Build wsutil with SIMD optimization */
diff --git a/packaging/macosx/osx-app.sh.in b/packaging/macosx/osx-app.sh.in
index d4d5024ad1..72107556f7 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/@VERSION_MAJOR@.@VERSION_MINOR@"
+pkgplugin="$bundle/Contents/PlugIns/wireshark/@PLUGIN_PATH_ID@"
# Set the 'macosx' directory, usually the current directory.
#resdir=$( pwd )
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c
index ffb7fed70b..a107d5ca26 100644
--- a/wsutil/filesystem.c
+++ b/wsutil/filesystem.c
@@ -1002,7 +1002,7 @@ get_plugins_dir_with_version(void)
if (!plugin_dir)
init_plugin_dir();
if (plugin_dir && !plugin_dir_with_version)
- plugin_dir_with_version = g_build_filename(plugin_dir, VERSION_RELEASE, (gchar *)NULL);
+ plugin_dir_with_version = g_build_filename(plugin_dir, PLUGIN_PATH_ID, (gchar *)NULL);
return plugin_dir_with_version;
}
@@ -1021,7 +1021,7 @@ get_plugins_pers_dir_with_version(void)
if (!plugin_pers_dir)
init_plugin_pers_dir();
if (plugin_pers_dir && !plugin_pers_dir_with_version)
- plugin_pers_dir_with_version = g_build_filename(plugin_pers_dir, VERSION_RELEASE, (gchar *)NULL);
+ plugin_pers_dir_with_version = g_build_filename(plugin_pers_dir, PLUGIN_PATH_ID, (gchar *)NULL);
return plugin_pers_dir_with_version;
}