Skip to content

Commit

Permalink
Merge branch 'main' into addManualDispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter authored Oct 3, 2023
2 parents 0ee67e4 + 01e724a commit d2ee7de
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 28 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ${{ matrix.os[0] }}
strategy:
matrix:
os: [[macos-latest, bash], [macOS-11, bash], [ubuntu-latest, bash], [windows-latest, msys2]]
os: [[macos-latest, bash], [macOS-11, bash], [ubuntu-latest, bash]]
defaults:
run:
shell: ${{ matrix.os[1] }} {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install on Ubuntu
if: matrix.os[0] == 'ubuntu-latest'
Expand All @@ -32,15 +32,6 @@ jobs:
brew update
brew install gettext texinfo bison flex gnu-sed gsl gmp mpfr
- name: Install in MSYS2
if: matrix.os[0] == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: base-devel git make texinfo flex bison patch binutils mingw-w64-i686-gcc mingw-w64-i686-dlfcn mingw-w64-i686-mpc
update: true
shell: msys2 {0}

- name: Runs all stages
run: |
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
Expand All @@ -50,13 +41,13 @@ jobs:
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT

- name: Compress pspdev folder
run: |
tar -zcvf pspdev.tar.gz pspdev
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: pspdev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}
path: pspdev.tar.gz
Expand All @@ -68,7 +59,7 @@ jobs:
matrix:
os: [[ubuntu, bash], [fedora, bash]]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install dependencies Ubuntu
if: matrix.os[0] == 'ubuntu'
Expand All @@ -91,13 +82,13 @@ jobs:
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT

- name: Compress pspdev folder
run: |
tar -zcvf pspdev.tar.gz pspdev
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: pspdev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}
path: pspdev.tar.gz
path: pspdev.tar.gz
16 changes: 9 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
tags:
- v*
workflow_dispatch: {}
schedule:
- cron: 0 17 * * 5

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Extract DOCKER_TAG using tag name
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -26,19 +28,19 @@ jobs:
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Github registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }}
Expand All @@ -49,8 +51,8 @@ jobs:
echo "NEW_DISPATCH_ACTION=$DISPATCH_ACTION" >> $GITHUB_ENV
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
repository: ${{ github.repository_owner }}/psptoolchain
repository: ${{ github.repository_owner }}/psptoolchain-extra
token: ${{ secrets.DISPATCH_TOKEN }}
event-type: ${{ env.NEW_DISPATCH_ACTION }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# First stage
FROM alpine:latest
# Please change the alpine version back to latest after 3.19 releases
FROM alpine:3.16

ENV PSPDEV /usr/local/pspdev
ENV PATH $PATH:${PSPDEV}/bin
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# psptoolchain-allegrex

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pspdev/psptoolchain-allegrex/CI?label=CI&logo=github&style=for-the-badge)](https://github.com/pspdev/psptoolchain-allegrex/actions?query=workflow%3ACI)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pspdev/psptoolchain-allegrex/CI-Docker?label=CI-Docker&logo=github&style=for-the-badge)](https://github.com/pspdev/psptoolchain-allegrex/actions?query=workflow%3ACI-Docker)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/pspdev/psptoolchain-allegrex/compilation.yml?branch=main&label=CI&logo=github&style=for-the-badge)](https://github.com/pspdev/psptoolchain-allegrex/actions?query=workflow%3ACI)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/pspdev/psptoolchain-allegrex/docker.yml?branch=main&label=CI-Docker&logo=github&style=for-the-badge)](https://github.com/pspdev/psptoolchain-allegrex/actions?query=workflow%3ACI-Docker)

This program will automatically build and install a compiler and other tools used in the creation of homebrew software for the Sony Playstation Portable handheld videogame system (PSP).


## **ATENTION!**

If you're trying to install in your machine the **WHOLE PSP Development Environment** this is **NOT** the repo to use, you should use instead the [pspdev](https://github.com/pspdev/pspdev "pspdev") repo.
Expand All @@ -17,6 +18,7 @@ These scripts download (`git clone`) and install:
- [gdb](https://github.com/pspdev/binutils-gdb "gdb")
- [gcc](https://github.com/pspdev/gcc "gcc")
- [newlib](https://github.com/pspdev/newlib "newlib")
- [pthread-embedded](https://github.com/pspdev/pthread-embedded "pthread-embedded")

## Requirements

Expand Down
10 changes: 10 additions & 0 deletions scripts/001-binutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ PROC_NR=$(getconf _NPROCESSORS_ONLN)
## Create and enter the toolchain/build directory
rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET || { exit 1; }

## Build GDB without python support when built with a GitHub Action
## This makes the pre-build executable work on more systems
if [ -n "$CI" ]; then
WITH_PYTHON="no"
else
WITH_PYTHON="auto"
fi

## Configure the build.
../configure \
--quiet \
--prefix="$PSPDEV" \
--target="$TARGET" \
--enable-plugins \
--disable-initfini-array \
--with-python="$WITH_PYTHON" \
--disable-werror \
$TARG_XTRA_OPTS || { exit 1; }

Expand Down
1 change: 1 addition & 0 deletions scripts/002-gcc-stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ rm -rf mkdir build-$TARGET-stage1 && mkdir build-$TARGET-stage1 && cd build-$TAR
--with-float=hard \
--with-headers=no \
--without-newlib \
--disable-libatomic \
--disable-libssp \
--disable-multilib \
$TARG_XTRA_OPTS || { exit 1; }
Expand Down
4 changes: 3 additions & 1 deletion scripts/003-newlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Download the source code.
REPO_URL="https://github.com/pspdev/newlib.git"
REPO_FOLDER="newlib"
BRANCH_NAME="allegrex-v4.1.0"
BRANCH_NAME="allegrex-v4.3.0"
if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || { exit 1; }
else
Expand All @@ -23,6 +23,8 @@ rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET || { exit 1; }
../configure \
--prefix="$PSPDEV" \
--target="$TARGET" \
--enable-newlib-retargetable-locking \
--enable-newlib-io-c99-formats \
$TARG_XTRA_OPTS || { exit 1; }

## Compile and install.
Expand Down
25 changes: 25 additions & 0 deletions scripts/004-pthread-embedded.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# pthread-embedded.sh by Francisco Javier Trujillo Mata ([email protected])

## Download the source code.
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

TARGET="psp"

## Determine the maximum number of processes that Make can work with.
PROC_NR=$(getconf _NPROCESSORS_ONLN)

cd platform/psp || { exit 1; }

## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR all || { exit 1; }
make --quiet -j $PROC_NR install || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }
1 change: 1 addition & 0 deletions scripts/004-gcc-stage2.sh → scripts/005-gcc-stage2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rm -rf build-$TARGET-stage2 && mkdir build-$TARGET-stage2 && cd build-$TARGET-st
--disable-libssp \
--disable-multilib \
--enable-cxx-flags=-G0 \
--enable-threads=posix \
$TARG_XTRA_OPTS || { exit 1; }

## Compile and install.
Expand Down

0 comments on commit d2ee7de

Please sign in to comment.