CMake+Packaging: Add a logwolf_dmg target.

This commit is contained in:
Gerald Combs 2022-06-07 18:38:46 -07:00 committed by A Wireshark GitLab Utility
parent 8fa64a4773
commit c253dda269
2 changed files with 44 additions and 24 deletions

View File

@ -1720,7 +1720,6 @@ set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CFG_OUT_FILES
doxygen.cfg
packaging/macosx/LogwolfInfo.plist
packaging/macosx/osx-app.sh
packaging/macosx/osx-dmg.sh
packaging/macosx/wireshark-app.dmgbuild
@ -1731,11 +1730,20 @@ set(CFG_OUT_FILES
resources/libwireshark.rc
resources/libwiretap.rc
resources/libwsutil.rc
resources/logwolf.exe.manifest
resources/wireshark.exe.manifest
resources/wireshark.rc
wireshark.pc
)
if(BUILD_logwolf)
list(APPEND CFG_OUT_FILES
packaging/macosx/LogwolfInfo.plist
packaging/macosx/logwolf-app.dmgbuild
packaging/macosx/logwolf-dsym.dmgbuild
resources/logwolf.exe.manifest
)
endif()
foreach( _cfg_file ${CFG_OUT_FILES} )
configure_file( ${CMAKE_SOURCE_DIR}/${_cfg_file}.in ${CMAKE_BINARY_DIR}/${_cfg_file} @ONLY )
endforeach()
@ -3394,14 +3402,14 @@ if(ENABLE_APPLICATION_BUNDLE AND BUILD_logwolf)
add_custom_target(logwolf_dmg_readmes DEPENDS ${_logwolf_read_me_first} ${_logwolf_dsym_installation} )
add_dependencies(logwolf_dmg_prep logwolf_dmg_readmes)
# ADD_CUSTOM_TARGET( logwolf_dmg
# COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh
# # Unlike wireshark_nsis_prep + wireshark_nsis, we can add a direct
# # dependency here.
# DEPENDS wireshark_dmg_prep
# # We create Wireshark.app in "run". Do our work there.
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run
# )
ADD_CUSTOM_TARGET( logwolf_dmg
COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh --app-name Logwolf
# Unlike wireshark_nsis_prep + wireshark_nsis, we can add a direct
# dependency here.
DEPENDS logwolf_dmg_prep
# We create Wireshark.app in "run". Do our work there.
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run
)
endif()

View File

@ -5,8 +5,10 @@
set -e
# Defaults
app_name="Wireshark"
dmgbuild="@DMGBUILD_EXECUTABLE@"
version="@PROJECT_VERSION@"
log_version="@LOG_PROJECT_VERSION@"
app_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/wireshark-app.dmgbuild"
dsym_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/wireshark-dsym.dmgbuild"
architecture=""
@ -35,20 +37,14 @@ if [ ! -x "$dmgbuild" ] ; then
exit 1
fi
if lipo Wireshark.app/Contents/MacOS/Wireshark -verify_arch arm64 ; then
architecture="Arm 64"
elif lipo Wireshark.app/Contents/MacOS/Wireshark -verify_arch x86_64 ; then
architecture="Intel 64"
else
echo "Error: Wireshark.app missing or has unknown architecture."
lipo Wireshark.app/Contents/MacOS/Wireshark -detailed_info
exit 1
fi
# Parse command line arguments
while [ "$1" != "" ]
do
case $1 in
-a|--app-name)
shift 1
app_name="$1"
;;
-h|--help)
help
exit 0 ;;
@ -59,10 +55,26 @@ do
shift 1
done
app_vol_name="Wireshark ${version}"
if lipo "$app_name.app/Contents/MacOS/$app_name" -verify_arch arm64 ; then
architecture="Arm 64"
elif lipo "$app_name.app/Contents/MacOS/$app_name" -verify_arch x86_64 ; then
architecture="Intel 64"
else
echo "Error: $app_name.app missing or has unknown architecture."
lipo "$app_name.app/Contents/MacOS/$app_name" -detailed_info
exit 1
fi
if [[ $app_name = Log* ]] ; then
version=$log_version
app_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/logwolf-app.dmgbuild"
dsym_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/logwolf-dsym.dmgbuild"
fi
app_vol_name="$app_name ${version}"
app_img_name="$app_vol_name $architecture.dmg"
printf "\nCreating application disk image\n"
printf "\nCreating application disk image %s\n" "$app_img_name"
"$dmgbuild" \
--no-hidpi \
@ -70,10 +82,10 @@ printf "\nCreating application disk image\n"
"$app_vol_name" \
"$app_img_name" || exit 1
dsym_vol_name="Wireshark dSYM ${version}"
dsym_vol_name="$app_name dSYM ${version}"
dsym_img_name="$dsym_vol_name $architecture.dmg"
printf "\nCreating debugging symbols disk image\n"
printf "\nCreating debugging symbols disk image %s\n" "$dsym_img_name"
"$dmgbuild" \
--no-hidpi \