-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for unified/fat binary on macOS, which supports both arm…
…64 and x64 architectures -- Thanks to 3DICC and Eliot for providing the baseline for this implementation!
- Loading branch information
1 parent
0724852
commit 8832b27
Showing
4 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
################################################################################ | ||
# PROJECT: Squeak Bundle Generation | ||
# FILE: prepare_bundle_macos_arm.sh | ||
# CONTENT: Generate bundle for macOS (unified, arm64 and x64). | ||
# | ||
# AUTHORS: Fabio Niephaus, Hasso Plattner Institute, Potsdam, Germany | ||
# Marcel Taeumel, Hasso Plattner Institute, Potsdam, Germany | ||
################################################################################ | ||
|
||
begin_group "Creating macOS bundle for ${SMALLTALK_VERSION}..." | ||
BUNDLE_NAME_MAC="${IMAGE_NAME}-${VERSION_VM_MACOS}" | ||
export_variable "BUNDLE_NAME_MAC" "${BUNDLE_NAME_MAC}" | ||
BUNDLE_ID_MAC="org.squeak.$(echo ${SQUEAK_VERSION} | tr '[:upper:]' '[:lower:]')-${IMAGE_BITS}bit" | ||
APP_NAME="${IMAGE_NAME}.app" | ||
APP_PATH="${BUILD_PATH}/${APP_NAME}" | ||
CONTENTS_PATH="${APP_PATH}/Contents" | ||
RESOURCES_PATH="${CONTENTS_PATH}/Resources" | ||
VM_MAC_TARGET="${CONTENTS_PATH}/MacOS" | ||
|
||
echo "...copying macOS VM (unified)..." | ||
if is_dir "${TMP_PATH}/${VM_MAC}/Squeak.app"; then | ||
cp -R "${TMP_PATH}/${VM_MAC}/Squeak.app" "${APP_PATH}" | ||
else | ||
echo "Unable to locate macOS VM." && exit 1 | ||
fi | ||
|
||
copy_resources "${RESOURCES_PATH}" | ||
|
||
echo "...merging template..." | ||
cp "${MAC_TEMPLATE_PATH}/Squeak.app/Contents/Info.plist" "${CONTENTS_PATH}/" | ||
cp "${ICONS_PATH}/${SMALLTALK_NAME}"*.icns "${RESOURCES_PATH}/" | ||
ENGLISH_PATH="${MAC_TEMPLATE_PATH}/Squeak.app/Contents/Resources/English.lproj" | ||
cp "${ENGLISH_PATH}/Credits.rtf" "${RESOURCES_PATH}/English.lproj/" | ||
|
||
echo "...setting permissions..." | ||
chmod +x "${VM_MAC_TARGET}/Squeak" | ||
|
||
echo "...patching Info.plist..." | ||
# Info.plist | ||
sed -i".bak" "s/%SmalltalkName%/${SMALLTALK_NAME}/g" "${CONTENTS_PATH}/Info.plist" | ||
sed -i".bak" "s/%CFBundleGetInfoString%/${BUNDLE_NAME_MAC}/g" "${CONTENTS_PATH}/Info.plist" | ||
sed -i".bak" "s/%CFBundleIdentifier%/${BUNDLE_ID_MAC}/g" "${CONTENTS_PATH}/Info.plist" | ||
sed -i".bak" "s/%CFBundleName%/${SMALLTALK_NAME}/g" "${CONTENTS_PATH}/Info.plist" | ||
sed -i".bak" "s/%CFBundleShortVersionString%/${SQUEAK_VERSION_NUMBER}/g" "${CONTENTS_PATH}/Info.plist" | ||
sed -i".bak" "s/%CFBundleVersion%/${IMAGE_BITS} bit/g" "${CONTENTS_PATH}/Info.plist" | ||
sed -i".bak" "s/%SqueakImageName%/${IMAGE_NAME}.image/g" "${CONTENTS_PATH}/Info.plist" | ||
rm -f "${CONTENTS_PATH}/Info.plist.bak" | ||
|
||
if should_codesign; then | ||
do_codesign "${APP_PATH}" # *.app | ||
fi | ||
|
||
compress_into_product_macOS "${APP_PATH}" "${BUNDLE_NAME_MAC}" | ||
reset_build_dir | ||
|
||
end_group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters