diff options
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rwxr-xr-x | packaging/macosx/osx-app.sh | 1 | ||||
-rw-r--r-- | wsutil/filesystem.c | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6787799966..2cac4cb722 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1798,6 +1798,18 @@ macro(set_extcap_executable_properties _executable) LINK_FLAGS "${WS_LINK_FLAGS}" RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/extcap ) + if(ENABLE_APPLICATION_BUNDLE) + set_target_properties(${_executable} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY run/Wireshark.app/Contents/MacOS/extcap + ) + # Add a wrapper script which runs each executable from the + # correct location. This adds convenience but makes debugging + # more difficult. + file(REMOVE ${CMAKE_BINARY_DIR}/run/${_executable}) + file(WRITE ${CMAKE_BINARY_DIR}/run/${_executable} "#!/bin/sh\n") + file(APPEND ${CMAKE_BINARY_DIR}/run/${_executable} "exec ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/extcap/${_executable} \"\$\@\"\n") + execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/${_executable}) + endif() endif() endmacro() diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index 325de56862..d30b722226 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -583,6 +583,7 @@ rpathify_files () { rpathify_dir "$pkglib/pango/$pango_version/modules" "*.so" fi rpathify_dir "$pkgbin" "*" + rpathify_dir "$pkgbin/extcap" "*" } if [ "$ui_toolkit" = "qt" ] ; then diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 0b23aec1ee..3cfc1b87ee 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1119,7 +1119,7 @@ static void init_extcap_dir(void) { #ifdef __APPLE__ /* * If we're running from an app bundle and weren't started - * with special privileges, use the Contents/Resources/lib/wireshark/extcap + * with special privileges, use the Contents/MacOS/extcap * subdirectory of the app bundle. * * (appbundle_dir is not set to a non-null value if we're @@ -1127,7 +1127,7 @@ static void init_extcap_dir(void) { * it; we don't need to call started_with_special_privs().) */ else if (appbundle_dir != NULL) { - extcap_dir = g_strdup_printf("%s/Contents/Resources/lib/wireshark/extcap", + extcap_dir = g_strdup_printf("%s/Contents/MacOS/extcap", appbundle_dir); } #endif |