forked from schismtracker/schismtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
367 lines (322 loc) · 22.3 KB
/
osx.yml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
name: OS X (powerpc/x86_64/arm64)
on:
push:
pull_request:
workflow_dispatch:
# The configure prefix for any given
# architecture is
# $HOME/{architecture}prefix
# while any specific files/binaries
# needed for that architecture, not
# necessarily related to autotools,
# should be stored in
# $HOME/{architecture}
# This is so that we don't screw
# up the global directories with
# files for many different
# architectures.
jobs:
osx:
runs-on: macos-14
env:
SDL_VERSION: 2.30.9
SDL_SHA256: 24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4
PANTHER_SDL2_VERSION: 20210624
PANTHER_SDL2_SHA256: 2d7fcbebedd3502f8454bb21f20c8d9cb332c4d0bba124f8be5cb5787beeaa54
FLAC_VERSION: 1.4.3
FLAC_SHA256: 6c58e69cd22348f441b861092b825e591d0b822e106de6eb0ee4d05d27205b70
LIBOGG_VERSION: 1.3.5
LIBOGG_SHA256: c4d91be36fc8e54deae7575241e03f4211eb102afb3fc0775fbbc1b740016705
UTF8PROC_VERSION: 2.9.0
UTF8PROC_SHA256: bd215d04313b5bc42c1abedbcb0a6574667e31acee1085543a232204e36384c4
steps:
- name: 'Install dependencies'
run: |
brew install autoconf automake libtool zip cmake wget
- name: 'Cache x86_64 dependencies'
id: cache-x86_64-dependencies
uses: actions/cache@v4
with:
path: '/Users/runner/x86_64prefix'
key: mac-x86_64-dependencies-SDL_${{ env.SDL_VERSION }}-FLAC_${{ env.FLAC_VERSION }}-LIBOGG_${{ env.LIBOGG_VERSION }}-UTF8PROC_${{ env.UTF8PROC_VERSION }}
- name: 'Cache x86_64 files'
id: cache-x86_64-files
uses: actions/cache@v4
with:
path: '/Users/runner/x86_64'
key: mac-x86_64-files
- name: 'Cache arm64 dependencies'
id: cache-arm64-dependencies
uses: actions/cache@v4
with:
path: '/Users/runner/arm64prefix'
key: mac-arm64-dependencies-SDL_${{ env.SDL_VERSION }}-FLAC_${{ env.FLAC_VERSION }}-LIBOGG_${{ env.LIBOGG_VERSION }}-UTF8PROC_${{ env.UTF8PROC_VERSION }}
- name: 'Cache arm64 files'
id: cache-arm64-files
uses: actions/cache@v4
with:
path: '/Users/runner/arm64'
key: mac-arm64-files
- name: 'Cache powerpc dependencies'
id: cache-powerpc-dependencies
uses: actions/cache@v4
with:
path: '/Users/runner/ppcprefix'
key: mac-powerpc-dependencies-FLAC_${{ env.FLAC_VERSION }}-LIBOGG_${{ env.LIBOGG_VERSION }}-UTF8PROC_${{ env.UTF8PROC_VERSION }}
- name: 'Cache powerpc files'
id: cache-powerpc-files
uses: actions/cache@v4
with:
path: '/Users/runner/ppc'
key: mac-powerpc-files
- name: 'Download 10.9 SDK for x86_64'
if: steps.cache-x86_64-files.outputs.cache-hit != 'true'
run: |
mkdir -p "$HOME/x86_64"
pushd "$HOME/x86_64"
mkdir SDKs
cd SDKs
curl -L "https://github.com/joseluisq/macosx-sdks/releases/download/10.9/MacOSX10.9.sdk.tar.xz" | tar -xvf -
popd
- name: 'Download 11.0 SDK for arm64'
if: steps.cache-arm64-files.outputs.cache-hit != 'true'
run: |
mkdir -p "$HOME/arm64"
pushd "$HOME/arm64"
mkdir SDKs
cd SDKs
curl -L "https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz" | tar -xvf -
popd
- name: 'Grab PowerPC cross compile binaries'
if: steps.cache-powerpc-files.outputs.cache-hit != 'true'
run: |
wget -O schism-macppc-bins.zip "https://www.dropbox.com/scl/fi/trq99fq51p13nh8tajpwa/schism-macppc-bins.zip?rlkey=xemvhpmm1ci0dnseawmanr749&st=c7jlwru4&dl=1"
unzip schism-macppc-bins.zip -d "schism-macppc-bins"
rm schism-macppc-bins.zip
pushd schism-macppc-bins
mkdir -p "$HOME/ppc/SDKs"
tar -xvf "Xcode3as.tar.gz" -C "$HOME/ppc" &
tar -xvf "Xcode3gcc40.tar.gz" -C "$HOME/ppc" &
tar -xvf "Xcode3gcc42.tar.gz" -C "$HOME/ppc" &
tar -xvf "Xcode3ld.tar.gz" -C "$HOME/ppc" &
tar -xvf "OSX108INT.tar.gz" -C "$HOME/ppc" &
wait
curl -L "https://github.com/alexey-lysiuk/macos-sdk/releases/download/10.3.9/MacOSX10.3.9.tar.bz2" | tar -xvf - -C "$HOME/ppc/SDKs"
curl -L "https://github.com/alexey-lysiuk/macos-sdk/releases/download/10.5/MacOSX10.5.tar.bz2" | tar -xvf - -C "$HOME/ppc/SDKs"
popd
- name: 'Install PowerPC cross compile binaries into Xcode'
run: |
mkdir "$(xcrun xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/libexec/as/ppc"
cp "$HOME/ppc/usr/libexec/gcc/darwin/ppc/as" "$(xcrun xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/libexec/as/ppc/as"
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Get date of latest commit'
id: date
run: echo "date=$(git log -n 1 --date=short --format=format:%cd | sed 's/\(....\)-\(..\)-\(..\).*/\1\2\3/')" >> $GITHUB_OUTPUT
- name: 'Download SDL2 sources (powerpc)'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true'
run: |
wget -O "panther_sdl2-$PANTHER_SDL2_VERSION.tar.gz" "https://leopard.sh/dist/panther_sdl2-$PANTHER_SDL2_VERSION.tar.gz"
echo "$PANTHER_SDL2_SHA256 panther_sdl2-$PANTHER_SDL2_VERSION.tar.gz" | shasum -a 256 -c -
tar xvf "panther_sdl2-$PANTHER_SDL2_VERSION.tar.gz"
- name: 'Download SDL2 sources (x86_64/arm64)'
if: steps.cache-x86_64-dependencies.outputs.cache-hit != 'true' || steps.cache-arm64-dependencies.outputs.cache-hit != 'true'
run: |
wget -O "SDL2-$SDL_VERSION.tar.gz" https://www.libsdl.org/release/SDL2-$SDL_VERSION.tar.gz || wget -O "SDL2-$SDL_VERSION.tar.gz" https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL2-$SDL_VERSION.tar.gz
echo "$SDL_SHA256 SDL2-$SDL_VERSION.tar.gz" | shasum -a 256 -c -
tar xvf "SDL2-$SDL_VERSION.tar.gz"
# we don't actually build SDL2 on powerpc anymore, since it's locked to an old version
- name: 'Prepare SDL2 (powerpc)'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true'
run: |
export PATH="$PATH:$HOME/ppc/usr/bin"
pushd panther_sdl2-20210624
mkdir -p "$HOME/ppcprefix/include/SDL2"
mkdir -p "$HOME/ppcprefix/share/aclocal"
cp -r include/* "$HOME/ppcprefix/include/SDL2"
cp sdl2.m4 "$HOME/ppcprefix/share/aclocal"
wget -O sdl2.zip "https://www.dropbox.com/scl/fi/wesknb35a6ctha73t4vgg/sdl2.zip?rlkey=73l6n8682w63e09n8ods33z14&st=s4ipamr0&dl=1"
unzip sdl2.zip
rm sdl2.zip
mkdir -p "$HOME/ppcprefix/lib"
cp "libSDL2-2.0.0.dylib" "$HOME/ppcprefix/lib"
ln -sf "$HOME/ppcprefix/lib/libSDL2-2.0.0.dylib" "$HOME/ppcprefix/lib/libSDL2.dylib"
popd
- name: 'Build SDL2 (x86_64)'
if: steps.cache-x86_64-dependencies.outputs.cache-hit != 'true'
run: |
pushd SDL2-$SDL_VERSION
mkdir build_x86_64
cd build_x86_64
../configure CPPFLAGS="-arch x86_64 -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64 -F$HOME/x86_64/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -L/usr/lib -L/usr/lib/system -Wl,-syslibroot,$HOME/x86_64/SDKs/MacOSX10.9.sdk" --host=x86_64-apple-darwin13 --prefix="$HOME/x86_64prefix"
make
make install
popd
- name: 'Build SDL2 (arm64)'
if: steps.cache-arm64-dependencies.outputs.cache-hit != 'true'
run: |
pushd SDL2-$SDL_VERSION
mkdir build_arm64
cd build_arm64
../configure CPPFLAGS="-arch arm64 -mmacosx-version-min=11.0 -isysroot $HOME/arm64/SDKs/MacOSX11.0.sdk" CXXFLAGS="-arch arm64" CFLAGS="-arch arm64" LDFLAGS="-arch arm64" --host=aarch64-apple-darwin20 --prefix="$HOME/arm64prefix"
make
make install
popd
- name: 'Download and prepare libogg sources'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true' || steps.cache-x86_64-dependencies.outputs.cache-hit != 'true' || steps.cache-arm64-dependencies.outputs.cache-hit != 'true'
run: |
wget -O libogg-$LIBOGG_VERSION.tar.xz "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-$LIBOGG_VERSION.tar.xz" || wget -O libogg-$LIBOGG_VERSION.tar.xz "https://github.com/xiph/ogg/releases/download/v$LIBOGG_VERSION/libogg-$LIBOGG_VERSION.tar.xz"
echo "$LIBOGG_SHA256 libogg-$LIBOGG_VERSION.tar.xz" | shasum -a 256 -c -
tar xvf "libogg-$LIBOGG_VERSION.tar.xz"
pushd "libogg-$LIBOGG_VERSION"
# libogg's configure is too old
autoreconf -I"$HOME/x86_64prefix/share/aclocal" -i
popd
- name: 'Build libogg (powerpc)'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true'
run: |
pushd libogg-$LIBOGG_VERSION
export PATH="$PATH:$HOME/ppc/usr/bin"
mkdir build_powerpc
cd build_powerpc
../configure CC=powerpc-apple-darwin10-gcc-4.2.1 CPP=powerpc-apple-darwin10-cpp-4.2.1 OBJC=powerpc-apple-darwin10-gcc-4.2.1 CXX=powerpc-apple-darwin10-g++-4.2.1 CPPFLAGS="-I$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3 -isysroot $HOME/ppc/SDKs/MacOSX10.3.9.sdk -mmacosx-version-min=10.3" LDFLAGS="-F$HOME/ppc/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks -L$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/lib -L$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/lib/system -Wl,-syslibroot,$HOME/ppc/SDKs/MacOSX10.3.9.sdk" --host=powerpc-apple-darwin10 --prefix="$HOME/ppcprefix"
make
make install
popd
- name: 'Build libogg (x86_64)'
if: steps.cache-x86_64-dependencies.outputs.cache-hit != 'true'
run: |
pushd libogg-$LIBOGG_VERSION
mkdir build_x86_64
cd build_x86_64
../configure CPPFLAGS="-arch x86_64 -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64 -F$HOME/x86_64/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -L/usr/lib -L/usr/lib/system -Wl,-syslibroot,$HOME/x86_64/SDKs/MacOSX10.9.sdk" --host=x86_64-apple-darwin13 --prefix="$HOME/x86_64prefix"
make
make install
popd
- name: 'Build libogg (arm64)'
if: steps.cache-arm64-dependencies.outputs.cache-hit != 'true'
run: |
pushd libogg-$LIBOGG_VERSION
mkdir build_arm64
cd build_arm64
../configure CPPFLAGS="-arch arm64 -mmacosx-version-min=11.0 -isysroot $HOME/arm64/SDKs/MacOSX11.0.sdk" CFLAGS="-arch arm64" CXXFLAGS="-arch arm64" LDFLAGS="-arch arm64" --host=aarch64-apple-darwin20 --prefix="$HOME/arm64prefix"
make
make install
popd
- name: 'Download and prepare FLAC sources'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true' || steps.cache-x86_64-dependencies.outputs.cache-hit != 'true' || steps.cache-arm64-dependencies.outputs.cache-hit != 'true'
run: |
wget -O flac-$FLAC_VERSION.tar.xz "https://ftp.osuosl.org/pub/xiph/releases/flac/flac-$FLAC_VERSION.tar.xz" || wget -O flac-$FLAC_VERSION.tar.xz "https://github.com/xiph/flac/releases/download/$FLAC_VERSION/flac-$FLAC_VERSION.tar.xz"
echo "$FLAC_SHA256 flac-$FLAC_VERSION.tar.xz" | shasum -a 256 -c -
tar xvf "flac-$FLAC_VERSION.tar.xz"
pushd "flac-$FLAC_VERSION"
autoreconf -I"$HOME/x86_64prefix/share/aclocal" -i
popd
- name: 'Build FLAC (powerpc)'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true'
run: |
pushd flac-$FLAC_VERSION
export PATH="$PATH:$HOME/ppc/usr/bin"
mkdir build_powerpc
cd build_powerpc
../configure CC=powerpc-apple-darwin10-gcc-4.2.1 CPP=powerpc-apple-darwin10-cpp-4.2.1 OBJC=powerpc-apple-darwin10-gcc-4.2.1 CXX=powerpc-apple-darwin10-g++-4.2.1 CPPFLAGS="-I$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3 -isysroot $HOME/ppc/SDKs/MacOSX10.3.9.sdk -mmacosx-version-min=10.3" LDFLAGS="-F$HOME/ppc/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks -L$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/lib -L$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/lib/system -Wl,-syslibroot,$HOME/ppc/SDKs/MacOSX10.3.9.sdk" --host=powerpc-apple-darwin10 --prefix="$HOME/ppcprefix" --disable-cpplibs --disable-programs --disable-examples
make
make install
popd
- name: 'Build FLAC (x86_64)'
if: steps.cache-x86_64-dependencies.outputs.cache-hit != 'true'
run: |
pushd flac-$FLAC_VERSION
(export MACOSX_DEPLOYMENT_TARGET="10.9" && mkdir build_x86_64 && cd build_x86_64 && ../configure CPPFLAGS="-arch x86_64 -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64 -F$HOME/x86_64/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -L/usr/lib -L/usr/lib/system -Wl,-syslibroot,$HOME/x86_64/SDKs/MacOSX10.9.sdk" --host=x86_64-apple-darwin13 --prefix="$HOME/x86_64prefix" --disable-cpplibs --disable-programs --disable-examples && make && make install)
popd
- name: 'Build FLAC (arm64)'
if: steps.cache-arm64-dependencies.outputs.cache-hit != 'true'
run: |
pushd flac-$FLAC_VERSION
(export MACOSX_DEPLOYMENT_TARGET="11.0" && mkdir build_arm64 && cd build_arm64 && ../configure CPPFLAGS="-arch arm64 -mmacosx-version-min=11.0 -isysroot $HOME/arm64/SDKs/MacOSX11.0.sdk" CFLAGS="-arch arm64" CXXFLAGS="-arch arm64" LDFLAGS="-arch arm64" --host=aarch64-apple-darwin20 --prefix="$HOME/arm64prefix" --disable-cpplibs --disable-programs --disable-examples && make && make install)
popd
- name: 'Download utf8proc'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true' || steps.cache-x86_64-dependencies.outputs.cache-hit != 'true' || steps.cache-arm64-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" | shasum -a 256 -c -
tar xvf "utf8proc-$UTF8PROC_VERSION.tar.gz"
- name: 'Build utf8proc (powerpc)'
if: steps.cache-powerpc-dependencies.outputs.cache-hit != 'true'
run: |
pushd utf8proc-$UTF8PROC_VERSION
patch -p1 < ../.github/patches/utf8proc/2-fix-prefix.patch
export PATH="$PATH:$HOME/ppc/usr/bin"
make CC=powerpc-apple-darwin10-gcc-4.2.1 CFLAGS="-I$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3 -isysroot $HOME/ppc/SDKs/MacOSX10.3.9.sdk -mmacosx-version-min=10.3" LDFLAGS="-F$HOME/ppc/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks -L$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/lib -L$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/lib/system -Wl,-syslibroot,$HOME/ppc/SDKs/MacOSX10.3.9.sdk"
make install
patch -p1 -R < ../.github/patches/utf8proc/2-fix-prefix.patch
popd
- name: 'Build utf8proc (x86_64)'
if: steps.cache-x86_64-dependencies.outputs.cache-hit != 'true'
run: |
pushd utf8proc-$UTF8PROC_VERSION
patch -p1 < ../.github/patches/utf8proc/2-fix-prefix.patch
mkdir build_x86_64
cd build_x86_64
LDFLAGS="-F$HOME/x86_64/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -L/usr/lib -L/usr/lib/system -Wl,-syslibroot,$HOME/x86_64/SDKs/MacOSX10.9.sdk" cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$HOME/x86_64prefix" -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET="10.7" -DCMAKE_OSX_SYSROOT="$HOME/x86_64/SDKs/MacOSX10.9.sdk" -DBUILD_SHARED_LIBS=1
make
make install
patch -p1 -R < ../.github/patches/utf8proc/2-fix-prefix.patch
popd
- name: 'Build utf8proc (arm64)'
if: steps.cache-arm64-dependencies.outputs.cache-hit != 'true'
run: |
pushd utf8proc-$UTF8PROC_VERSION
mkdir build_arm64
cd build_arm64
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$HOME/arm64prefix" -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" -DCMAKE_OSX_SYSROOT="$HOME/arm64/SDKs/MacOSX11.0.sdk" -DBUILD_SHARED_LIBS=1
make
make install
popd
- name: 'Build Schism'
run: |
autoreconf -I"$HOME/x86_64prefix/share/aclocal" -i
(export PATH="$PATH:$HOME/ppc/usr/bin" && export PKG_CONFIG_PATH="$HOME/ppcprefix/lib/pkgconfig" && mkdir build_powerpc && cd build_powerpc && ../configure CC=powerpc-apple-darwin10-gcc-4.2.1 CPP=powerpc-apple-darwin10-cpp-4.2.1 OBJC=powerpc-apple-darwin10-gcc-4.2.1 CXX=powerpc-apple-darwin10-g++-4.2.1 CPPFLAGS="-I$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3 -isysroot $HOME/ppc/SDKs/MacOSX10.3.9.sdk -mmacosx-version-min=10.3" LDFLAGS="-L$HOME/ppcprefix/lib -lSDL2 -F$HOME/ppc/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks -L$HOME/ppc/SDKs/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 -L/usr/lib -L/usr/lib/system -Wl,-syslibroot,$HOME/ppc/SDKs/MacOSX10.3.9.sdk -L$HOME/ppc/SDKs/MacOSX10.5.sdk/usr/lib $HOME/ppc/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.1.dylib" SDL2_CFLAGS="-I$HOME/ppcprefix/include/SDL2" SDL2_LIBS="-L$HOME/ppcprefix/lib -lSDL2" --host=powerpc-apple-darwin10 --prefix="$HOME/ppcprefix" --with-sdl-prefix="$HOME/ppcprefix" --with-flac --without-sdl12 --enable-flac-linking --enable-sdl2-linking && make) &
(export MACOSX_DEPLOYMENT_TARGET="10.9" && export PKG_CONFIG_PATH="$HOME/x86_64prefix/lib/pkgconfig" && mkdir build_x86_64 && cd build_x86_64 && ../configure CPPFLAGS="-arch x86_64 -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64 -F$HOME/x86_64/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -L/usr/lib -L/usr/lib/system -Wl,-syslibroot,$HOME/x86_64/SDKs/MacOSX10.9.sdk" --host=x86_64-apple-darwin13 --prefix="$HOME/x86_64prefix" --with-sdl-prefix="$HOME/x86_64prefix" --with-flac --without-sdl12 --enable-flac-linking --enable-sdl2-linking && make && strip -S schismtracker) &
(export MACOSX_DEPLOYMENT_TARGET="11.0" && export PKG_CONFIG_PATH="$HOME/arm64prefix/lib/pkgconfig" && mkdir build_arm64 && cd build_arm64 && ../configure CPPFLAGS="-arch arm64 -mmacosx-version-min=11.0 -isysroot $HOME/arm64/SDKs/MacOSX11.0.sdk" OBJCFLAGS="-arch arm64" CFLAGS="-arch arm64" CXXFLAGS="-arch arm64" LDFLAGS="-arch arm64" --host=aarch64-apple-darwin20 --prefix="$HOME/arm64prefix" --with-sdl-prefix="$HOME/arm64prefix" --with-flac --without-sdl12 --enable-flac-linking --enable-sdl2-linking && make && make install) &
wait
cd ../..
- name: 'Package Schism'
run: |
for i in FLAC.12 ogg.0; do
"$HOME/ppc/usr/bin/install_name_tool" -change "$HOME/ppcprefix/lib/lib${i}.dylib" @executable_path/../Resources/lib${i}.dylib build_powerpc/schismtracker
install_name_tool -change "$HOME/x86_64prefix/lib/lib${i}.dylib" @executable_path/../Resources/lib${i}.dylib build_x86_64/schismtracker
install_name_tool -change "$HOME/arm64prefix/lib/lib${i}.dylib" @executable_path/../Resources/lib${i}.dylib build_arm64/schismtracker
done
# I wonder where I stole this SDL2 binary from :)
"$HOME/ppc/usr/bin/install_name_tool" -change "/Applications/PPCMC.app/lib/libSDL2-2.0.0.dylib" @executable_path/../Resources/libSDL2-2.0.0.dylib build_powerpc/schismtracker
install_name_tool -change "$HOME/x86_64prefix/lib/libSDL2-2.0.0.dylib" @executable_path/../Resources/libSDL2-2.0.0.dylib build_x86_64/schismtracker
install_name_tool -change "$HOME/arm64prefix/lib/libSDL2-2.0.0.dylib" @executable_path/../Resources/libSDL2-2.0.0.dylib build_arm64/schismtracker
"$HOME/ppc/usr/bin/install_name_tool" -change "$HOME/ppcprefix/lib/libutf8proc.3.dylib" @executable_path/../Resources/libutf8proc.3.dylib build_powerpc/schismtracker
install_name_tool -change "@rpath/libutf8proc.3.dylib" @executable_path/../Resources/libutf8proc.3.dylib build_x86_64/schismtracker
install_name_tool -change "@rpath/libutf8proc.3.dylib" @executable_path/../Resources/libutf8proc.3.dylib build_arm64/schismtracker
"$HOME/ppc/usr/bin/install_name_tool" -change "$HOME/ppcprefix/lib/libogg.0.dylib" @executable_path/../Resources/libogg.0.dylib "$HOME/ppcprefix/lib/libFLAC.12.dylib"
install_name_tool -change "$HOME/x86_64prefix/lib/libogg.0.dylib" @executable_path/../Resources/libogg.0.dylib "$HOME/x86_64prefix/lib/libFLAC.12.dylib"
install_name_tool -change "$HOME/arm64prefix/lib/libogg.0.dylib" @executable_path/../Resources/libogg.0.dylib "$HOME/arm64prefix/lib/libFLAC.12.dylib"
# powerpc specific crap
"$HOME/ppc/usr/bin/install_name_tool" -change "$HOME/ppc/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.1.dylib" @executable_path/../Resources/libgcc_s.1.dylib build_powerpc/schismtracker
lipo -create -o schismtracker build_powerpc/schismtracker build_x86_64/schismtracker build_arm64/schismtracker
cd sys/macosx/Schism_Tracker.app/Contents/
sed -i .bak "s;<string>CFBundle.*Version.*</string>;<string>$(date +%Y%m%d)</string>;" Info.plist
rm Info.plist.bak
mkdir MacOS
cp ../../../../schismtracker MacOS
for i in SDL2-2.0.0 FLAC.12 ogg.0 utf8proc.3; do
lipo -create -o "Resources/lib${i}.dylib" "$HOME/x86_64prefix/lib/lib${i}.dylib" "$HOME/ppcprefix/lib/lib${i}.dylib" "$HOME/arm64prefix/lib/lib${i}.dylib"
done
cp "$HOME/ppc/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.1.dylib" "Resources/libgcc_s.1.dylib"
cd ../../../..
cp -r sys/macosx/Schism_Tracker.app Schism\ Tracker.app
cp docs/configuration.md .
wget https://raw.githubusercontent.com/xiph/flac/master/COPYING.Xiph
zip -r schismtracker.zip configuration.md COPYING COPYING.Xiph README.md Schism\ Tracker.app
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: schismtracker-${{ steps.date.outputs.date }}-macos
path: schismtracker.zip