forked from schismtracker/schismtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (120 loc) · 5.22 KB
/
Copy pathos2.yml
File metadata and controls
137 lines (120 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: OS/2 (i386)
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: os2-i386
env:
SEZERO_SDL_COMMIT: 2524727b200e7888adf80804d45880a347861964
UTF8PROC_VERSION: 2.10.0
UTF8PROC_SHA256: 276a37dc4d1dd24d7896826a579f4439d1e5fe33603add786bb083cab802e23e
OPENWATCOM_VERSION: 2025-12-01
OPENWATCOM_SHA256: 73fe7329e582a7c5767eb66c78cfba174d2c9f20170150d43e9201f5ea5d038b
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
path: schism
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install --fix-missing automake autoconf make 7zip dos2unix
- name: 'Retrieve runner temp directory'
id: temp
run: |
cd schism
echo "temp=$RUNNER_TEMP" >> $GITHUB_OUTPUT
cd ..
# FIXME store this in RUNNER_TEMP instead
- name: 'Cache OpenWatcom'
id: cache-openwatcom
uses: actions/cache@v4
with:
path: '${{ steps.temp.outputs.temp }}/WATCOM'
key: os2-cache-openwatcom-linux-${{ env.OPENWATCOM_VERSION }}
- name: 'Cache dependencies'
id: cache-i386-dependencies
uses: actions/cache@v4
with:
path: '${{ steps.temp.outputs.temp }}/i386prefix'
key: os2-i386-dependencies-SEZEROSDL2_${{ env.SEZERO_SDL_COMMIT }}-UTF8PROC_${{ env.UTF8PROC_VERSION }}
# Grab OpenWatcom V2
- name: 'Setup OpenWatcom'
if: steps.cache-openwatcom.outputs.cache-hit != 'true'
run: |
wget -O openwatcom-install.exe "https://github.com/open-watcom/open-watcom-v2/releases/download/${OPENWATCOM_VERSION}-Build/open-watcom-2_0-c-linux-x64"
echo "$OPENWATCOM_SHA256 openwatcom-install.exe" | sha256sum -c -
7z x openwatcom-install.exe -o"$RUNNER_TEMP/WATCOM"
# eh, whatever
chmod +x $RUNNER_TEMP/WATCOM/binl64/*
- name: "Download sezero's SDL repo"
run: |
wget -O "sezero.tar.gz" "https://github.com/sezero/SDL2-OS2/archive/$SEZERO_SDL_COMMIT.tar.gz"
tar xvf "sezero.tar.gz"
mv "SDL2-OS2-$SEZERO_SDL_COMMIT" "$RUNNER_TEMP/i386prefix"
rm "sezero.tar.gz"
- name: 'Download utf8proc'
if: steps.cache-i386-dependencies.outputs.cache-hit != 'true'
run: |
wget -O "utf8proc-$UTF8PROC_VERSION.tar.gz" "https://github.com/JuliaStrings/utf8proc/releases/download/v$UTF8PROC_VERSION/utf8proc-$UTF8PROC_VERSION.tar.gz"
echo "$UTF8PROC_SHA256 utf8proc-$UTF8PROC_VERSION.tar.gz" | sha256sum -c -
tar xvf "utf8proc-$UTF8PROC_VERSION.tar.gz"
- name: 'Build utf8proc'
if: steps.cache-i386-dependencies.outputs.cache-hit != 'true'
run: |
export PATH="$RUNNER_TEMP/WATCOM/binl64:$PATH"
export WATCOM="$RUNNER_TEMP/WATCOM"
cd utf8proc-$UTF8PROC_VERSION
owcc -I"$RUNNER_TEMP/WATCOM/h" -O2 -za99 -fno-short-enum -march=i386 -mtune=i586 -c -o utf8proc.obj utf8proc.c
wlib -n utf8proc.lib utf8proc.obj
cp "utf8proc.lib" "$RUNNER_TEMP/i386prefix/lib"
cp "utf8proc.h" "$RUNNER_TEMP/i386prefix/h"
cd ..
# FIXME: we need to build and link FLAC...
- name: 'Get date of latest commit'
id: date
run: |
cd schism
echo "date=$(git log -n 1 --date=short --format=format:%cd | sed 's/\(....\)-\(..\)-\(..\).*/\1\2\3/')" >> $GITHUB_OUTPUT
cd ..
- name: 'autoreconf'
run: |
cd schism
autoreconf -i
cd ..
- name: 'Compile package'
run: |
export PATH="$RUNNER_TEMP/WATCOM/binl64:$PATH"
export WATCOM="$RUNNER_TEMP/WATCOM"
cd schism
mkdir build
cd build
../configure "CPP=owcc -E" "CPPFLAGS=-I$RUNNER_TEMP/WATCOM/h -I$RUNNER_TEMP/WATCOM/h/os2 -b OS2V2_PM" CC=owcc "CFLAGS=-b OS2V2_PM -O2 -za99 -fno-short-enum -march=i386 -mtune=i586 -mthreads" "LDFLAGS=-b OS2V2_PM" --host=i386-pc-os2 "OBJEXT=.obj" "EXEEXT=.exe" --without-jack --with-sdl2 --enable-sdl2-linking PKG_CONFIG=false SDL2_CFLAGS="-I$RUNNER_TEMP/i386prefix/h/SDL2" SDL2_LIBS="$RUNNER_TEMP/i386prefix/lib/SDL2.lib" UTF8PROC_CFLAGS="-I$RUNNER_TEMP/i386prefix/h" UTF8PROC_LIBS="$RUNNER_TEMP/i386prefix/lib/utf8proc.lib" || cat config.log
make
# stupid autoconf
mv schismtracker schismtracker.exe
wstrip schismtracker.exe
cp schismtracker.exe ../..
cd ../..
- name: 'Create package'
run: |
cp "$RUNNER_TEMP/i386prefix/dll/SDL2.dll" .
cp schism/docs/configuration.md schism/README.md schism/COPYING .
cp schism/icons/schism-icon-os2.ico schismtracker.ico
wget https://raw.githubusercontent.com/xiph/flac/master/COPYING.Xiph
unix2dos COPYING.Xiph COPYING README.md configuration.md
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: schismtracker-${{ steps.date.outputs.date }}-os2
path: |
schismtracker.exe
schismtracker.ico
SDL2.dll
COPYING
COPYING.Xiph
README.md
configuration.md