diff --git a/Makefile b/Makefile index 24e773230..77cc0c230 100644 --- a/Makefile +++ b/Makefile @@ -162,7 +162,7 @@ LIBMINGW:=$($(OS)_LIBMINGW) windows_EXE_EXT:=.exe EXE_EXT:=$($(OS)_EXE_EXT) -macos_BUNDLE:=./TuxPaint.app +macos_BUNDLE:=./TuxPaint-$(ARCHS).app ios_BUNDLE:=./TuxPaint-$(SDK).app BUNDLE:=$($(OS)_BUNDLE) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 62a0a5e65..e903e448a 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -12,6 +12,11 @@ https://tuxpaint.org/ * Make screen refresh more snappy on macOS. Mark Kim + * Simplify the process of building the universal bundle on the macOS by + automatically adding the machine suffix (-arm64 or -x86_64) when building + the macOS bundle. Previously this renaming step was required to be done + manually to build the universal bundle. + 2024.January.29 (0.9.32) * Improvements to Magic tools: ---------------------------- diff --git a/macos/build-app.sh b/macos/build-app.sh index 081582e76..e8784d101 100755 --- a/macos/build-app.sh +++ b/macos/build-app.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -BUNDLE=TuxPaint.app +BUNDLE=TuxPaint-$(uname -m).app BINARY="$BUNDLE/Contents/MacOS/tuxpaint" LIBS=`find $BUNDLE/Contents/Resources/lib -type f` LIBDIR="$BUNDLE/Contents/lib" diff --git a/macos/build-dmg.sh b/macos/build-dmg.sh index 9f87e4445..b6d3f83de 100755 --- a/macos/build-dmg.sh +++ b/macos/build-dmg.sh @@ -9,6 +9,20 @@ # BUNDLE=TuxPaint.app + +if [[ ! -d "$BUNDLE" ]]; then + ARCHBUNDLE=TuxPaint-$(uname -m).app + + if [[ -d "$ARCHBUNDLE" ]]; then + echo " $BUNDLE missing. Did you forget to either run 'macos/build-universal.sh' first," + echo " or rename $ARCHBUNDLE to $BUNDLE first?" + else + echo " Did you forget to 'make' $ARCHBUNDLE first?" + fi 1>&2 + + exit 1 +fi + TEMP_DMG=temp.dmg TEMP_DMG_SIZE=`expr \`du -sm "$BUNDLE" | cut -f1\` \* 15 / 10`m FINAL_DMG=TuxPaint.dmg @@ -16,7 +30,6 @@ VOLNAME="Tux Paint" ICON="macos/tuxpaint.icns" BACKGROUND="macos/background.png" - echo " * Creating the temporary image..." hdiutil create "$TEMP_DMG" -ov -fs HFS+ -size "$TEMP_DMG_SIZE" -volname "$VOLNAME" \ && VOLUME=`hdiutil attach "$TEMP_DMG" -nobrowse -noverify -noautoopen | grep Apple_HFS | sed 's/^.*Apple_HFS[[:blank:]]*//'` \ diff --git a/macos/build-universal.sh b/macos/build-universal.sh index 8b16ce6dd..999194056 100755 --- a/macos/build-universal.sh +++ b/macos/build-universal.sh @@ -102,7 +102,7 @@ function build-universal() { && find "$OUTBUNDLE" -name '*.dylib' -print0 | xargs -0 rm -f \ || return 1 - # Create the universal binary for each binary and library + # Create the universal version of each binary and library for (( i=0; i < ${#BUNDLES[@]}; i++ )); do local filelist=() local file diff --git a/macos/list-fonts b/macos/list-fonts index 604a5f73b..6fce00ba2 100755 --- a/macos/list-fonts +++ b/macos/list-fonts @@ -1,7 +1,9 @@ #!/bin/bash -if [[ -d TuxPaint.app ]]; then - cd TuxPaint.app/Contents && FONTCONFIG_PATH=Resources/etc fc-list +BUNDLE=TuxPaint-$(uname -m).app + +if [[ -d "${BUNDLE}" ]]; then + cd "${BUNDLE}/Contents" && FONTCONFIG_PATH=Resources/etc fc-list else - echo "./TuxPaint.app: No such folder" 1>&2 + echo "./${BUNDLE}: No such folder" 1>&2 fi