Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sh text eol=lf linguist-language=Shell
*.txt eol=lf
215 changes: 131 additions & 84 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,92 +8,139 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, ubuntu-latest, macos-26]
include:
- runner: ubuntu-latest
os: linux

- runner: macos-15-intel
os: macos

- runner: macos-26
os: macos

steps:
- uses: actions/checkout@v6

- name: Install Ubuntu requirements
if: matrix.os == 'ubuntu-latest'
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 intel 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: |
brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo

- name: Install macOS arm64 requirements
if: matrix.os == 'macos-26'
shell: bash -e {0}
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_ENV_HINTS: 1
run: |
brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo

- name: Runs all the stages in the shell
if: matrix.os == 'ubuntu-latest'
shell: bash -e {0}
env:
BUILD_PS3TOOLCHAIN_ONLY: 1
run: |
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: Runs all the stages in the shell
if: matrix.os == 'macos-15-intel'
shell: arch -x86_64 bash -e {0}
env:
BUILD_PS3TOOLCHAIN_ONLY: 1
run: |
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: Runs all the stages in the shell
if: matrix.os == 'macos-26'
shell: bash -e {0}
env:
BUILD_PS3TOOLCHAIN_ONLY: 1
run: |
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 "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> "$GITHUB_OUTPUT"

- name: Compress ps3dev folder
run: |
tar -zcvf ps3dev.tar.gz ps3dev

- uses: actions/upload-artifact@v6
with:
name: ps3dev-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}
path: ps3dev.tar.gz
- uses: actions/checkout@v6

- name: Install Linux requirements
if: matrix.os == 'linux'
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 pv libssl-dev

# ------------------------
# macOS dependencies
# ------------------------
- name: Install macOS requirements
if: matrix.os == 'macos'
shell: bash
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_ENV_HINTS: 1
run: |
eval "$(brew shellenv)"
brew install \
autoconf automake openssl libelf ncurses zlib gmp wget \
pkg-config texinfo pv

# ------------------------
# GLOBAL ENV SETUP
# ------------------------
- name: Setup environment (PS3DEV + base PATH)
shell: bash
run: |
mkdir -p "$PWD/ps3dev"
mkdir -p "$PWD/build"

echo "BUILD_PS3TOOLCHAIN_ONLY=1" >> $GITHUB_ENV
echo "NO_SAVANNAH=1" >> $GITHUB_ENV
echo "PS3DEV=$PWD/ps3dev" >> $GITHUB_ENV
echo "PSL1GHT=$PWD/ps3dev" >> $GITHUB_ENV
echo "PATH=$PATH:$PWD/ps3dev/bin:$PWD/ps3dev/ppu/bin:$PWD/ps3dev/spu/bin" >> $GITHUB_ENV

- name: Cache downloaded archives
uses: actions/cache@v5
with:
path: archives
key: archives-${{ hashFiles('archives/archives.txt') }}

- name: Purge unverifiable archives
run: |
while IFS= read -r line; do
set -- $line
[ "${1:-}" = "-" ] || continue
# 3rd field is URL, 5th field (if "->") is rename
url="$3"
rename=""
[ "${4:-}" = "->" ] && rename="${5:-}"
file="${rename:-$(basename "$url")}"
rm -f "archives/$file"
done < archives/archives.txt

# ------------------------
# Build steps
# ------------------------
- name: Download files
working-directory: ./build
run: ../download.sh

- name: Build Binutils (PPU)
run: ./toolchain.sh 001

- name: Build GCC + Newlib (PPU)
run: ./toolchain.sh 002

- name: Symlinks (PPU)
run: ./toolchain.sh 004

- name: Build Binutils (SPU)
run: ./toolchain.sh 005

- name: Build GCC + Newlib (SPU)
run: ./toolchain.sh 006

- name: Get short SHA
id: slug
run: echo "sha8=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"

- name: Compress ps3dev folder
run: tar -zcvf ps3dev-${{ matrix.os }}-${{ runner.arch }}.tar.gz ps3dev

- uses: actions/upload-artifact@v7
with:
name: ps3dev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os }}-${{ runner.arch }}
path: ps3dev-${{ matrix.os }}-${{ runner.arch }}.tar.gz

push_release:
if: |
github.event_name == 'push' &&
github.repository == 'ps3dev/ps3toolchain'
needs: build
runs-on: ubuntu-latest
Comment thread
clienthax marked this conversation as resolved.
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true

- name: Create Pre-Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="nightly-$(date -u +%Y-%m-%d)"
gh release delete "$TAG" --yes --cleanup-tag || true
gh release create "$TAG" artifacts/*.tar.gz --target ${{ GITHUB.SHA }} -t "$TAG" --prerelease
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build/
.idea/**
/build
/archives/*
!/archives/archives.txt
/ps3dev
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ RUN \
apt-get -y update && \
apt-get -y install \
autoconf bison build-essential ca-certificates flex git libelf-dev\
libgmp-dev libncurses5-dev libssl-dev libtool-bin pkg-config python-dev-is-python3 \
texinfo wget zlib1g-dev && \
libgmp-dev libncurses5-dev libssl-dev libtool-bin pkg-config \
texinfo wget zlib1g-dev pv && \
apt-get -y clean autoclean autoremove && \
rm -rf /var/lib/{apt,dpkg,cache,log}/

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
## Set up your environment by installing the following software:

autoconf, automake, bison, flex, gcc, libelf, make, makeinfo,
ncurses, patch, python, subversion, wget, zlib, libtool, python,
bzip2, gmp, pkg-config, g++, libssl-dev, clang
ncurses, patch, python, subversion, wget, zlib, libtool,
bzip2, gmp, pkg-config, g++, libssl-dev, clang, pv

### Linux

Expand Down
5 changes: 5 additions & 0 deletions archives/archives.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
6c7af8ed1c8cf9b4b9d6e6fe09a3e1d3d479fe63984ba8b9b26bf356b6313ca9 19973532 https://sourceware.org/pub/binutils/releases/binutils-2.22.tar.bz2 -> binutils-2.22.tar.bz2
1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a 62312628 https://sourceware.org/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz -> gcc-7.2.0.tar.xz
c644b2847244278c57bec2ddda69d8fab5a7c767f3b9af69aa7aa3da823ff692 14571004 https://sourceware.org/pub/newlib/newlib-1.20.0.tar.gz -> newlib-1.20.0.tar.gz
- - https://github.com/ps3dev/psl1ght/tarball/master -> psl1ght.tar.gz
- - https://github.com/ps3dev/ps3libraries/tarball/master -> ps3libraries.tar.gz
10 changes: 8 additions & 2 deletions config/get-config-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@ fetch_config_file() {
chmod +x "${file}"
}

fetch_config_file config.guess
fetch_config_file config.sub
if [ -z "${NO_SAVANNAH}" ]; then
fetch_config_file config.guess
fetch_config_file config.sub
else
echo "NO_SAVANNAH is set, skipping Savannah downloads."
cp "${CONFIG_DIR}/config.guess" "config.guess"
cp "${CONFIG_DIR}/config.sub" "config.sub"
fi
12 changes: 0 additions & 12 deletions depends/check-python.sh

This file was deleted.

Loading