Skip to content

Commit

Permalink
PSP: Toolchain upgrade
Browse files Browse the repository at this point in the history
Check that all commands apply correctly
  • Loading branch information
lephilousophe committed Apr 18, 2022
1 parent c2432e4 commit 7b35fdc
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 62 deletions.
5 changes: 5 additions & 0 deletions check-versions/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@
'repository': 'https://github.com/pspdev/newlib.git',
'branch': 'allegrex-v4.1.0',
},
('./toolchains/psp/packages/toolchain/build.sh', 'PTHREAD_EMBEDDED'): {
'check': 'git commit',
'repository': 'https://github.com/pspdev/pthread-embedded.git',
'branch': 'psp',
},
('./toolchains/psp/packages/toolchain/build.sh', 'PSP_PACMAN'): {
'check': 'git commit',
'repository': 'https://github.com/pspdev/psp-pacman.git',
Expand Down
2 changes: 1 addition & 1 deletion toolchains/psp/packages/psp-packages/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

PSP_PACKAGES_VERSION=205a0533728de246573aaa4f91ef79ea1ce6e565
PSP_PACKAGES_VERSION=07eb25cd44b2e79f93c6f7d20e5f47edd346210f

PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
HELPERS_DIR=$PACKAGE_DIR/../..
Expand Down
15 changes: 8 additions & 7 deletions toolchains/psp/packages/toolchain/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#! /bin/sh

PSPDEV_VERSION=9af210e25b3e83dcad57b26985b437146efef97a
export PSPTOOLCHAIN_VERSION=005d3c43f3a4628284105c71e95937f5e2916f60
export PSPSDK_VERSION=aa211afe19acd5c178b1d8fb45fb4076237cbe9f
export PSPLINKUSB_VERSION=dbf5b94dd973dc49ee28d596a03c1362bcbce9e3
PSPDEV_VERSION=cfe25023fcc8400ca5c48bbd02f90afe6c949444
export PSPTOOLCHAIN_VERSION=f63dad313d48b30cbc04fdc0efbbe451de018198
export PSPSDK_VERSION=59ce20b7f76e3236309f0130dc0aae9f0624ad31
export PSPLINKUSB_VERSION=f60bf725702333615bb2ab221f9165f74cb902c3
export EBOOTSIGNER_VERSION=10cfbb51ea87adfe02d63dc3a262c8480fdf31e7
export PSPTOOLCHAIN_ALLEGREX_VERSION=e042e2e4b5ae8e9377cc18cab2cc14e27a9135f0
export PSPTOOLCHAIN_ALLEGREX_VERSION=08f2043411320ae89acb29dc85efadf5545f212f
export PSPTOOLCHAIN_EXTRA_VERSION=880705e1993a43c8e0533e53e67bab6f3b57e202
export BINUTILS_VERSION=e9c864fd3776b1fef2e374568e47f442ec58c773
export GCC_VERSION=873f9ff28c1ce079d48ca53f845fe0c88fa6961b
export NEWLIB_VERSION=b9c77d5302e4bb56196127fed1ca06fb6ee75a01
export GCC_VERSION=65cf73279bb91ff72e5327dd1621c206f027f761
export NEWLIB_VERSION=034f72f6e21e211137d38ca4015a58c9ab82a369
export PTHREAD_EMBEDDED_VERSION=c7e2d5a7e810401174b0484979b6d29a2f1ab519
export PSP_PACMAN_VERSION=23e6b9389626a32336063e90c486aa4db73a74d7

PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
Expand Down
34 changes: 17 additions & 17 deletions toolchains/psp/packages/toolchain/patches/00_set_versions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ index 732e96a..babb6f8 100755
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$PSPTOOLCHAIN_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$PSPTOOLCHAIN_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }
+
+for p in "$PACKAGE_DIR/$REPO_FOLDER-patches"/*; do
+ patch -p1 < "$p"
+ patch -p1 < "$p" || { exit 1; }
+done

## Build and install.
Expand All @@ -41,10 +41,10 @@ index 629f3ac..fe11891 100755
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$PSPSDK_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$PSPSDK_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

## Determine the maximum number of processes that Make can work with.
PROC_NR=$(getconf _NPROCESSORS_ONLN)
Expand All @@ -64,10 +64,10 @@ index df7bce4..2dc9058 100755
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$PSPLINKUSB_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$PSPLINKUSB_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

## Determine the maximum number of processes that Make can work with.
PROC_NR=$(getconf _NPROCESSORS_ONLN)
Expand All @@ -87,10 +87,10 @@ index c6aff68..c79f456 100755
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$EBOOTSIGNER_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$EBOOTSIGNER_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

## Determine the maximum number of processes that Make can work with.
PROC_NR=$(getconf _NPROCESSORS_ONLN)
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ index f9a21a0..042b722 100755
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$BINUTILS_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$BINUTILS_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

TARGET="psp"
TARG_XTRA_OPTS=""
diff --git a/scripts/002-gcc-stage1.sh b/scripts/002-gcc-stage1.sh
index 9a11c50..d8e6eca 100755
index 457512b..4203245 100755
--- a/scripts/002-gcc-stage1.sh
+++ b/scripts/002-gcc-stage1.sh
@@ -4,12 +4,12 @@
## Download the source code.
REPO_URL="https://github.com/pspdev/gcc.git"
REPO_FOLDER="gcc"
-BRANCH_NAME="allegrex-v9.3.0"
-BRANCH_NAME="allegrex-v11.2.0"
-if test ! -d "$REPO_FOLDER"; then
- git clone --depth 1 -b $BRANCH_NAME $REPO_URL $REPO_FOLDER && cd $REPO_FOLDER || { exit 1; }
-else
- cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || { exit 1; }
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$GCC_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$GCC_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

TARGET="psp"
OSVER=$(uname)
Expand All @@ -60,29 +60,51 @@ index e30a362..6e2b4f3 100755
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$NEWLIB_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$NEWLIB_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

TARGET="psp"

diff --git a/scripts/004-gcc-stage2.sh b/scripts/004-gcc-stage2.sh
index 3a5dca3..f9abe8e 100755
--- a/scripts/004-gcc-stage2.sh
+++ b/scripts/004-gcc-stage2.sh
diff --git a/scripts/004-pthread-embedded.sh b/scripts/004-pthread-embedded.sh
index adb8efe..0cbd349 100755
--- a/scripts/004-pthread-embedded.sh
+++ b/scripts/004-pthread-embedded.sh
@@ -5,11 +5,12 @@
REPO_URL="https://github.com/pspdev/pthread-embedded.git"
REPO_FOLDER="pthread-embedded"
BRANCH_NAME="psp"
-if test ! -d "$REPO_FOLDER"; then
- git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || { exit 1; }
-else
- cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} && git checkout ${BRANCH_NAME} || { exit 1; }
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$PTHREAD_EMBEDDED_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

TARGET="psp"

diff --git a/scripts/005-gcc-stage2.sh b/scripts/005-gcc-stage2.sh
index 8c1fc82..5d5f836 100755
--- a/scripts/005-gcc-stage2.sh
+++ b/scripts/005-gcc-stage2.sh
@@ -4,12 +4,8 @@
## Download the source code.
REPO_URL="https://github.com/pspdev/gcc.git"
REPO_FOLDER="gcc"
-BRANCH_NAME="allegrex-v9.3.0"
-BRANCH_NAME="allegrex-v11.2.0"
-if test ! -d "$REPO_FOLDER"; then
- git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || { exit 1; }
-else
- cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || { exit 1; }
-fi
+
+cd $REPO_FOLDER
+cd $REPO_FOLDER || { exit 1; }

TARGET="psp"
OSVER=$(uname)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/scripts/002-psp-pacman.sh b/scripts/002-psp-pacman.sh
diff --git a/scripts/001-psp-pacman.sh b/scripts/001-psp-pacman.sh
index 2bc237f..8616834 100755
--- a/scripts/002-psp-pacman.sh
+++ b/scripts/002-psp-pacman.sh
--- a/scripts/001-psp-pacman.sh
+++ b/scripts/001-psp-pacman.sh
@@ -4,12 +4,12 @@
## Download the source code.
REPO_URL="https://github.com/pspdev/psp-pacman"
Expand All @@ -14,10 +14,10 @@ index 2bc237f..8616834 100755
-fi
+
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$PSP_PACMAN_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$PSP_PACMAN_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

## Determine the maximum number of processes that Make can work with.
PROC_NR=$(getconf _NPROCESSORS_ONLN)
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ index 096b094..47ec86e 100755
-[ -z "$1" ] && REPO_REFERENCE="main" || REPO_REFERENCE=$1
-echo "Using repo reference $REPO_REFERENCE"
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$PSPTOOLCHAIN_ALLEGREX_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$PSPTOOLCHAIN_ALLEGREX_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

-if test ! -d "$REPO_FOLDER"; then
- git clone $REPO_URL -b "${REPO_REFERENCE}" || exit 1
-fi
-cd "$REPO_FOLDER" && git fetch origin && git reset --hard "origin/${REPO_REFERENCE}" && git checkout "${REPO_REFERENCE}" || exit 1
+for p in "$PACKAGE_DIR/$REPO_FOLDER-patches"/*; do
+ patch -p1 < "$p"
+ patch -p1 < "$p" || { exit 1; }
+done

## Build and install.
Expand All @@ -37,17 +37,17 @@ index ab89aee..5d5ec20 100755
-[ -z "$1" ] && REPO_REFERENCE="main" || REPO_REFERENCE=$1
-echo "Using repo reference $REPO_REFERENCE"
+mkdir "$REPO_FOLDER" && cd "$REPO_FOLDER"
+git init
+git remote add origin "$REPO_URL"
+git fetch --depth 1 origin "$PSPTOOLCHAIN_EXTRA_VERSION"
+git checkout FETCH_HEAD
+git init || { exit 1; }
+git remote add origin "$REPO_URL" || { exit 1; }
+git fetch --depth 1 origin "$PSPTOOLCHAIN_EXTRA_VERSION" || { exit 1; }
+git checkout FETCH_HEAD || { exit 1; }

-if test ! -d "$REPO_FOLDER"; then
- git clone $REPO_URL -b "${REPO_REFERENCE}" || exit 1
-fi
-cd "$REPO_FOLDER" && git fetch origin && git reset --hard "origin/${REPO_REFERENCE}" && git checkout "${REPO_REFERENCE}" || exit 1
+for p in "$PACKAGE_DIR/$REPO_FOLDER-patches"/*; do
+ patch -p1 < "$p"
+ patch -p1 < "$p" || { exit 1; }
+done

## Build and install.
Expand Down

0 comments on commit 7b35fdc

Please sign in to comment.