Skip to content

util: stricter typing in altivec unaligned load functions #5

util: stricter typing in altivec unaligned load functions

util: stricter typing in altivec unaligned load functions #5

Workflow file for this run

name: Classic Mac OS (powerpc)
on:
push:
pull_request:
workflow_dispatch:
# This file uses the Retro68 toolchain to build
# a binary of Schism Tracker for the Classic Mac
# OS. I only care enough to build for powerpc,
# since 68k machines are way too slow for it to
# be even remotely usable. Regardless, I'm still
# putting powerpc files in their own folder in
# case someone really wants to build a 68k version
# of schism.
#
# There are quite a few hacks in here; for example
# xz isn't included in the docker image, so we have
# to make it ourselves, which is annoying. However,
# liblzma is. Unfortunately this means symbols are
# screwed up and we need to preload a newer liblzma.
jobs:
macos:
runs-on: ubuntu-latest
container:
image: ghcr.io/autc04/retro68
env:
SDL_VERSION: 1.2.15
SDL_SHA256: d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00
XZ_VERSION: 5.6.3
XZ_SHA256: b1d45295d3f71f25a4c9101bd7c8d16cb56348bbef3bbc738da0351e17c73317
FLAC_VERSION: 1.5.0
FLAC_SHA256: f2c1c76592a82ffff8413ba3c4a1299b6c7ab06c734dee03fd88630485c2b920
LIBOGG_VERSION: 1.3.6
LIBOGG_SHA256: 5c8253428e181840cd20d41f3ca16557a9cc04bad4a3d04cce84808677fa1061
UTF8PROC_VERSION: 2.10.0
UTF8PROC_SHA256: 276a37dc4d1dd24d7896826a579f4439d1e5fe33603add786bb083cab802e23e
steps:
- name: 'Retrieve runner temp directory'
id: temp
run: |
echo "temp=$RUNNER_TEMP" >> $GITHUB_OUTPUT
- name: 'Cache Universal Interfaces'
id: cache-universal-interfaces
uses: actions/cache@v4
with:
path: '${{ steps.temp.outputs.temp }}/InterfacesAndLibraries'
key: macos-cache-universal-interfaces
- name: 'Prepare Universal Interfaces'
if: steps.cache-universal-interfaces.outputs.cache-hit != 'true'
run: |
# make sure we have plenty of mirrors so we don't get bogus build fails
curl "https://staticky.com/mirrors/ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./MPW-GM_Images/MPW-GM.img.bin" > "$RUNNER_TEMP/MPW-GM.img.bin" \
|| curl "https://web.archive.org/web/20131006071819if_/https://staticky.com/mirrors/ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./MPW-GM_Images/MPW-GM.img.bin" > "$RUNNER_TEMP/MPW-GM.img.bin" \
|| curl "http://old.mac.gdn/apps/mpw-gm.img__0.bin" > "$RUNNER_TEMP/MPW-GM.img.bin" \
|| curl "ftp://mirror:mirror@ftp.macintosh.garden/apps/mpw-gm.img__0.bin" > "$RUNNER_TEMP/MPW-GM.img.bin"
/Retro68-build/bin/install-universal-interfaces.sh "$RUNNER_TEMP" "MPW-GM.img.bin"
- name: 'Link Universal Interfaces'
run: |
echo "Linking Universal interfaces..."
/Retro68-build/bin/interfaces-and-libraries.sh /Retro68-build/toolchain "$RUNNER_TEMP/InterfacesAndLibraries"
echo "done"
- name: 'Checkout'
uses: actions/checkout@v4
with:
path: schism
# FIXME store this in RUNNER_TEMP instead
- name: 'Cache XZ utils sources and binaries'
id: cache-xz
uses: actions/cache@v4
with:
path: xz-${{ env.XZ_VERSION }}
key: macos-cache-xz
- name: 'Downloads XZ utils sources'
if: steps.cache-xz.outputs.cache-hit != 'true'
run: |
curl -L -o "xz-$XZ_VERSION.tar.gz" "https://github.com/tukaani-project/xz/releases/download/v$XZ_VERSION/xz-$XZ_VERSION.tar.gz"
echo "$XZ_SHA256 xz-$XZ_VERSION.tar.gz" | shasum -a 256 -c -
tar xvf "xz-$XZ_VERSION.tar.gz"
- name: 'Build XZ utils'
if: steps.cache-xz.outputs.cache-hit != 'true'
run: |
cd "xz-$XZ_VERSION"
mkdir build
cd build
../configure
make
cd .. # build
cd .. # xz-$XZ_VERSION
- name: 'Install XZ utils'
run: |
cd "xz-$XZ_VERSION/build"
make install
cd ../.. # xz-$XZ_VERSION/build
- name: 'Install unar'
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get install -y unar
- name: 'Cache dependencies'
id: cache-ppc-dependencies
uses: actions/cache@v4
with:
path: '${{ steps.temp.outputs.temp }}/ppcprefix'
key: macos-cache-powerpc-flac_${{ env.FLAC_VERSION }}-libogg_${{ env.LIBOGG_VERSION }}-SDL_${{ env.SDL_VERSION }}-UTF8PROC_${{ env.UTF8PROC_VERSION }}
- name: 'Download SDL 1.2 sources (powerpc)'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
curl -L -o "SDL-$SDL_VERSION.tar.gz" "https://www.libsdl.org/release/SDL-$SDL_VERSION.tar.gz"
echo "$SDL_SHA256 SDL-$SDL_VERSION.tar.gz" | shasum -a 256 -c -
tar xvf "SDL-$SDL_VERSION.tar.gz"
cd "SDL-$SDL_VERSION"
patch -p1 < ../schism/.github/patches/SDL/2-configure-retro68.patch
patch -p1 < ../schism/.github/patches/SDL/3-fixup-main.patch
./autogen.sh
cd ..
- name: 'Download OpenGL SDK'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
curl -f "https://old.mac.gdn/apps/OpenGL_SDK_1.2.sit" > "OpenGL_SDK_1.2.sit" \
|| curl -f "ftp://macosix.retro-os.live/OS9%20Files/Deveopment%20Tools/OpenGL_SDK_1.2.sit" > "OpenGL_SDK_1.2.sit"
echo "5327d9253ca60f48d8f6e5d826f861ef463ba22c721539e17c8d4e89a7543216 OpenGL_SDK_1.2.sit" | shasum -a 256 -c -
unar -k hidden "OpenGL_SDK_1.2.sit"
mv "OpenGL SDK 1.2" "OpenGL_SDK_1.2"
mkdir GLLibs
cd OpenGL_SDK_1.2/Libraries
mkdir -p "$RUNNER_TEMP/ppcprefix/lib"
for i in OpenGL*Stub; do
MakeImport "$i" $RUNNER_TEMP/ppcprefix/lib/lib"${i%%Stub}".a
done
cd ../..
- name: 'Build SDL 1.2.15 (powerpc)'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
cd SDL-1.2.15
mkdir build_powerpc
cd build_powerpc
# XXX we could probably do --disable-file without too much trouble
../configure --host=powerpc-apple-macos --prefix="$RUNNER_TEMP/ppcprefix" --disable-joystick --disable-cdrom CPPFLAGS="-I$(pwd)/../../OpenGL_SDK_1.2/Headers"
make
make install
cd .. # build_powerpc
cd .. # SDL-1.2.15
- name: 'Download and prepare libogg sources'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
curl -L -o libogg-$LIBOGG_VERSION.tar.xz "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-$LIBOGG_VERSION.tar.xz" || curl -L -o libogg-$LIBOGG_VERSION.tar.xz "https://github.com/xiph/ogg/releases/download/v$LIBOGG_VERSION/libogg-$LIBOGG_VERSION.tar.xz"
echo "$LIBOGG_SHA256 libogg-$LIBOGG_VERSION.tar.xz" | shasum -a 256 -c -
LD_PRELOAD=/usr/local/lib/liblzma.so.5 tar xvf "libogg-$LIBOGG_VERSION.tar.xz"
- name: 'Build libogg (powerpc)'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
cd libogg-$LIBOGG_VERSION
mkdir build_powerpc
cd build_powerpc
CPPFLAGS="-I$RUNNER_TEMP/ppcprefix/include" LDFLAGS="-L$RUNNER_TEMP/ppcprefix/lib" ../configure --host=powerpc-apple-macos --prefix="$RUNNER_TEMP/ppcprefix"
make
make install
cd .. # build_powerpc
cd .. # libogg-$LIBOGG_VERSION
- name: 'Download and prepare FLAC sources'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
curl -L -o flac-$FLAC_VERSION.tar.xz "https://ftp.osuosl.org/pub/xiph/releases/flac/flac-$FLAC_VERSION.tar.xz" || curl -L -o flac-$FLAC_VERSION.tar.xz "https://github.com/xiph/flac/releases/download/$FLAC_VERSION/flac-$FLAC_VERSION.tar.xz"
echo "$FLAC_SHA256 flac-$FLAC_VERSION.tar.xz" | shasum -a 256 -c -
LD_PRELOAD=/usr/local/lib/liblzma.so.5 tar xvf "flac-$FLAC_VERSION.tar.xz"
- name: 'Build FLAC (powerpc)'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
cd flac-$FLAC_VERSION
mkdir build_powerpc
cd build_powerpc
# hax: we need to patch out all calls to chmod, utimensat, and chown, because none of them
# exist under retro68, and additionally we don't use anything that's likely to need them
CPPFLAGS="-I$RUNNER_TEMP/ppcprefix/include" LDFLAGS="-L$RUNNER_TEMP/ppcprefix/lib" ../configure --host=powerpc-apple-macos --disable-programs --disable-examples --disable-cpplibs --prefix="$RUNNER_TEMP/ppcprefix"
make
make install
cd .. # build_powerpc
cd .. # flac-$FLAC_VERSION
- name: 'Download utf8proc'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
curl -L -o "utf8proc-$UTF8PROC_VERSION.tar.gz" "https://github.com/JuliaStrings/utf8proc/releases/download/v$UTF8PROC_VERSION/utf8proc-$UTF8PROC_VERSION.tar.gz"
echo "$UTF8PROC_SHA256 utf8proc-$UTF8PROC_VERSION.tar.gz" | shasum -a 256 -c -
tar xvf "utf8proc-$UTF8PROC_VERSION.tar.gz"
- name: 'Build utf8proc (powerpc)'
if: steps.cache-ppc-dependencies.outputs.cache-hit != 'true'
run: |
cd utf8proc-$UTF8PROC_VERSION
mkdir build_powerpc
cd build_powerpc
CMAKE_TOOLCHAIN_FILE=/Retro68-build/toolchain/powerpc-apple-macos/cmake/retroppc.toolchain.cmake cmake .. -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/ppcprefix"
make
make install
cd .. # build_powerpc
cd .. # utf8proc-$UTF8PROC_VERSION
- name: 'Get date of latest commit'
id: date
run: |
cd schism
echo "date=$(git log -n 1 --date=short --format=format:%cd | sed 's/\(....\)-\(..\)-\(..\).*/\1\2\3/')" >> $GITHUB_OUTPUT
cd ..
- name: 'Build Schism (powerpc)'
run: |
cd schism
mkdir acinclude
curl -s "https://raw.githubusercontent.com/pkgconf/pkgconf/refs/tags/pkgconf-2.3.0/pkg.m4" -o "acinclude/pkg.m4"
autoreconf -Iacinclude -i
mkdir build_powerpc
cd build_powerpc
CPPFLAGS="-I$RUNNER_TEMP/ppcprefix/include" LDFLAGS="-L$RUNNER_TEMP/ppcprefix/lib" LIBS="-lOpenGLLibrary" UTF8PROC_CFLAGS="-I/Retro68-build/toolchain/powerpc-apple-macos/include" UTF8PROC_LIBS="-lutf8proc" FLAC_CFLAGS="-I$RUNNER_TEMP/ppcprefix/include" FLAC_LIBS="-L$RUNNER_TEMP/ppcprefix/lib -lFLAC -logg -lm" SDL12_CFLAGS="-I$RUNNER_TEMP/ppcprefix/include/SDL" SDL12_LIBS="-L$RUNNER_TEMP/ppcprefix/lib -lSDL" ../configure --with-sdl12 --enable-sdl12-linking --with-flac --enable-flac-linking --without-jack --without-sdl2 --disable-threads --host=powerpc-apple-macos --prefix="$RUNNER_TEMP/ppcprefix"
make schismtracker.bin RETRO68_ROOT="/Retro68-build/toolchain"
cd .. # build_powerpc
cd .. # schism
- name: 'Package Schism'
run: |
cp schism/build_powerpc/schismtracker.bin .
cp schism/docs/configuration.md .
cp schism/README.md schism/COPYING .
curl -s "https://raw.githubusercontent.com/xiph/flac/master/COPYING.Xiph" -o "COPYING.Xiph"
zip -r schismtracker.zip configuration.md COPYING COPYING.Xiph README.md schismtracker.bin
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: schismtracker-${{ steps.date.outputs.date }}-classic-macos
path: schismtracker.zip