Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github CI: Fix Mac builder #176

Merged
merged 7 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions .github/workflows/macos_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,14 @@ jobs:
with:
submodules: recursive

# MoltenVK's build process breaks on Python 3.12
- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Packages
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_ANALYTICS: 1
run: |
if ! brew install ccache; then
if ! brew install ccache ninja; then
brew update
brew install ccache
brew install ccache ninja
fi

- name: Cache Dependencies
Expand Down Expand Up @@ -65,9 +60,10 @@ jobs:
git apply ../Externals/MoltenVK/patches/*.patch
./fetchDependencies --macos
make macos
chmod 755 Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib
ls -l Package/Release/MoltenVK/dynamic/*
chmod 755 Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib
mkdir -p "$HOME/moltenvk/lib/"
mv Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib "$HOME/moltenvk/lib/"
mv Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib "$HOME/moltenvk/lib/"
popd
rm -rf mvk-build

Expand Down Expand Up @@ -98,8 +94,8 @@ jobs:
-DUSE_SYSTEM_BZIP2=ON
-DUSE_SYSTEM_CURL=ON
-DUSE_SYSTEM_ICONV=ON
-DUSE_SYSTEM_LIBLZMA=ON
-DUSE_SYSTEM_SDL2=ON
-GNinja
)

cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 \
Expand All @@ -121,7 +117,7 @@ jobs:
ccache -p
ccache -s
ccache -z
make -j$(getconf _NPROCESSORS_ONLN) dolphin-emu
ninja dolphin-emu
ccache -s

- name: Build Dolphin (arm64)
Expand All @@ -130,7 +126,7 @@ jobs:
ccache -p
ccache -s
ccache -z
make -j$(getconf _NPROCESSORS_ONLN) dolphin-emu
ninja dolphin-emu
ccache -s

- name: Prepare Build Artifacts
Expand All @@ -141,8 +137,8 @@ jobs:
PR_NUM: ${{ github.event.pull_request.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: |
lipo -create build/Binaries/Dolphin.app/Contents/MacOS/Dolphin build-arm/Binaries/Dolphin.app/Contents/MacOS/Dolphin -o dolphin
mv dolphin build/Binaries/Dolphin.app/Contents/MacOS/Dolphin
lipo -create build/Binaries/DolphinQt.app/Contents/MacOS/DolphinQt build-arm/Binaries/DolphinQt.app/Contents/MacOS/DolphinQt -o dolphin
mv dolphin build/Binaries/DolphinQt.app/Contents/MacOS/DolphinQt
TAG="$(git tag --points-at HEAD)"
if [ ! -z "$TAG" ]; then
SUFFIX="$TAG"
Expand All @@ -154,12 +150,12 @@ jobs:
SUFFIX="sha[$(git rev-parse --short HEAD)]"
fi
APPNAME="PrimeHack-$SUFFIX"
mv build/Binaries/Dolphin.app "$APPNAME.app"
tar cvzf "$APPNAME.tar.gz" "$APPNAME.app"
mv build/Binaries/DolphinQt.app "$APPNAME.app"
tar --options xz:compression-level=9 -cvJf "$APPNAME.tar.xz" "$APPNAME.app"
echo "name=$APPNAME" >> "$GITHUB_OUTPUT"

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create-artifact.outputs.name }}
path: "*.tar.gz"
path: "*.tar.xz"
14 changes: 7 additions & 7 deletions .github/workflows/scripts/macos/build-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -e
export MACOSX_DEPLOYMENT_TARGET=10.15
INSTALLDIR="$HOME/deps"
NPROCS="$(getconf _NPROCESSORS_ONLN)"
SDL=SDL2-2.30.2
QT=6.2.8
SDL=SDL2-2.30.9
QT=6.2.10
QT_SUFFIX=-opensource

mkdir deps-build
Expand All @@ -18,11 +18,11 @@ export CFLAGS="-I$INSTALLDIR/include -Os $CFLAGS"
export CXXFLAGS="-I$INSTALLDIR/include -Os $CXXFLAGS"

cat > SHASUMS <<EOF
891d66ac8cae51361d3229e3336ebec1c407a8a2a063b61df14f5fdf3ab5ac31 $SDL.tar.gz
718c91365fc0ab00fb37c262e30285efc7c608d1b7f2b2a3611338ba0799157b qtbase-everywhere$QT_SUFFIX-src-$QT.tar.xz
9ddb0859697de5832f91b85fa20cd9c90d3174c035e9e4b05393969819fd37ec qtsvg-everywhere$QT_SUFFIX-src-$QT.tar.xz
97326f2ce07701316fab45e76510e30f540c23527a7723b0ad98d7ffea76ba14 qttools-everywhere$QT_SUFFIX-src-$QT.tar.xz
46191973fd688e3b9b0eac799a2e3de8fb672874c707b177cf71d8e9198ca77c qttranslations-everywhere$QT_SUFFIX-src-$QT.tar.xz
24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4 $SDL.tar.gz
efbeff5ad6f4d46e82734a681909892401688432fd7ef02c63d2083304d8265c qtbase-everywhere$QT_SUFFIX-src-$QT.tar.xz
5e04e4b7699d837c52641310ca386373801a24e8924de7ffcc4b84890431eb38 qtsvg-everywhere$QT_SUFFIX-src-$QT.tar.xz
62809b242ebcb0e65ac6738f76d005d24c352a8b813128fa3772906ca50cf980 qttools-everywhere$QT_SUFFIX-src-$QT.tar.xz
57e7cb80d31c32ccbb00bbd7da170970b9effb992970aaf687d4524117aca41e qttranslations-everywhere$QT_SUFFIX-src-$QT.tar.xz
EOF

curl -L \
Expand Down