From 999d8f4d38e2ed464ccf1db963835cb3c3bc4472 Mon Sep 17 00:00:00 2001 From: Aaron Murgatroyd Date: Tue, 15 Apr 2025 18:54:10 +1000 Subject: [PATCH] Use rcodesign for dylib signing where avaiilable and clear out all "._" files in order to support building on external hard drive not formatted with APFS when building on MACOS. --- distribution/macos/create_app_bundle.sh | 16 +++++++++++----- distribution/macos/create_macos_build_ava.sh | 12 ++++++++++++ .../macos/create_macos_build_headless.sh | 12 ++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/distribution/macos/create_app_bundle.sh b/distribution/macos/create_app_bundle.sh index cbe930d2d..0b4ab8e04 100755 --- a/distribution/macos/create_app_bundle.sh +++ b/distribution/macos/create_app_bundle.sh @@ -33,23 +33,29 @@ echo -n "APPL????" > "$APP_BUNDLE_DIRECTORY/Contents/PkgInfo" echo "Running bundle fix up python script" python3 bundle_fix_up.py "$APP_BUNDLE_DIRECTORY" MacOS/Ryujinx -# Resign all dyplib files as ad-hoc after changing them -find "$APP_BUNDLE_DIRECTORY/Contents/Frameworks" -type f -name "*.dylib" -exec codesign --force --sign - {} \; - # Now sign it echo "Starting signing process" if ! [ -x "$(command -v codesign)" ]; then if ! [ -x "$(command -v rcodesign)" ]; then - echo "Cannot find rcodesign on your system, please install rcodesign." + echo "Cannot find rcodesign on your system, please install rcodesign and ensure it is in your search path." exit 1 fi - # cargo install apple-codesign echo "Using rcodesign for ad-hoc signing" + + echo "Resigning all frameworks dylib files as ad-hoc" + find "$APP_BUNDLE_DIRECTORY/Contents/Frameworks" -type f -name "*.dylib" -exec rcodesign sign {} \; + + echo "Signing app bundle as ad-hoc" rcodesign sign --entitlements-xml-path "$ENTITLEMENTS_FILE_PATH" "$APP_BUNDLE_DIRECTORY" else echo "Using codesign for ad-hoc signing" + + echo "Resigning all frameworks dylib files as ad-hoc" + find "$APP_BUNDLE_DIRECTORY/Contents/Frameworks" -type f -name "*.dylib" -exec codesign --force --sign - {} \; + + echo "Signing app bundle as ad-hoc" codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f -s - "$APP_BUNDLE_DIRECTORY" fi diff --git a/distribution/macos/create_macos_build_ava.sh b/distribution/macos/create_macos_build_ava.sh index de6fab358..028486f51 100755 --- a/distribution/macos/create_macos_build_ava.sh +++ b/distribution/macos/create_macos_build_ava.sh @@ -20,6 +20,18 @@ SOURCE_REVISION_ID=$6 CONFIGURATION=$7 CANARY=$8 +if [[ "$(uname)" == "Darwin" ]]; then + echo "Clearing xattr on all dot undercsore files" + find "$BASE_DIR" -type f -name "._*" -exec sh -c ' + for f; do + dir=$(dirname "$f") + base=$(basename "$f") + orig="$dir/${base#._}" + [ -f "$orig" ] && xattr -c "$orig" || true + done + ' sh {} + +fi + if [ "$CANARY" == "1" ]; then RELEASE_TAR_FILE_NAME=ryujinx-canary-$VERSION-macos_universal.app.tar elif [ "$VERSION" == "1.1.0" ]; then diff --git a/distribution/macos/create_macos_build_headless.sh b/distribution/macos/create_macos_build_headless.sh index 5de862a2f..6052b202c 100755 --- a/distribution/macos/create_macos_build_headless.sh +++ b/distribution/macos/create_macos_build_headless.sh @@ -20,6 +20,18 @@ SOURCE_REVISION_ID=$6 CONFIGURATION=$7 CANARY=$8 +if [[ "$(uname)" == "Darwin" ]]; then + echo "Clearing xattr on all dot undercsore files" + find "$BASE_DIR" -type f -name "._*" -exec sh -c ' + for f; do + dir=$(dirname "$f") + base=$(basename "$f") + orig="$dir/${base#._}" + [ -f "$orig" ] && xattr -c "$orig" || true + done + ' sh {} + +fi + if [ "$CANARY" == "1" ]; then RELEASE_TAR_FILE_NAME=nogui-ryujinx-canary-$VERSION-macos_universal.tar elif [ "$VERSION" == "1.1.0" ]; then