Skip to content

Commit

Permalink
Add support for mintelf toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
th-otto committed Apr 30, 2024
1 parent 2f9b861 commit 56a3c33
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,28 @@ jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
cpu_target: [ "000", "02060", "030", "040", "060", "col" ]
cross_tool: [ "m68k-atari-mint" ]
steps:
- uses: actions/checkout@v4
- name: Install SSH keys
if: ${{ github.event_name == 'push' }}
env:
SSH_ID: ${{ secrets.SSH_ID }}
run: ./.scripts/install_ssh_id.sh
- name: Install packages
run: |
SYSROOT_DIR="/" ./.scripts/install-freemint.sh binutils gcc mintbin
./.scripts/install-freemint.sh mintlib fdlibm gemlib cflib
./.scripts/install-hcp.sh
- name: Setup environment
env:
PROJECT_VERSION: "2.7"
CPU_TARGET: ${{ matrix.cpu_target }}
CROSS_TOOL: ${{ matrix.cross_tool }}
run: ./.scripts/setup_env.sh
- name: Install packages
run: |
SYSROOT_DIR="/" ./.scripts/install-freemint.sh binutils gcc mintbin
./.scripts/install-freemint.sh mintlib fdlibm gemlib cflib
./.scripts/install-hcp.sh
- name: build
run: ./.scripts/build.sh
- name: deploy
Expand Down
19 changes: 17 additions & 2 deletions .scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/bin/sh -x

[email protected]:/home/www/snapshots
[email protected]
UPLOAD_DIR=$SERVER:/home/www/snapshots

if [ -z "${DEPLOY_ARCHIVE+x}" ]
then
# zip is default
DEPLOY_ARCHIVE="zip"
fi

toolsuffix=${CROSS_TOOL##*-}

if [ -n "${CPU_TARGET+x}" ]
then
ARCHIVE_NAME="${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID}-${CPU_TARGET}.${DEPLOY_ARCHIVE}"
Expand Down Expand Up @@ -54,10 +57,22 @@ upload_file() {
exit 1
}

link_file() {
local from="$1"
local to="$2"
for i in 1 2 3
do
ssh -o "StrictHostKeyChecking no" $SERVER -- "cd www/snapshots/${PROJECT_DIR}; ln -sf $from $to"
[ $? = 0 ] && return 0
sleep 1
done
exit 1
}

upload_file "$ARCHIVE_PATH" "${UPLOAD_DIR}/${PROJECT_DIR}/${ARCHIVE_NAME}"
if test -z "${CPU_TARGET}"
then
upload_file "$ARCHIVE_PATH" "${UPLOAD_DIR}/${PROJECT_DIR}/${PROJECT_DIR}-latest.${DEPLOY_ARCHIVE}"
link_file "$ARCHIVE_NAME" "${PROJECT_DIR}-latest.${DEPLOY_ARCHIVE}"
fi

echo ${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID} > .latest_version
Expand Down
15 changes: 13 additions & 2 deletions .scripts/install-freemint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@
# -x: Display expanded script commands

DOWNLOAD_DIR=http://tho-otto.de/snapshots
SYSROOT_DIR=${SYSROOT_DIR:-"/usr/m68k-atari-mint/sys-root/usr"}
SYSROOT_DIR=${SYSROOT_DIR:-"/usr/${CROSS_TOOL}/sys-root"}

sudo mkdir -p "${SYSROOT_DIR}" && cd "${SYSROOT_DIR}"

toolsuffix=${CROSS_TOOL##*-}

for package in $*
do
wget -q -O - "$DOWNLOAD_DIR/${package}/${package}-latest.tar.bz2" | sudo tar xjf -
# for gcc and binutils, use stable current, not experimental latest build
case $package in
gcc | binutils)
filename=${package}-${toolsuffix}-current.tar.bz2
;;
*)
filename=${package}-${toolsuffix}-latest.tar.bz2
;;
esac
wget -q -O - "$DOWNLOAD_DIR/${package}/${filename}" | sudo tar xjf -
done
2 changes: 2 additions & 0 deletions .scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ BRANCH=$(echo "${GITHUB_REF}" | cut -d '/' -f 3)
if test "$CPU_TARGET" != ""; then
echo "CPU_TARGET=$CPU_TARGET" >> $GITHUB_ENV
fi
CROSS_TOOL=${CROSS_TOOL:-m68k-atari-mint}
echo "CROSS_TOOL=$CROSS_TOOL" >> $GITHUB_ENV

# GITHUB_HEAD_REF is only set for pull requests
if [ "${GITHUB_HEAD_REF}" = "" ]
Expand Down

0 comments on commit 56a3c33

Please sign in to comment.