From c6b268fe107556b4f7c80632dc0c7316b578ab1b Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 29 May 2025 11:25:26 +0800 Subject: [PATCH 1/3] fix(cmake): Format MacOSXBundleInfo.plist template Signed-off-by: Claudio Cambra --- cmake/modules/MacOSXBundleInfo.plist.in | 168 ++++++++++++------------ 1 file changed, 82 insertions(+), 86 deletions(-) diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in index 7e996b4b7c..48dd02af7c 100644 --- a/cmake/modules/MacOSXBundleInfo.plist.in +++ b/cmake/modules/MacOSXBundleInfo.plist.in @@ -2,93 +2,89 @@ - NSPrincipalClass - NSApplication - LSMinimumSystemVersion - 12.0 - LSUIElement - - CFBundleDevelopmentRegion - en - CFBundleAllowMixedLocalizations - - CFBundleExecutable - @APPLICATION_NAME@ - CFBundleIconFile - @APPLICATION_ICON_NAME@.icns - CFBundleIdentifier - @APPLICATION_REV_DOMAIN@ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - @APPLICATION_NAME_XML_ESCAPED@ @MIRALL_VERSION_STRING@ - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - @MIRALL_VERSION_FULL@ - CFBundleShortVersionString - @MIRALL_VERSION_STRING@ - NSHumanReadableCopyright - (C) 2014-2025 @APPLICATION_VENDOR_XML_ESCAPED@ - NSSupportsAutomaticGraphicsSwitching - - NSRequiresAquaSystemAppearance - - SUShowReleaseNotes - - SUPublicDSAKeyFile - dsa_pub.pem - SUPublicEDKey - c3RcfDWDayvsYSZW8FhZN1UOJhvPVN30zleb4zOqbtU= - -UTExportedTypeDeclarations - - - UTTypeIdentifier - @APPLICATION_REV_DOMAIN@.VIRTUALFILE - UTTypeTagSpecification + NSPrincipalClass + NSApplication + LSMinimumSystemVersion + 12.0 + LSUIElement + + CFBundleDevelopmentRegion + en + CFBundleAllowMixedLocalizations + + CFBundleExecutable + @APPLICATION_NAME@ + CFBundleIconFile + @APPLICATION_ICON_NAME@.icns + CFBundleIdentifier + @APPLICATION_REV_DOMAIN@ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + @APPLICATION_NAME_XML_ESCAPED@ @MIRALL_VERSION_STRING@ + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + @MIRALL_VERSION_FULL@ + CFBundleShortVersionString + @MIRALL_VERSION_STRING@ + NSHumanReadableCopyright + (C) 2014-2025 @APPLICATION_VENDOR_XML_ESCAPED@ + NSSupportsAutomaticGraphicsSwitching + + NSRequiresAquaSystemAppearance + + SUShowReleaseNotes + + SUPublicDSAKeyFile + dsa_pub.pem + SUPublicEDKey + c3RcfDWDayvsYSZW8FhZN1UOJhvPVN30zleb4zOqbtU= + UTExportedTypeDeclarations + - public.filename-extension - @APPLICATION_VIRTUALFILE_SUFFIX@ - public.mime-type - application/octet-stream - - UTTypeConformsTo - - public.data - - - - -CFBundleDocumentTypes - - - CFBundleTypeName - @APPLICATION_EXECUTABLE@ Download Virtual File - CFBundleTypeRole - Editor - LSHandlerRank - Owner - LSItemContentTypes - + UTTypeIdentifier @APPLICATION_REV_DOMAIN@.VIRTUALFILE - - - - -CFBundleURLTypes - - - CFBundleURLName - @APPLICATION_NAME@ Edit Locally - CFBundleURLSchemes - - @APPLICATION_URI_HANDLER_SCHEME@ - - - - + UTTypeTagSpecification + + public.filename-extension + @APPLICATION_VIRTUALFILE_SUFFIX@ + public.mime-type + application/octet-stream + + UTTypeConformsTo + + public.data + + + + CFBundleDocumentTypes + + + CFBundleTypeName + @APPLICATION_EXECUTABLE@ Download Virtual File + CFBundleTypeRole + Editor + LSHandlerRank + Owner + LSItemContentTypes + + @APPLICATION_REV_DOMAIN@.VIRTUALFILE + + + + CFBundleURLTypes + + + CFBundleURLName + @APPLICATION_NAME@ Edit Locally + CFBundleURLSchemes + + @APPLICATION_URI_HANDLER_SCHEME@ + + + From a2b12cff720c99505c625f0290005e947615c981 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 29 May 2025 11:46:55 +0800 Subject: [PATCH 2/3] fix(cmake): Build CFBundleLocalizations Signed-off-by: Claudio Cambra --- admin/osx/CMakeLists.txt | 11 +++++++++++ cmake/modules/MacOSXBundleInfo.plist.in | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/admin/osx/CMakeLists.txt b/admin/osx/CMakeLists.txt index 67ca71033a..9a2abe612d 100644 --- a/admin/osx/CMakeLists.txt +++ b/admin/osx/CMakeLists.txt @@ -18,3 +18,14 @@ configure_file(macosx.entitlements.cmake ${CMAKE_CURRENT_BINARY_DIR}/macosx.enti configure_file(macosx.pkgproj.cmake ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj) configure_file(pre_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh) configure_file(post_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/post_install.sh) + +# Generate CFBundleLocalizations for MacOSXBundleInfo.plist.in +file(GLOB_RECURSE TS_FILES RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/translations/client_*.ts") +set(LOCALIZATIONS_LIST "") +foreach(TS_FILE ${TS_FILES}) + get_filename_component(LANG_CODE ${TS_FILE} NAME_WE) # client_en_GB + string(REPLACE "client_" "" LANG_CODE ${LANG_CODE}) # en_GB + string(REPLACE "_" "-" LANG_CODE ${LANG_CODE}) # en-GB + set(LOCALIZATIONS_LIST "${LOCALIZATIONS_LIST} ${LANG_CODE}\n") +endforeach() +set(MACOSX_BUNDLE_LOCALIZATIONS "${LOCALIZATIONS_LIST}" CACHE INTERNAL "Generated list of localizations for macOS bundle" FORCE) diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in index 48dd02af7c..eb9f3de70e 100644 --- a/cmake/modules/MacOSXBundleInfo.plist.in +++ b/cmake/modules/MacOSXBundleInfo.plist.in @@ -12,6 +12,10 @@ en CFBundleAllowMixedLocalizations + CFBundleLocalizations + +@MACOSX_BUNDLE_LOCALIZATIONS@ + CFBundleExecutable @APPLICATION_NAME@ CFBundleIconFile From bc102fc06b0ffebdea73f97c2015878ebc9d34f5 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 29 May 2025 11:47:18 +0800 Subject: [PATCH 3/3] fix(cmake): Strip final newline from bundled localisations Signed-off-by: Claudio Cambra --- admin/osx/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/osx/CMakeLists.txt b/admin/osx/CMakeLists.txt index 9a2abe612d..e55e312ea7 100644 --- a/admin/osx/CMakeLists.txt +++ b/admin/osx/CMakeLists.txt @@ -28,4 +28,7 @@ foreach(TS_FILE ${TS_FILES}) string(REPLACE "_" "-" LANG_CODE ${LANG_CODE}) # en-GB set(LOCALIZATIONS_LIST "${LOCALIZATIONS_LIST} ${LANG_CODE}\n") endforeach() +if(LOCALIZATIONS_LIST) + string(STRIP "${LOCALIZATIONS_LIST}" LOCALIZATIONS_LIST) +endif() set(MACOSX_BUNDLE_LOCALIZATIONS "${LOCALIZATIONS_LIST}" CACHE INTERNAL "Generated list of localizations for macOS bundle" FORCE)