From 04fdee29df6bf6aa4b1232926ddd8db4ef78db4c Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 29 Aug 2022 22:58:59 +0200 Subject: [PATCH] Build: Mac: Fix universal build to contain both archs One of the last-minute changes broke the universal build and resulted in a universal build which only contained a single architecture. The reason was that the added `distclean` action removed the artifact for the first architecture. This change moves the intermediate artifacts to a temporary, already defined directory which is definitely not touched by `make distclean`. Related: https://github.com/jamulussoftware/jamulus/pull/2808#discussion_r956749658 Related: https://github.com/jamulussoftware/jamulus/pull/2808#issuecomment-1230842458 --- mac/deploy_mac.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mac/deploy_mac.sh b/mac/deploy_mac.sh index a513676f14..9227e5c29f 100755 --- a/mac/deploy_mac.sh +++ b/mac/deploy_mac.sh @@ -57,14 +57,14 @@ build_app() { make -f "${build_path}/Makefile" -C "${build_path}" -j "${job_count}" target_name=$(sed -nE 's/^QMAKE_TARGET *= *(.*)$/\1/p' "${build_path}/Makefile") if [[ ${#target_archs_array[@]} -gt 1 ]]; then - # When building for multiple architectures, move the binary to a safe place to avoid overwriting by the other passes. - mv "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_${target_arch}" + # When building for multiple architectures, move the binary to a safe place to avoid overwriting/cleaning by the other passes. + mv "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${deploy_path}/${target_name}.arch_${target_arch}" fi done if [[ ${#target_archs_array[@]} -gt 1 ]]; then - echo "Building universal binary from: " "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_"* - lipo -create -output "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_"* - rm -f "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_"* + echo "Building universal binary from: " "${deploy_path}/${target_name}.arch_"* + lipo -create -output "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${deploy_path}/${target_name}.arch_"* + rm -f "${deploy_path}/${target_name}.arch_"* file "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" fi