Skip to content

Commit 484a8dd

Browse files
authored
Merge pull request #12 from uyjulian/buildsystem_improve
Buildsystem improvements
2 parents 61e7293 + c4f125d commit 484a8dd

File tree

3 files changed

+49
-15
lines changed

3 files changed

+49
-15
lines changed

.github/workflows/compilation.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,58 @@ on:
55
pull_request:
66
repository_dispatch:
77
types: [run_build, run_release]
8+
workflow_dispatch: {}
89

910
jobs:
1011
build:
1112
runs-on: ${{ matrix.os[0] }}
1213
strategy:
1314
matrix:
1415
os: [[macos-latest, bash], [ubuntu-latest, bash], [windows-latest, msys2]]
16+
fail-fast: false
1517
defaults:
1618
run:
1719
shell: ${{ matrix.os[1] }} {0}
1820

1921
steps:
20-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
2125

22-
- name: Install Ubuntu texinfo bison flex
26+
- name: Install Ubuntu packages
2327
if: matrix.os[0] == 'ubuntu-latest'
2428
run: |
2529
sudo apt-get update
26-
sudo apt-get -y install texinfo bison flex gettext
30+
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
31+
echo "MSYSTEM=x64" >> $GITHUB_ENV
2732
28-
- name: Install Mac texinfo bison flex
29-
if: matrix.os[0] == 'macOS-latest'
33+
- name: Install macOS packages
34+
if: matrix.os[0] == 'macos-latest'
3035
run: |
3136
brew update
32-
brew install texinfo bison flex
37+
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
38+
echo "MSYSTEM=x64" >> $GITHUB_ENV
3339
34-
- name: Install MSYS2 texinfo bison flex
40+
- name: Install MSYS2 packages
3541
if: matrix.os[0] == 'windows-latest'
3642
uses: msys2/setup-msys2@v2
3743
with:
3844
msystem: MINGW32
39-
install: git make texinfo flex bison patch binutils mingw-w64-i686-gcc
45+
install: |
46+
base-devel git make texinfo flex bison patch binutils mingw-w64-i686-gcc mpc-devel tar
47+
mingw-w64-i686-cmake mingw-w64-i686-extra-cmake-modules mingw-w64-i686-make mingw-w64-i686-libogg
4048
update: true
4149
shell: msys2 {0}
4250

4351
- name: Runs all the stages in the shell
52+
continue-on-error: false
4453
run: |
4554
export PS2DEV=$PWD/ps2dev
4655
export PATH=$PATH:$PS2DEV/dvp/bin
4756
./toolchain.sh
57+
58+
- name: Print version of executables
59+
run: |
60+
export PS2DEV=$PWD/ps2dev
61+
export PATH=$PATH:$PS2DEV/dvp/bin
62+
dvp-as --version

config/ps2toolchain-dvp-config.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
PS2TOOLCHAIN_DVP_BINUTILS_REPO_URL="https://github.com/ps2dev/binutils-gdb.git"
4+
PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.14"
5+
6+
if test -f "$PS2DEV_CONFIG_OVERRIDE"; then
7+
source "$PS2DEV_CONFIG_OVERRIDE"
8+
fi

scripts/001-binutils.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# binutils-2.14.sh by Francisco Javier Trujillo Mata ([email protected])
2+
# 001-binutils.sh by ps2dev developers
33

44
## Exit with code 1 when any command executed returns a non-zero exit code.
55
onerr()
@@ -8,17 +8,28 @@ onerr()
88
}
99
trap onerr ERR
1010

11+
## Read information from the configuration file.
12+
source "$(dirname "$0")/../config/ps2toolchain-dvp-config.sh"
13+
1114
## Download the source code.
12-
REPO_URL="https://github.com/ps2dev/binutils-gdb.git"
13-
REPO_FOLDER="binutils-gdb"
14-
BRANCH_NAME="dvp-v2.14"
15+
REPO_URL="$PS2TOOLCHAIN_DVP_BINUTILS_REPO_URL"
16+
REPO_REF="$PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF"
17+
REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")"
18+
19+
# Checking if a specific Git reference has been passed in parameter $1
20+
if test -n "$1"; then
21+
REPO_REF="$1"
22+
printf 'Using specified repo reference %s\n' "$REPO_REF"
23+
fi
24+
1525
if test ! -d "$REPO_FOLDER"; then
16-
git clone --depth 1 -b "$BRANCH_NAME" "$REPO_URL"
26+
git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER"
1727
else
1828
git -C "$REPO_FOLDER" fetch origin
19-
git -C "$REPO_FOLDER" reset --hard "origin/${BRANCH_NAME}"
20-
git -C "$REPO_FOLDER" checkout "$BRANCH_NAME"
29+
git -C "$REPO_FOLDER" reset --hard "origin/$REPO_REF"
30+
git -C "$REPO_FOLDER" checkout "$REPO_REF"
2131
fi
32+
2233
cd "$REPO_FOLDER"
2334

2435
TARGET_ALIAS="dvp"

0 commit comments

Comments
 (0)