From 9b204f86c918ed77f23a33b5baf94c5174554b8d Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Mon, 18 May 2026 19:53:15 +0200 Subject: [PATCH] Add masp and openvcl --- .github/workflows/compilation.yml | 4 +-- config/ps2toolchain-dvp-config.sh | 6 +++++ scripts/002-masp.sh | 42 +++++++++++++++++++++++++++++++ scripts/003-openvcl.sh | 42 +++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100755 scripts/002-masp.sh create mode 100755 scripts/003-openvcl.sh diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 42e955d..5db7071 100755 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -94,7 +94,7 @@ jobs: run: | curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci . ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync - sudo port install gsl gmp mpfr libmpc libiconv bison flex gsed texinfo autoconf automake libtool md5sha1sum wget curl + sudo port install gsl gmp mpfr libmpc libiconv bison flex gsed texinfo autoconf automake libtool md5sha1sum wget curl cmake - name: Install MSYS2 packages if: startsWith(matrix.os.runs-on, 'windows') @@ -105,7 +105,7 @@ jobs: base-devel git make texinfo flex bison patch binutils mpc-devel tar wget curl autotools gettext gettext-devel mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake - mingw-w64-i686-make mingw-w64-i686-libogg + mingw-w64-i686-make mingw-w64-i686-libogg mingw-w64-i686-libgnurx update: true - name: Runs all the stages in the shell diff --git a/config/ps2toolchain-dvp-config.sh b/config/ps2toolchain-dvp-config.sh index 1d1fdb1..12eb13d 100644 --- a/config/ps2toolchain-dvp-config.sh +++ b/config/ps2toolchain-dvp-config.sh @@ -3,6 +3,12 @@ PS2TOOLCHAIN_DVP_BINUTILS_REPO_URL="https://github.com/ps2dev/binutils-gdb.git" PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.45.1" +PS2TOOLCHAIN_DVP_MASP_REPO_URL="https://github.com/ps2dev/masp.git" +PS2TOOLCHAIN_DVP_MASP_DEFAULT_REPO_REF="v0.1.16" + +PS2TOOLCHAIN_DVP_OPENVCL_REPO_URL="https://github.com/ps2dev/openvcl.git" +PS2TOOLCHAIN_DVP_OPENVCL_DEFAULT_REPO_REF="v0.4.0" + if test -f "$PS2DEV_CONFIG_OVERRIDE"; then source "$PS2DEV_CONFIG_OVERRIDE" fi diff --git a/scripts/002-masp.sh b/scripts/002-masp.sh new file mode 100755 index 0000000..7b7dd14 --- /dev/null +++ b/scripts/002-masp.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# 002-masp.sh by ps2dev developers + +## Exit with code 1 when any command executed returns a non-zero exit code. +onerr() +{ + exit 1; +} +trap onerr ERR + +## Read information from the configuration file. +source "$(dirname "$0")/../config/ps2toolchain-dvp-config.sh" + +## Download the source code. +REPO_URL="$PS2TOOLCHAIN_DVP_MASP_REPO_URL" +REPO_REF="$PS2TOOLCHAIN_DVP_MASP_DEFAULT_REPO_REF" +REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")" + +# Checking if a specific Git reference has been passed in parameter $1 +if test -n "$1"; then + REPO_REF="$1" + printf 'Using specified repo reference %s\n' "$REPO_REF" +fi + +if test ! -d "$REPO_FOLDER"; then + git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER" +else + git -C "$REPO_FOLDER" remote set-url origin "$REPO_URL" + git -C "$REPO_FOLDER" fetch origin "$REPO_REF" --depth=1 + git -C "$REPO_FOLDER" checkout -f "$REPO_REF" +fi + +## Determine the maximum number of processes that Make can work with. +PROC_NR=$(getconf _NPROCESSORS_ONLN) + +## Configure, build, and install. +cmake -S "$REPO_FOLDER" -B "$REPO_FOLDER/build" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$PS2DEV" \ + -DBUILD_TESTING=OFF +cmake --build "$REPO_FOLDER/build" -j "$PROC_NR" +cmake --install "$REPO_FOLDER/build" diff --git a/scripts/003-openvcl.sh b/scripts/003-openvcl.sh new file mode 100755 index 0000000..f98bc6e --- /dev/null +++ b/scripts/003-openvcl.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# 003-openvcl.sh by ps2dev developers + +## Exit with code 1 when any command executed returns a non-zero exit code. +onerr() +{ + exit 1; +} +trap onerr ERR + +## Read information from the configuration file. +source "$(dirname "$0")/../config/ps2toolchain-dvp-config.sh" + +## Download the source code. +REPO_URL="$PS2TOOLCHAIN_DVP_OPENVCL_REPO_URL" +REPO_REF="$PS2TOOLCHAIN_DVP_OPENVCL_DEFAULT_REPO_REF" +REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")" + +# Checking if a specific Git reference has been passed in parameter $1 +if test -n "$1"; then + REPO_REF="$1" + printf 'Using specified repo reference %s\n' "$REPO_REF" +fi + +if test ! -d "$REPO_FOLDER"; then + git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER" +else + git -C "$REPO_FOLDER" remote set-url origin "$REPO_URL" + git -C "$REPO_FOLDER" fetch origin "$REPO_REF" --depth=1 + git -C "$REPO_FOLDER" checkout -f "$REPO_REF" +fi + +## Determine the maximum number of processes that Make can work with. +PROC_NR=$(getconf _NPROCESSORS_ONLN) + +## Configure, build, and install. +cmake -S "$REPO_FOLDER" -B "$REPO_FOLDER/build" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$PS2DEV" \ + -DBUILD_TESTING=OFF +cmake --build "$REPO_FOLDER/build" -j "$PROC_NR" +cmake --install "$REPO_FOLDER/build"