Skip to content
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
75 changes: 53 additions & 22 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,74 @@ on:

jobs:
build:
runs-on: ${{ matrix.os[0] }}
runs-on: ${{ matrix.target.machine }}
strategy:
matrix:
os: [
[macos-latest, arm64, bash],
[macos-13, x86_64, bash],
[ubuntu-latest, x86_64, bash],
[windows-latest, x86_64, msys2]
]
target:
- machine: macos-latest
architecture: arm64
shell: bash
packageManager: brew
- machine: macos-13
architecture: x86_64
shell: bash
packageManager: brew
- machine: macos-latest
architecture: arm64
shell: bash
packageManager: macport
- machine: ubuntu-latest
architecture: x86_64
shell: bash
packageManager: default
- machine: ubuntu-22.04-arm
architecture: arm64
shell: bash
packageManager: default
- machine: ubuntu-24.04-arm
architecture: arm64
shell: bash
packageManager: default
- machine: windows-latest
architecture: x86_64
shell: msys2
packageManager: default
fail-fast: false
defaults:
run:
shell: ${{ matrix.os[2] }} {0}
shell: ${{ matrix.target.shell }} {0}

steps:
- uses: actions/checkout@v4

- name: Install Ubuntu packages
if: matrix.os[0] == 'ubuntu-latest'
if: startsWith(matrix.target.machine, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev

- name: Install macOS packages
if: startsWith(matrix.os[0], 'macos')
- name: Install macOS packages with brew
if: startsWith(matrix.target.machine, 'macos') && matrix.target.packageManager == 'brew'
run: |
brew update
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc

- name: Install macOS packages with macport
if: startsWith(matrix.target.machine, 'macos') && matrix.target.packageManager == 'macport'
run: |
curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
source ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync
sudo port install gmp mpfr libmpc libiconv bison flex texinfo

- name: Install MSYS2 packages
if: matrix.os[0] == 'windows-latest'
if: startsWith(matrix.target.machine, 'windows')
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: |
base-devel git make texinfo flex bison patch binutils mpc-devel tar
mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake
mingw-w64-i686-make mingw-w64-i686-libogg
mingw-w64-i686-readline mingw-w64-i686-gcc
mingw-w64-i686-cmake mingw-w64-i686-make mingw-w64-i686-libogg
update: true

- name: Runs all the stages in the shell
Expand All @@ -63,16 +93,17 @@ jobs:
mipsel-none-elf-as --version
mipsel-none-elf-ld --version
mipsel-none-elf-gcc --version

- name: Get short SHA
id: slug
run: printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT

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

echo "sha8=${MSYSTEM}-sha[$(echo ${GITHUB_SHA} | cut -c1-8)]" >> $GITHUB_OUTPUT

- name: Prepare ps2dev folder
run: |
tar -zcvf ps2dev-${{matrix.target.machine}}.tar.gz ps2dev

- uses: actions/upload-artifact@v4
with:
name: ps2dev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}
path: ps2dev.tar.gz
name: ps2dev-${{matrix.target.machine}}-ps2dev-${{matrix.target.architecture}}-${{matrix.target.packageManager}}-${{ steps.slug.outputs.sha8 }}
path: ps2dev-${{matrix.target.machine}}.tar.gz
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,48 @@ the ps2dev main page.

## Introduction

This program will automatically build and install a IOP compiler, which is used in the creation of homebrew software for the Sony PlayStation® 2 videogame system.
This program will automatically build and install an IOP compiler, which is used in the creation of homebrew software for the Sony PlayStation® 2 videogame system.

### Supported platforms

- macOS (Intel and Apple Silicon) with Homebrew or MacPorts
- Ubuntu (x86_64 and arm64)
- Windows (MSYS2, MinGW32 environment)

## What these scripts do

These scripts download (with `git clone`) and install [binutils 2.35.2](http://www.gnu.org/software/binutils/ "binutils") (iop), [gcc 11.1.0](https://gcc.gnu.org/ "gcc") (iop).
These scripts download (with `git clone`) and install [binutils 2.45](http://www.gnu.org/software/binutils/ "binutils") (iop), [gcc 15.2.0](https://gcc.gnu.org/ "gcc") (iop).

## Requirements

1. Install gcc/clang, make, patch, git, texinfo, bison, flex, libgmp3, libmpfr, and libmpc if you don't have those packages.
1. Install gcc/clang, make, patch, git, and texinfo if you don't have those packages. Below are example commands per platform:

### macOS (Homebrew)
```bash
brew update
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
```

### macOS (MacPorts)
Make sure MacPorts is installed first. Then:
```bash
sudo port selfupdate
sudo port install gmp mpfr libmpc libiconv bison flex texinfo
```

### Ubuntu
```bash
sudo apt-get update
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
```

### Windows (MSYS2 MinGW32)
Use the MSYS2 MinGW32 shell and run:
```bash
pacman -S --noconfirm base-devel git make texinfo flex bison patch binutils mpc-devel tar \
mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-make mingw-w64-i686-libogg
```

2. Ensure that you have enough permissions for managing PS2DEV location (which defaults to `/usr/local/ps2dev`). PS2DEV location MUST NOT have spaces or special characters in its path! For example, on Linux systems, you can set access for the current user by running commands:
```bash
export PS2DEV=/usr/local/ps2dev
Expand All @@ -29,7 +62,6 @@ sudo chown -R $USER: $PS2DEV
3. Add this to your login script (example: `~/.bash_profile`)
```bash
export PS2DEV=/usr/local/ps2dev
export PS2SDK=$PS2DEV/ps2sdk
export PATH=$PATH:$PS2DEV/iop/bin
```
4. Run toolchain.sh
Expand Down
2 changes: 1 addition & 1 deletion scripts/001-binutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if [ "$(uname -s)" = "Darwin" ]; then
## Check if using MacPorts
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
echo Macport base is $MACPORT_BASE
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE"
TARG_XTRA_OPTS="--with-system-zlib --with-libiconv_prefix=$MACPORT_BASE --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/002-gcc-stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [ "$(uname -s)" = "Darwin" ]; then
## Check if using MacPorts
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
echo Macport base is $MACPORT_BASE
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
TARG_XTRA_OPTS="--with-system-zlib --with-libiconv_prefix=$MACPORT_BASE --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
fi
fi

Expand Down
Loading