From 05353d9cf08ca4e8210436d686d76417ff12d53c Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 8 Aug 2025 12:37:06 +0100 Subject: [PATCH 1/2] macdeploy: combine appname & -zip arguments appname is only used by -zip. --- cmake/module/Maintenance.cmake | 4 ++-- contrib/macdeploy/macdeployqtplus | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/module/Maintenance.cmake b/cmake/module/Maintenance.cmake index 5f4b1d8aa8e..57c3a794324 100644 --- a/cmake/module/Maintenance.cmake +++ b/cmake/module/Maintenance.cmake @@ -100,7 +100,7 @@ function(add_macos_deploy_target) if(CMAKE_HOST_APPLE) add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/${osx_volname}.zip - COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} -zip + COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} -zip=${osx_volname} DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt VERBATIM ) @@ -113,7 +113,7 @@ function(add_macos_deploy_target) else() add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt - COMMAND ${CMAKE_COMMAND} -E env OBJDUMP=${CMAKE_OBJDUMP} $ ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} + COMMAND ${CMAKE_COMMAND} -E env OBJDUMP=${CMAKE_OBJDUMP} $ ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt VERBATIM ) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index ba532d77740..571485e582c 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -390,12 +390,11 @@ Note, that the "dist" folder will be deleted before deploying on each run. Optionally, Qt translation files (.qm) can be added to the bundle.""") ap.add_argument("app_bundle", nargs=1, metavar="app-bundle", help="application bundle to be deployed") -ap.add_argument("appname", nargs=1, metavar="appname", help="name of the app being deployed") ap.add_argument("-verbose", nargs="?", const=True, help="Output additional debugging information") ap.add_argument("-no-plugins", dest="plugins", action="store_false", default=True, help="skip plugin deployment") ap.add_argument("-no-strip", dest="strip", action="store_false", default=True, help="don't run 'strip' on the binaries") ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translations. Base translations will automatically be added to the bundle's resources.") -ap.add_argument("-zip", nargs="?", const="", metavar="zip", help="create a .zip containing the app bundle") +ap.add_argument("-zip", nargs=1, metavar="zip", help="create a .zip containing the app bundle") config = ap.parse_args() @@ -404,7 +403,6 @@ verbose = config.verbose # ------------------------------------------------ app_bundle = config.app_bundle[0] -appname = config.appname[0] if not os.path.exists(app_bundle): sys.stderr.write(f"Error: Could not find app bundle \"{app_bundle}\"\n") @@ -416,10 +414,6 @@ if os.path.exists("dist"): print("+ Removing existing dist folder +") shutil.rmtree("dist") -if os.path.exists(appname + ".zip"): - print("+ Removing existing .zip +") - os.unlink(appname + ".zip") - # ------------------------------------------------ target = os.path.join("dist", "Bitcoin-Qt.app") @@ -499,7 +493,13 @@ if platform.system() == "Darwin": # ------------------------------------------------ if config.zip is not None: - shutil.make_archive('{}'.format(appname), format='zip', root_dir='dist', base_dir='Bitcoin-Qt.app') + name = config.zip[0] + + if os.path.exists(name + ".zip"): + print("+ Removing existing .zip +") + os.unlink(name + ".zip") + + shutil.make_archive('{}'.format(name), format='zip', root_dir='dist', base_dir='Bitcoin-Qt.app') # ------------------------------------------------ From 8e434a84999c473a7295772a346cbce27888d28e Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 8 Aug 2025 12:10:15 +0100 Subject: [PATCH 2/2] macdeploy: rename macOS output to bitcoin-macos-app.zip We were naming this "Bitcoin-Core.zip", just to immediately rename it. Similar to what we do with Windows, i.e `bitcoin-win64-setup.exe`. --- cmake/module/Maintenance.cmake | 16 ++++++++-------- contrib/guix/libexec/build.sh | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/module/Maintenance.cmake b/cmake/module/Maintenance.cmake index 57c3a794324..7f29bc94a71 100644 --- a/cmake/module/Maintenance.cmake +++ b/cmake/module/Maintenance.cmake @@ -96,19 +96,19 @@ function(add_macos_deploy_target) VERBATIM ) - string(REPLACE " " "-" osx_volname ${CLIENT_NAME}) + set(macos_zip "bitcoin-macos-app") if(CMAKE_HOST_APPLE) add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/${osx_volname}.zip - COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} -zip=${osx_volname} + OUTPUT ${PROJECT_BINARY_DIR}/${macos_zip}.zip + COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} -zip=${macos_zip} DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt VERBATIM ) add_custom_target(deploydir - DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip + DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip ) add_custom_target(deploy - DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip + DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip ) else() add_custom_command( @@ -128,13 +128,13 @@ function(add_macos_deploy_target) ) else() add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip + OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip WORKING_DIRECTORY dist - COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${osx_volname}.zip + COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${macos_zip}.zip VERBATIM ) add_custom_target(deploy - DEPENDS ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip + DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip ) endif() endif() diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 2b47e1645da..2fa03d0d7c8 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -369,7 +369,7 @@ mkdir -p "$DISTSRC" ;; *darwin*) cmake --build build --target deploy ${V:+--verbose} - mv build/dist/Bitcoin-Core.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" + mv build/dist/bitcoin-macos-app.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" mkdir -p "unsigned-app-${HOST}" cp --target-directory="unsigned-app-${HOST}" \ contrib/macdeploy/detached-sig-create.sh