Skip to content

Commit

Permalink
Unified macOS bundle: use binary plist from x64 build (macos 10.9+).
Browse files Browse the repository at this point in the history
Ignore the newer (binary) NIBArchive introduced with macOS 10.13.
  • Loading branch information
marceltaeumel committed Jan 17, 2024
1 parent a4ae921 commit 6f34061
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions helpers_bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,16 @@ copy_resources() {
}

# Make a fat binary from a pair of VMs in
# build.macos64{x64,ARMv8}/virtend.cog.spur/Virtend*.app
# To choose the oldest nib the oldest deployment target (x86_64) should be last
# building/macos64{x64,ARMv8}/squeak.cog.spur/Squeak*.app
# To choose the oldest *.nib, meaning the oldest deployment
# target (x86_64) should be the second argument
create_unified_vm_macOS() {
local MISMATCHINGNIBS=
local MISMATCHINGPLISTS=

readonly O="$1"
readonly A="$2"
readonly B="$3"
readonly A="$2" # ARMv8
readonly B="$3" # x64

if [ ! -d "$A" ]; then
echo "$A does not exist; aborting"
Expand All @@ -215,22 +216,33 @@ create_unified_vm_macOS() {
# echo ln -s `readlink "$A/$f"` "$O/$f"
elif [ ! -f "$A/$f" ]; then
echo "$A/$f does not exist; how come?"
elif [ ! -f "$B/$f" ]; then
elif [[ ! "$f" =~ ^.*MainMenu\.nib$ ]] && [ ! -f "$B/$f" ]; then
echo "$B/$f does not exist; how come?"
else
case `file -b "$A/$f"` in
Mach-O*)
lipo -create -output "$O/$f" "$A/$f" "$B/$f";;
*)
if cmp -s "$A/$f" "$B/$f"; then
if [ -f "$B/$f" ] && (cmp -s "$A/$f" "$B/$f"); then
cp "$A/$f" "$O/$f"
else
echo "EXCLUDING $f because it differs"
case "$f" in
*.plist)
echo "EXCLUDING $f because it differs"
MISMATCHINGPLISTS="$MISMATCHINGPLISTS $f"
;;
*MainMenu.nib)
# Use old binary plist from x64 bundle.
# Ignore NIBArchive keyedobjects-101300.nib.
# Ignore NIBArchive MainMenu.nib from ARM bundle.
if [ -d "$B/$f" ]; then
cp "$B/$f/keyedobjects.nib" "$O/$f"
else
echo "$B/$f should be a directory; how come?"
fi
;;
*.nib)
echo "REPLACING $f because it differs"
MISMATCHINGNIBS="$MISMATCHINGNIBS $f"
echo "using $B version"
cp "$B/$f" "$O/$f"
Expand Down

0 comments on commit 6f34061

Please sign in to comment.