mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fat binary, notarization & dmg
This commit is contained in:
parent
90e1264895
commit
5afb78c9f0
3 changed files with 41 additions and 8 deletions
|
@ -5,9 +5,11 @@ set -e
|
|||
# Define output path
|
||||
OUTPUT_DIR="../../../out/launcher"
|
||||
APP_LAUNCHER="$OUTPUT_DIR/Anki.app"
|
||||
rm -rf "$APP_LAUNCHER"
|
||||
|
||||
# Build rust binary in debug mode
|
||||
cargo build -p launcher
|
||||
# Build binaries for both architectures
|
||||
cargo build -p launcher --release --target aarch64-apple-darwin
|
||||
cargo build -p launcher --release --target x86_64-apple-darwin
|
||||
(cd ../../.. && ./ninja launcher:uv_universal)
|
||||
|
||||
# Ensure output directory exists
|
||||
|
@ -19,9 +21,12 @@ rm -rf "$APP_LAUNCHER"
|
|||
# Create app launcher structure
|
||||
mkdir -p "$APP_LAUNCHER/Contents/MacOS" "$APP_LAUNCHER/Contents/Resources"
|
||||
|
||||
# Copy binaries
|
||||
# Copy binaries in
|
||||
TARGET_DIR=${CARGO_TARGET_DIR:-target}
|
||||
cp $TARGET_DIR/debug/launcher "$APP_LAUNCHER/Contents/MacOS/"
|
||||
lipo -create \
|
||||
"$TARGET_DIR/aarch64-apple-darwin/release/launcher" \
|
||||
"$TARGET_DIR/x86_64-apple-darwin/release/launcher" \
|
||||
-output "$APP_LAUNCHER/Contents/MacOS/launcher"
|
||||
cp "$OUTPUT_DIR/uv" "$APP_LAUNCHER/Contents/MacOS/"
|
||||
|
||||
# Copy support files
|
||||
|
@ -39,3 +44,9 @@ done
|
|||
# Check
|
||||
codesign -vvv "$APP_LAUNCHER"
|
||||
spctl -a "$APP_LAUNCHER"
|
||||
|
||||
# Notarize
|
||||
./notarize.sh "$OUTPUT_DIR"
|
||||
|
||||
# Bundle
|
||||
./dmg/build.sh "$OUTPUT_DIR"
|
|
@ -4,9 +4,9 @@
|
|||
set -e
|
||||
|
||||
# base folder with Anki.app in it
|
||||
dist=$1
|
||||
dmg_path=$2
|
||||
script_folder=$(dirname $0)
|
||||
output="$1"
|
||||
dist="$1/tmp"
|
||||
dmg_path="$output/Anki.dmg"
|
||||
|
||||
if [ -d "/Volumes/Anki" ]
|
||||
then
|
||||
|
@ -14,9 +14,14 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf $dist $dmg_path
|
||||
mkdir -p $dist
|
||||
rsync -av $output/Anki.app $dist/
|
||||
script_folder=$(dirname $0)
|
||||
|
||||
echo "bundling..."
|
||||
ln -s /Applications $dist/Applications
|
||||
mkdir $dist/.background
|
||||
mkdir -p $dist/.background
|
||||
cp ${script_folder}/anki-logo-bg.png $dist/.background
|
||||
cp ${script_folder}/dmg_ds_store $dist/.DS_Store
|
||||
|
||||
|
|
17
qt/launcher/mac/notarize.sh
Executable file
17
qt/launcher/mac/notarize.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Define output path
|
||||
OUTPUT_DIR="$1"
|
||||
APP_LAUNCHER="$OUTPUT_DIR/Anki.app"
|
||||
ZIP_FILE="$OUTPUT_DIR/Anki.zip"
|
||||
|
||||
# Create zip for notarization
|
||||
(cd "$OUTPUT_DIR" && rm -rf Anki.zip && zip -r Anki.zip Anki.app)
|
||||
|
||||
# Upload for notarization
|
||||
xcrun notarytool submit "$ZIP_FILE" -p default --wait
|
||||
|
||||
# Staple the app
|
||||
xcrun stapler staple "$APP_LAUNCHER"
|
Loading…
Reference in a new issue