Skip to content

Commit 4b740b7

Browse files
authored
Merge pull request #38 from fjtrujy/upgradeCI_CD
Fixing MacPorts and upgrading CI/CD
2 parents 2bfdd4c + d181070 commit 4b740b7

File tree

4 files changed

+91
-28
lines changed

4 files changed

+91
-28
lines changed

.github/workflows/compilation.yml

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,74 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ${{ matrix.os[0] }}
12+
runs-on: ${{ matrix.target.machine }}
1313
strategy:
1414
matrix:
15-
os: [
16-
[macos-latest, arm64, bash],
17-
[macos-13, x86_64, bash],
18-
[ubuntu-latest, x86_64, bash],
19-
[windows-latest, x86_64, msys2]
20-
]
15+
target:
16+
- machine: macos-latest
17+
architecture: arm64
18+
shell: bash
19+
packageManager: brew
20+
- machine: macos-13
21+
architecture: x86_64
22+
shell: bash
23+
packageManager: brew
24+
- machine: macos-latest
25+
architecture: arm64
26+
shell: bash
27+
packageManager: macport
28+
- machine: ubuntu-latest
29+
architecture: x86_64
30+
shell: bash
31+
packageManager: default
32+
- machine: ubuntu-22.04-arm
33+
architecture: arm64
34+
shell: bash
35+
packageManager: default
36+
- machine: ubuntu-24.04-arm
37+
architecture: arm64
38+
shell: bash
39+
packageManager: default
40+
- machine: windows-latest
41+
architecture: x86_64
42+
shell: msys2
43+
packageManager: default
2144
fail-fast: false
2245
defaults:
2346
run:
24-
shell: ${{ matrix.os[2] }} {0}
47+
shell: ${{ matrix.target.shell }} {0}
2548

2649
steps:
2750
- uses: actions/checkout@v4
2851

2952
- name: Install Ubuntu packages
30-
if: matrix.os[0] == 'ubuntu-latest'
53+
if: startsWith(matrix.target.machine, 'ubuntu')
3154
run: |
3255
sudo apt-get update
3356
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
3457
35-
- name: Install macOS packages
36-
if: startsWith(matrix.os[0], 'macos')
58+
- name: Install macOS packages with brew
59+
if: startsWith(matrix.target.machine, 'macos') && matrix.target.packageManager == 'brew'
3760
run: |
3861
brew update
3962
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
4063
64+
- name: Install macOS packages with macport
65+
if: startsWith(matrix.target.machine, 'macos') && matrix.target.packageManager == 'macport'
66+
run: |
67+
curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
68+
source ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync
69+
sudo port install gmp mpfr libmpc libiconv bison flex texinfo
70+
4171
- name: Install MSYS2 packages
42-
if: matrix.os[0] == 'windows-latest'
72+
if: startsWith(matrix.target.machine, 'windows')
4373
uses: msys2/setup-msys2@v2
4474
with:
4575
msystem: MINGW32
4676
install: |
4777
base-devel git make texinfo flex bison patch binutils mpc-devel tar
48-
mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake
49-
mingw-w64-i686-make mingw-w64-i686-libogg
78+
mingw-w64-i686-readline mingw-w64-i686-gcc
79+
mingw-w64-i686-cmake mingw-w64-i686-make mingw-w64-i686-libogg
5080
update: true
5181

5282
- name: Runs all the stages in the shell
@@ -63,16 +93,17 @@ jobs:
6393
mipsel-none-elf-as --version
6494
mipsel-none-elf-ld --version
6595
mipsel-none-elf-gcc --version
66-
96+
6797
- name: Get short SHA
6898
id: slug
69-
run: printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
70-
71-
- name: Compress ps2dev folder
7299
run: |
73-
tar -zcvf ps2dev.tar.gz ps2dev
74-
100+
echo "sha8=${MSYSTEM}-sha[$(echo ${GITHUB_SHA} | cut -c1-8)]" >> $GITHUB_OUTPUT
101+
102+
- name: Prepare ps2dev folder
103+
run: |
104+
tar -zcvf ps2dev-${{matrix.target.machine}}.tar.gz ps2dev
105+
75106
- uses: actions/upload-artifact@v4
76107
with:
77-
name: ps2dev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}
78-
path: ps2dev.tar.gz
108+
name: ps2dev-${{matrix.target.machine}}-ps2dev-${{matrix.target.architecture}}-${{matrix.target.packageManager}}-${{ steps.slug.outputs.sha8 }}
109+
path: ps2dev-${{matrix.target.machine}}.tar.gz

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,48 @@ the ps2dev main page.
1111

1212
## Introduction
1313

14-
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.
14+
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.
15+
16+
### Supported platforms
17+
18+
- macOS (Intel and Apple Silicon) with Homebrew or MacPorts
19+
- Ubuntu (x86_64 and arm64)
20+
- Windows (MSYS2, MinGW32 environment)
1521

1622
## What these scripts do
1723

18-
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).
24+
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).
1925

2026
## Requirements
2127

22-
1. Install gcc/clang, make, patch, git, texinfo, bison, flex, libgmp3, libmpfr, and libmpc if you don't have those packages.
28+
1. Install gcc/clang, make, patch, git, and texinfo if you don't have those packages. Below are example commands per platform:
29+
30+
### macOS (Homebrew)
31+
```bash
32+
brew update
33+
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
34+
```
35+
36+
### macOS (MacPorts)
37+
Make sure MacPorts is installed first. Then:
38+
```bash
39+
sudo port selfupdate
40+
sudo port install gmp mpfr libmpc libiconv bison flex texinfo
41+
```
42+
43+
### Ubuntu
44+
```bash
45+
sudo apt-get update
46+
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
47+
```
48+
49+
### Windows (MSYS2 MinGW32)
50+
Use the MSYS2 MinGW32 shell and run:
51+
```bash
52+
pacman -S --noconfirm base-devel git make texinfo flex bison patch binutils mpc-devel tar \
53+
mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-make mingw-w64-i686-libogg
54+
```
55+
2356
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:
2457
```bash
2558
export PS2DEV=/usr/local/ps2dev
@@ -29,7 +62,6 @@ sudo chown -R $USER: $PS2DEV
2962
3. Add this to your login script (example: `~/.bash_profile`)
3063
```bash
3164
export PS2DEV=/usr/local/ps2dev
32-
export PS2SDK=$PS2DEV/ps2sdk
3365
export PATH=$PATH:$PS2DEV/iop/bin
3466
```
3567
4. Run toolchain.sh

scripts/001-binutils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if [ "$(uname -s)" = "Darwin" ]; then
4747
## Check if using MacPorts
4848
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
4949
echo Macport base is $MACPORT_BASE
50-
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE"
50+
TARG_XTRA_OPTS="--with-system-zlib --with-libiconv_prefix=$MACPORT_BASE --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
5151
fi
5252
fi
5353

scripts/002-gcc-stage1.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if [ "$(uname -s)" = "Darwin" ]; then
4848
## Check if using MacPorts
4949
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
5050
echo Macport base is $MACPORT_BASE
51-
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
51+
TARG_XTRA_OPTS="--with-system-zlib --with-libiconv_prefix=$MACPORT_BASE --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
5252
fi
5353
fi
5454

0 commit comments

Comments
 (0)