diff --git a/.github/workflows/build-coop.yaml b/.github/workflows/build-coop.yaml index 88d47db15..166809e60 100644 --- a/.github/workflows/build-coop.yaml +++ b/.github/workflows/build-coop.yaml @@ -26,7 +26,7 @@ jobs: cd tools g++ -std=c++17 -o hash_file hash_file.cpp echo "::notice ::$(./hash_file ../build/us_pc/sm64coopdx)" - + - name: Zip the game run: | cd ./build/us_pc @@ -37,7 +37,7 @@ jobs: with: name: sm64coopdx-linux path: ./build/us_pc/sm64coopdx_Linux.zip - + build-steamos: if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[build]') }} runs-on: ubuntu-22.04 @@ -58,7 +58,7 @@ jobs: cd tools g++ -std=c++17 -o hash_file hash_file.cpp echo "::notice ::$(./hash_file ../build/us_pc/sm64coopdx)" - + - name: Zip the game run: | cd ./build/us_pc @@ -108,7 +108,7 @@ jobs: cd tools g++ -std=c++17 -o hash_file.exe hash_file.cpp echo "::notice ::$(./hash_file.exe ../build/us_pc/sm64coopdx.exe)" - + - name: Zip the game run: | cd ./build/us_pc @@ -158,7 +158,7 @@ jobs: cd tools g++ -std=c++17 -o hash_file.exe hash_file.cpp echo "::notice ::$(./hash_file.exe ../build/us_pc/sm64coopdx.exe)" - + - name: Zip the game run: | cd ./build/us_pc @@ -172,17 +172,36 @@ jobs: build-macos-arm: if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[build]') }} - runs-on: macos-latest + runs-on: macos-26 steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install dependencies run: | - brew install make mingw-w64 sdl2 pkg-config glew glfw3 coreutils + brew install make mingw-w64 pkg-config glfw3 coreutils + + - name: Compile glew + run: | + export MACOSX_DEPLOYMENT_TARGET=11 + curl -L -o glew.tar.gz https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz + tar -xzf glew.tar.gz + cd glew-2.2.0 + make SYSTEM=darwin CC="clang -arch arm64 -mmacosx-version-min=11" GLEW_PREFIX=/opt/homebrew GLEW_DEST=/opt/homebrew + make install GLEW_PREFIX=/opt/homebrew GLEW_DEST=/opt/homebrew + + - name: Compile SDL2 + run: | + curl -L -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-2.30.9.tar.gz + tar -xzf SDL2.tar.gz + cd SDL2-2.30.9 + ./configure --prefix=/opt/homebrew CC="clang -arch arm64 -mmacosx-version-min=11" + make -j$(sysctl -n hw.ncpu) + make install - name: Build the game run: | + export PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH gmake OSX_BUILD=1 -j$(sysctl -n hw.ncpu) - name: Code sign the app (Ad-Hoc) @@ -199,7 +218,7 @@ jobs: run: | cd ./build/us_pc zip -r sm64coopdx_macOS_ARM.zip sm64coopdx.app - + - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -215,7 +234,25 @@ jobs: - name: Install dependencies run: | - brew install make mingw-w64 gcc@9 sdl2 pkg-config glew glfw3 coreutils + brew install make mingw-w64 gcc@9 pkg-config glfw3 coreutils + + - name: Compile glew + run: | + export MACOSX_DEPLOYMENT_TARGET=10.15 + curl -L -o glew.tar.gz https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz + tar -xzf glew.tar.gz + cd glew-2.2.0 + make SYSTEM=darwin CC="clang -arch x86_64 -mmacosx-version-min=10.15" + make install + + - name: Compile SDL2 + run: | + curl -L -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-2.30.9.tar.gz + tar -xzf SDL2.tar.gz + cd SDL2-2.30.9 + ./configure --prefix=/usr/local CC="clang -arch x86_64 -mmacosx-version-min=10.15" + make -j$(sysctl -n hw.ncpu) + make install - name: Build the game run: | @@ -235,7 +272,7 @@ jobs: run: | cd ./build/us_pc zip -r sm64coopdx_macOS_Intel.zip sm64coopdx.app - + - name: Upload artifact uses: actions/upload-artifact@v4 with: diff --git a/Makefile b/Makefile index 66b02100f..e1549b294 100644 --- a/Makefile +++ b/Makefile @@ -64,12 +64,7 @@ ICON ?= 1 # Use .app (for macOS) USE_APP ?= 1 # Minimum macOS Version -# If our arch is arm, set to macOS 14 -ifeq ($(shell arch),arm64) - MIN_MACOS_VERSION ?= 14 -else - MIN_MACOS_VERSION ?= 10.15 -endif +MIN_MACOS_VERSION ?= 11 # Make some small adjustments for handheld devices HANDHELD ?= 0 @@ -1575,15 +1570,15 @@ endif # with no prerequisites, .SECONDARY causes no intermediate target to be removed .SECONDARY: +# Handle end of macOS compilation APP_DIR = ./sm64coopdx.app APP_CONTENTS_DIR = $(APP_DIR)/Contents APP_MACOS_DIR = $(APP_CONTENTS_DIR)/MacOS APP_RESOURCES_DIR = $(APP_CONTENTS_DIR)/Resources - ifeq ($(OSX_BUILD),1) - GLEW_LIB := $(shell find $(BREW_PREFIX)/Cellar/glew | grep libGLEW.2.2.0 | sort -n | uniq) - SDL2_LIB := $(shell find $(BREW_PREFIX)/Cellar/sdl2 | grep libSDL2- | sort -n | uniq) + GLEW_LIB := $(shell find $(BREW_PREFIX)/lib/ | grep libGLEW.2.2.0 | sort -n | uniq) + SDL2_LIB := $(shell find $(BREW_PREFIX)/lib/ | grep libSDL2- | sort -n | uniq) endif all: @@ -1605,14 +1600,20 @@ all: cp build/us_pc/libcoopnet.dylib $(APP_MACOS_DIR); \ cp build/us_pc/libjuice.1.6.2.dylib $(APP_MACOS_DIR); \ cp $(SDL2_LIB) $(APP_MACOS_DIR)/libSDL2.dylib; \ - install_name_tool -change $(BREW_PREFIX)/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/sm64coopdx; > /dev/null 2>&1 \ - install_name_tool -id @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/libSDL2.dylib; > /dev/null 2>&1 \ + install_name_tool -change $(BREW_PREFIX)/lib/libSDL2-2.0.0.dylib @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \ + install_name_tool -change $(BREW_PREFIX)/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \ + install_name_tool -id @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/libSDL2.dylib > /dev/null 2>&1; \ codesign --force --deep --sign - $(APP_MACOS_DIR)/libSDL2.dylib; \ cp $(GLEW_LIB) $(APP_MACOS_DIR)/libGLEW.dylib; \ - install_name_tool -change $(BREW_PREFIX)/opt/glew/lib/libGLEW.2.2.dylib @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/sm64coopdx; > /dev/null 2>&1 \ - install_name_tool -id @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/libGLEW.dylib; > /dev/null 2>&1 \ + install_name_tool -change $(BREW_PREFIX)/lib/libGLEW.2.2.0.dylib @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \ + install_name_tool -change $(BREW_PREFIX)/opt/glew/lib/libGLEW.2.2.0.dylib @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \ + install_name_tool -id @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/libGLEW.dylib > /dev/null 2>&1; \ codesign --force --deep --sign - $(APP_MACOS_DIR)/libGLEW.dylib; \ - cp res/icon.icns $(APP_RESOURCES_DIR)/icon.icns; \ + mkdir res/build; \ + xcrun actool res/icon.icon --compile res/build --app-icon icon --output-partial-info-plist res/build/Info.plist --minimum-deployment-target $(MIN_MACOS_VERSION) --platform macosx > /dev/null 2>&1; \ + mv res/build/Assets.car $(APP_RESOURCES_DIR)/; \ + cp res/icon.icns $(APP_RESOURCES_DIR)/; \ + rm -rf res/build; \ echo "APPL????" > $(APP_CONTENTS_DIR)/PkgInfo; \ echo '' > $(APP_CONTENTS_DIR)/Info.plist; \ echo '' >> $(APP_CONTENTS_DIR)/Info.plist; \ @@ -1623,7 +1624,7 @@ all: echo ' CFBundleIconFile' >> $(APP_CONTENTS_DIR)/Info.plist; \ echo ' icon' >> $(APP_CONTENTS_DIR)/Info.plist; \ echo ' CFBundleIconName' >> $(APP_CONTENTS_DIR)/Info.plist; \ - echo ' AppIcon' >> $(APP_CONTENTS_DIR)/Info.plist; \ + echo ' icon' >> $(APP_CONTENTS_DIR)/Info.plist; \ echo ' CFBundleDisplayName' >> $(APP_CONTENTS_DIR)/Info.plist; \ echo ' sm64coopdx' >> $(APP_CONTENTS_DIR)/Info.plist; \ echo ' ' >> $(APP_CONTENTS_DIR)/Info.plist; \ diff --git a/lib/lua/mac_arm/liblua53.a b/lib/lua/mac_arm/liblua53.a index 8a3e6558b..505bb1ccd 100644 Binary files a/lib/lua/mac_arm/liblua53.a and b/lib/lua/mac_arm/liblua53.a differ diff --git a/res/icon.icns b/res/icon.icns index 1f20f4d2e..af1d170e8 100644 Binary files a/res/icon.icns and b/res/icon.icns differ diff --git a/res/icon.icon/Assets/icon.png b/res/icon.icon/Assets/icon.png new file mode 100644 index 000000000..3846e675a Binary files /dev/null and b/res/icon.icon/Assets/icon.png differ diff --git a/res/icon.icon/icon.json b/res/icon.icon/icon.json new file mode 100644 index 000000000..3a112c289 --- /dev/null +++ b/res/icon.icon/icon.json @@ -0,0 +1,35 @@ +{ + "fill" : "automatic", + "groups" : [ + { + "layers" : [ + { + "image-name" : "icon.png", + "name" : "icon", + "position" : { + "scale" : 3.5, + "translation-in-points" : [ + 0, + 0 + ] + } + } + ], + "shadow" : { + "kind" : "neutral", + "opacity" : 0.5 + }, + "specular" : false, + "translucency" : { + "enabled" : false, + "value" : 0.5 + } + } + ], + "supported-platforms" : { + "circles" : [ + "watchOS" + ], + "squares" : "shared" + } +} \ No newline at end of file