1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-02 14:50:17 +01:00

Add targets for packaging DMG and InnoSetup

Fixes configure.sh

Fixes Windows code signing

Fixes an issue with conan cache on windows

Fixes build manual script

Fixes build manual

Remove unused props

Use long options

Yet another manual fix

Fixes iss
This commit is contained in:
Dmitry Vedenko
2021-06-15 16:13:28 +03:00
committed by Dmitry Vedenko
parent d21ee922e1
commit 6da25e1646
17 changed files with 664 additions and 64 deletions

View File

@@ -0,0 +1,22 @@
on run argv
set diskImage to item 1 of argv
tell application "Finder"
tell disk diskImage
open
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {400, 100, 1000, 550}
set theViewOptions to the icon view options of container window
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 72
set background picture of theViewOptions to file ".background:background.png"
set position of item "Audacity" of container window to {170, 350}
set position of item "Applications" of container window to {430, 350}
close
open
update without registering applications
end tell
end tell
end run

View File

@@ -0,0 +1,16 @@
set( APPLE_CODESIGN_IDENTITY ${CPACK_APPLE_CODESIGN_IDENTITY} )
set( APPLE_NOTARIZATION_USER_NAME ${CPACK_APPLE_NOTARIZATION_USER_NAME} )
set( APPLE_NOTARIZATION_PASSWORD ${CPACK_APPLE_NOTARIZATION_PASSWORD} )
set( PERFORM_NOTARIZATION ${CPACK_PERFORM_NOTARIZATION} )
set( APP_IDENTIFIER "org.audacityteam.audacity" )
foreach( file ${CPACK_PACKAGE_FILES} )
set( DMG_LOCATION ${CPACK_PACKAGE_FILES} )
include( "${CPACK_APPLE_SIGN_SCRIPTS}/SignMacos.cmake" )
if( PERFORM_NOTARIZATION )
include( "${CPACK_APPLE_SIGN_SCRIPTS}/NotarizeMacos.cmake" )
endif()
endforeach()

View File

@@ -0,0 +1,111 @@
# CMake script to sign macOS build
# Arguments:
# APP_IDENTIFIER - app identifier
# APP_LOCATION - the path to Audacity.app
# DMG_LOCATION - the path to Audaicty dmg package
# APPLE_NOTARIZATION_USER_NAME - notarization user name
# APPLE_NOTARIZATION_PASSWORD - notarization password
# https://cmake.org/cmake/help/latest/policy/CMP0054.html
cmake_policy( SET CMP0054 NEW )
# https://cmake.org/cmake/help/latest/policy/CMP0011.html
cmake_policy( SET CMP0011 NEW )
function( get_plist_value output path key )
execute_process(
COMMAND /usr/libexec/PlistBuddy -c "Print ${key}" "${path}"
OUTPUT_VARIABLE result
)
string( STRIP ${result} result )
set( ${output} ${result} PARENT_SCOPE )
endfunction()
if( APP_LOCATION )
get_filename_component( temp_dir "${APP_LOCATION}/.." ABSOLUTE )
else()
get_filename_component( temp_dir "${DMG_LOCATION}" DIRECTORY )
endif()
set( temp_plist "${temp_dir}/NotarizationResult.plist" )
function( notarize path )
message( STATUS "Notarizing ${path}" )
execute_process(
COMMAND
xcrun altool
--notarize-app
--primary-bundle-id "${APP_IDENTIFIER}"
--file "${path}"
--username "${APPLE_NOTARIZATION_USER_NAME}"
--password "${APPLE_NOTARIZATION_PASSWORD}"
--output-format xml
OUTPUT_VARIABLE
result
)
file( WRITE ${temp_plist} ${result} )
get_plist_value( req_id ${temp_plist} "notarization-upload:RequestUUID" )
message( STATUS "\t Request ID: '${req_id}'" )
set( success Off )
while( NOT success )
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 15)
execute_process(
COMMAND
xcrun altool
--notarization-info ${req_id}
--username ${APPLE_NOTARIZATION_USER_NAME}
--password ${APPLE_NOTARIZATION_PASSWORD}
--output-format xml
OUTPUT_VARIABLE
result
)
file( WRITE ${temp_plist} ${result} )
get_plist_value( notarization_result ${temp_plist} "notarization-info:Status" )
message( STATUS "\t Status: ${notarization_result}" )
if( NOT "${notarization_result}" STREQUAL "in progress" )
if ( NOT "${notarization_result}" STREQUAL "success" )
message(FATAL_ERROR "Notarization failed:\n${result}\n")
else()
message(STATUS "Notarization successfull")
endif()
break()
endif()
endwhile()
endfunction()
if( DEFINED APP_LOCATION )
get_filename_component( archive "${APP_LOCATION}/../notarization.zip" ABSOLUTE )
execute_process(
COMMAND
xcrun ditto
-c -k --keepParent
${APP_LOCATION}
${archive}
)
notarize( ${archive} )
execute_process( COMMAND stapler staple "${APP_LOCATION}" )
file( REMOVE "${APP_LOCATION}/../notarization.zip" )
endif()
if( DEFINED DMG_LOCATION )
notarize( ${DMG_LOCATION} )
execute_process( COMMAND stapler staple "${DMG_LOCATION}" )
endif()
file( REMOVE ${temp_plist} )

View File

@@ -0,0 +1,54 @@
# CMake script to sign macOS build
# Arguments:
# APP_IDENTIFIER - app identifier
# APP_LOCATION - the path to Audacity.app
# DMG_LOCATION - the path to Audaicty dmg package
# APPLE_CODESIGN_IDENTITY - identity to use
# APPLE_CODESIGN_ENTITLEMENTS - path to the entitlements
function( codesign path deep is_dmg)
message(STATUS "Signing ${path}")
set ( args
--verbose
--timestamp
--identifier "${APP_IDENTIFIER}"
--sign "${APPLE_CODESIGN_IDENTITY}"
)
if( NOT is_dmg )
list( APPEND args
--options runtime
--entitlements "${APPLE_CODESIGN_ENTITLEMENTS}"
)
endif()
if( deep )
list( APPEND args --deep)
endif()
execute_process( COMMAND xcrun codesign ${args} ${path} )
endfunction()
function( sign_modules path )
message(STATUS "\tLooking for modules or plugins in: '${path}'")
file( GLOB_RECURSE modules
LIST_DIRECTORIES Off
"${path}/*.so" "${path}/*.dylib"
)
foreach( module ${modules} )
codesign( ${module} Off Off )
endforeach()
endfunction()
if( DEFINED APP_LOCATION )
sign_modules( "${APP_LOCATION}/Contents/modules" )
sign_modules( "${APP_LOCATION}/Contents/plug-ins" )
codesign( "${APP_LOCATION}" On Off )
endif()
if (DEFINED DMG_LOCATION )
codesign( "${DMG_LOCATION}" Off On)
endif()