Build BlastEm for macOS #81
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
name: Build Emulators | |
on: | |
push: # Trigger for pushes. | |
branches: | |
- main | |
paths: | |
- emulator-patches/** | |
- software/player/** | |
- .github/workflows/build-emulators.yaml | |
pull_request: # Trigger for pull requests. | |
types: [opened, synchronize, reopened, ready_for_review] | |
workflow_dispatch: # Allows for manual triggering. | |
inputs: | |
ref: | |
description: "The ref to build." | |
required: false | |
type: string | |
for-release: | |
description: "True if we should upload artifacts for a release." | |
default: false | |
type: boolean | |
workflow_call: # Allows for another workflow to call this one. | |
inputs: | |
ref: | |
description: "The ref to build." | |
required: true | |
type: string | |
for-release: | |
description: "True if we should upload artifacts for a release." | |
default: false | |
type: boolean | |
# If another instance of this workflow is started for the same PR, cancel the | |
# old one. If a PR is updated and a new test run is started, the old test run | |
# will be cancelled automatically to conserve resources. | |
concurrency: | |
group: build-emulators-${{ inputs.ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-blastem-linux: | |
name: Build BlastEm for Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout BlastEm | |
uses: actions/checkout@v4 | |
with: | |
repository: libretro/blastem | |
ref: 277e4a62668597d4f59cadda1cbafb844f981d45 | |
path: . | |
- name: Checkout Kinetoscope | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository }} | |
ref: ${{ inputs.ref || github.ref }} | |
path: kinetoscope | |
- name: Apply patch | |
run: patch -p1 -i kinetoscope/emulator-patches/blastem-0.6.2.patch | |
- name: Install deps for portable build | |
run: | | |
sudo apt -y install libgl-dev libglu1-mesa-dev | |
wget -O glew-2.1.0.tgz https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download | |
tar xf glew-2.1.0.tgz | |
ln -s glew-2.1.0 glew | |
wget -O SDL2-2.30.3.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz | |
tar xf SDL2-2.30.3.tar.gz | |
ln -s SDL2-2.30.3 sdl | |
wget -O curl-8.8.0.tar.gz https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.gz | |
tar xf curl-8.8.0.tar.gz | |
ln -s curl-8.8.0 curl | |
- name: Setup ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
create-symlink: true | |
- name: Build portable binaries | |
run: ./build_release | |
- name: Upload blastem binaries | |
uses: actions/upload-artifact@v4 | |
if: inputs.for-release | |
with: | |
name: blastem-linux | |
path: blastem-0.6.2-kinetoscope | |
retention-days: 1 | |
build-blastem-windows: | |
name: Build BlastEm for Windows | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout BlastEm | |
uses: actions/checkout@v4 | |
with: | |
repository: libretro/blastem | |
ref: 277e4a62668597d4f59cadda1cbafb844f981d45 | |
path: . | |
- name: Checkout Kinetoscope | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository }} | |
ref: ${{ inputs.ref || github.ref }} | |
path: kinetoscope | |
- name: Apply patch | |
run: patch -p1 -i kinetoscope/emulator-patches/blastem-0.6.2.patch | |
- name: Install deps for portable build | |
run: | | |
sudo apt -y install mingw-w64 | |
wget -O glew-2.2.0-win32.zip https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip | |
unzip glew-2.2.0-win32.zip | |
ln -s glew-2.2.0 glew | |
wget -O SDL2-devel-2.30.8-mingw.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.8/SDL2-devel-2.30.8-mingw.tar.gz | |
tar xf SDL2-devel-2.30.8-mingw.tar.gz | |
ln -s SDL2-2.30.8 sdl | |
wget -O curl-8.8.0.tar.gz https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.gz | |
tar xf curl-8.8.0.tar.gz | |
ln -s curl-8.8.0 curl | |
- name: Setup ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
create-symlink: true | |
- name: Symlink mingw compilers to ccache | |
run: | | |
for name in \ | |
x86_64-w64-mingw32-gcc-win32 \ | |
x86_64-w64-mingw32-gcc; do | |
sudo ln -s $(which ccache) /usr/local/bin/$name | |
done | |
- name: Build portable binaries | |
run: OS=Win64 ./build_release | |
- name: Upload blastem binaries | |
uses: actions/upload-artifact@v4 | |
if: inputs.for-release | |
with: | |
name: blastem-windows | |
path: blastem-0.6.2-kinetoscope | |
retention-days: 1 | |
build-blastem-macos: | |
name: Build BlastEm for macOS | |
runs-on: macos-13 # x86-64 explicitly, since BlastEm won't build on arm64 | |
steps: | |
- name: Checkout BlastEm | |
uses: actions/checkout@v4 | |
with: | |
repository: libretro/blastem | |
ref: 277e4a62668597d4f59cadda1cbafb844f981d45 | |
path: . | |
- name: Checkout Kinetoscope | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository }} | |
ref: ${{ inputs.ref || github.ref }} | |
path: kinetoscope | |
- name: Apply patch | |
run: patch -p1 -i kinetoscope/emulator-patches/blastem-0.6.2.patch | |
- name: Install deps for portable build | |
run: | | |
wget -O glew-2.1.0.tgz https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download | |
tar xf glew-2.1.0.tgz | |
ln -s glew-2.1.0 glew | |
wget -O SDL2-2.30.3.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz | |
tar xf SDL2-2.30.3.tar.gz | |
ln -s SDL2-2.30.3 sdl | |
wget -O curl-8.8.0.tar.gz https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.gz | |
tar xf curl-8.8.0.tar.gz | |
ln -s curl-8.8.0 curl | |
- name: Setup ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
create-symlink: true | |
- name: Build portable binaries | |
run: OS=Darwin ./build_release | |
- name: Upload blastem binaries | |
uses: actions/upload-artifact@v4 | |
if: inputs.for-release | |
with: | |
name: blastem-macos | |
path: blastem-0.6.2-kinetoscope | |
retention-days: 1 |