Skip to content

Commit 2806366

Browse files
authored
Merge pull request #24 from fjtrujy/increasePlatformSupport
Increasing binutils and upgrading CI/CD
2 parents a01971b + 71072ce commit 2806366

File tree

5 files changed

+93
-24
lines changed

5 files changed

+93
-24
lines changed

.github/workflows/compilation.yml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,67 @@ 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
28-
with:
29-
fetch-depth: 0
3051

3152
- name: Install Ubuntu packages
32-
if: matrix.os[0] == 'ubuntu-latest'
53+
if: startsWith(matrix.target.machine, 'ubuntu')
3354
run: |
3455
sudo apt-get update
3556
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
3657
37-
- name: Install macOS packages
38-
if: startsWith(matrix.os[0], 'macos')
58+
- name: Install macOS packages with brew
59+
if: startsWith(matrix.target.machine, 'macos') && matrix.target.packageManager == 'brew'
3960
run: |
4061
brew update
4162
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
4263
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+
4371
- name: Install MSYS2 packages
44-
if: matrix.os[0] == 'windows-latest'
72+
if: startsWith(matrix.target.machine, 'windows')
4573
uses: msys2/setup-msys2@v2
4674
with:
4775
msystem: MINGW32
@@ -63,3 +91,17 @@ jobs:
6391
export PS2DEV=$PWD/ps2dev
6492
export PATH=$PATH:$PS2DEV/dvp/bin
6593
dvp-as --version
94+
95+
- name: Get short SHA
96+
id: slug
97+
run: |
98+
echo "sha8=${MSYSTEM}-sha[$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
99+
100+
- name: Prepare ps2dev folder
101+
run: |
102+
tar -zcvf ps2dev-${{matrix.target.machine}}.tar.gz ps2dev
103+
104+
- uses: actions/upload-artifact@v4
105+
with:
106+
name: ps2dev-${{matrix.target.machine}}-ps2dev-${{matrix.target.architecture}}-${{matrix.target.packageManager}}-${{ steps.slug.outputs.sha8 }}
107+
path: ps2dev-${{matrix.target.machine}}.tar.gz

.github/workflows/docker.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ jobs:
2929
run: |
3030
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
3131
32-
- name: Set up QEMU
33-
uses: docker/setup-qemu-action@v3
34-
35-
- name: Set up Docker Buildx
36-
uses: docker/setup-buildx-action@v3
37-
3832
- name: Login to DockerHub
3933
uses: docker/login-action@v3
4034
if: env.DOCKER_USERNAME != null

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,46 @@ the ps2dev main page.
1313

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

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)
21+
1622
## What these scripts do
1723

18-
These scripts download (with `git clone`) and install [binutils 2.14](http://www.gnu.org/software/binutils/ "binutils") (dvp).
24+
These scripts download (with `git clone`) and install [binutils 2.45.0](http://www.gnu.org/software/binutils/ "binutils") (dvp).
1925

2026
## Requirements
2127

22-
1. Install gcc/clang, make, patch, git, and texinfo 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

config/ps2toolchain-dvp-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
PS2TOOLCHAIN_DVP_BINUTILS_REPO_URL="https://github.com/ps2dev/binutils-gdb.git"
4-
PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.44.0"
4+
PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.45.0"
55

66
if test -f "$PS2DEV_CONFIG_OVERRIDE"; then
77
source "$PS2DEV_CONFIG_OVERRIDE"

scripts/001-binutils.sh

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

0 commit comments

Comments
 (0)