Skip to content

Commit

Permalink
Build script fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDisk committed Dec 13, 2023
1 parent 18e311f commit 61b3860
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,24 @@ jobs:
yasm
- name: Compile FFmpeg
if: matrix.name == 'Windows'
shell: msys2 {0}
shell: ${{ (matrix.name == 'Windows') && 'msys2 {0}' || 'bash' }}
run: |
# HACK: MacOS 12 doesn't have realpath. 13 does, but GH Actions don't have it in non-beta yet.
_realpath() {
cd "$(dirname "$0")" ; pwd -P
}
curl -Lo lame.tar.gz 'https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz'
tar xf lame.tar.gz
pushd lame-3.100
./configure --prefix="`realpath ..`/lame-install" --disable-dependency-tracking --disable-shared --enable-nasm --disable-gtktest --disable-decoder --disable-frontend
./configure --prefix="`_realpath ..`/lame-install" --disable-dependency-tracking --disable-shared --enable-nasm --disable-gtktest --disable-decoder --disable-frontend
make
make install
popd
curl -Lo ffmpeg.tar.xz 'http://ffmpeg.org/releases/ffmpeg-4.4.tar.xz'
tar xf ffmpeg.tar.xz
cd ffmpeg-4.4
./configure --extra-ldflags="-static" --disable-debug --enable-lto --disable-programs --enable-ffmpeg --disable-doc --disable-everything --enable-protocol=pipe --enable-protocol=file --enable-filter=aresample --enable-decoder=pcm_f32le --enable-demuxer=pcm_f32le --enable-encoder=flac --enable-muxer=ogg --enable-muxer=flac --enable-encoder=pcm_s16le --enable-muxer=wav --enable-libmp3lame --enable-encoder=libmp3lame --enable-muxer=mp3 --extra-cflags="-I`realpath ../lame-install/include`" --extra-ldflags="-L`realpath ../lame-install/lib`"
./configure --extra-ldflags="-static" --disable-debug --enable-lto --disable-programs --enable-ffmpeg --disable-doc --disable-everything --enable-protocol=pipe --enable-protocol=file --enable-filter=aresample --enable-decoder=pcm_f32le --enable-demuxer=pcm_f32le --enable-encoder=flac --enable-muxer=ogg --enable-muxer=flac --enable-encoder=pcm_s16le --enable-muxer=wav --enable-libmp3lame --enable-encoder=libmp3lame --enable-muxer=mp3 --extra-cflags="-I`_realpath ../lame-install/include`" --extra-ldflags="-L`_realpath ../lame-install/lib`"
make
- name: Check out hUGETracker
Expand Down Expand Up @@ -131,14 +135,24 @@ jobs:
mv packaging/sample-songs "packaging/Sample Songs"
mv packaging/keymaps "packaging/Keymaps"
- name: Extra Windows packaging
if: matrix.name == 'Windows'
shell: bash
run: |
unzip -d packaging sdl2.zip SDL2.dll
cp -v ffmpeg-4.4/ffmpeg.exe rgbds/* packaging
- name: Extra Mac packaging
if: matrix.name == 'Mac'
shell: bash
run: |
cp -Rpv hUGETracker/src/Release/hUGETracker.app packaging
cp -v hUGETracker/graphics/hUGETracker.icns packaging/hUGETracker.app/Contents/Resources
mv packaging/{halt.gb,halt.sym,hUGEDriver,PixeliteTTF.ttf} packaging/hUGETracker.app/Contents/Resources/
mv packaging/{halt.gb,halt.sym,hUGEDriver,PixeliteTTF.ttf} packaging/hUGETracker.app/Contents/Resources
for f in asm link fix; do ln -s `which rgb$f` packaging/hUGETracker.app/Contents/MacOS/rgb$f; done
cp -v ffmpeg-4.4/ffmpeg packaging/hUGETracker.app/Contents/MacOS
# Hacky, but unlikely to break any time soon.
ed packaging/hUGETracker.app/Contents/Info.plist << END
5i
<key>CFBundleIconFile</key>
Expand All @@ -148,16 +162,12 @@ jobs:
q
END
- name: Extra Windows packaging
if: matrix.name == 'Windows'
- name: Zip files (preserving permissions)
shell: bash
run: |
unzip -d packaging sdl2.zip SDL2.dll
cp -v ffmpeg-4.4/ffmpeg.exe rgbds/* packaging
run: zip -r build.zip packaging/*

- name: Store build
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }} build
path: packaging/
path: build.zip

0 comments on commit 61b3860

Please sign in to comment.