forked from KranX/Vangers
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
425 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,179 @@ | ||
name: Vangers MacOS Build | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
MACOSX_DEPLOYMENT_TARGET: 11 | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-11 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# - name: update repos | ||
# run: | | ||
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | ||
# brew update | ||
- name: install libs | ||
run: | | ||
brew install ninja yasm dylibbundler | ||
- name: install our libs | ||
run: | | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: install libs | ||
run: | | ||
brew install ninja yasm dylibbundler | ||
- name: install our libs | ||
run: | | ||
# brew reinstall -s ./formulas/libsndfile.rb --force --verbose --debug | ||
# brew reinstall -s ./formulas/libogg.rb --force --verbose --debug | ||
# brew reinstall -s ./formulas/libvorbis.rb --force --verbose --debug | ||
# brew install -s ./formulas/sdl2.rb --force --verbose --debug | ||
# brew install -s ./formulas/sdl2_net.rb --force --verbose --debug | ||
brew install sdl2 sdl2_net libvorbis libogg libsndfile | ||
- name: clunk -- download lib | ||
run: git clone --depth 1 https://github.com/stalkerg/clunk.git clunk | ||
- name: clunk -- create build dir | ||
run: mkdir clunk/build | ||
- name: clunk -- build and install | ||
run: cmake -DCMAKE_INSTALL_PREFIX=/usr/local -G Ninja .. && ninja && sudo ninja install | ||
working-directory: clunk/build | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: 10.12 | ||
- name: ffmpeg -- download | ||
run: git clone --depth 1 --branch n4.2.3 https://git.ffmpeg.org/ffmpeg.git ffmpeg | ||
- name: ffmpeg -- configure | ||
run: ./configure --enable-shared --prefix=/usr/local | ||
--cc=clang | ||
--arch=x86_64 | ||
--cpu=westmere | ||
--disable-everything | ||
--enable-swscale | ||
--enable-zlib | ||
--enable-demuxer=avi,rawvideo | ||
--enable-decoder=png,rawvideo,h264 | ||
--enable-parser=png | ||
--enable-protocol=file | ||
--disable-d3d11va | ||
--disable-dxva2 | ||
--disable-avx | ||
--disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg | ||
--disable-static --disable-bzlib --disable-libopenjpeg --disable-iconv | ||
working-directory: ffmpeg | ||
- name: ffmpeg -- build and install | ||
run: | | ||
make -j4 | ||
sudo make install | ||
working-directory: ffmpeg | ||
- name: configure | ||
run: mkdir build && cd build && cmake -G Ninja .. | ||
- name: make | ||
run: ninja | ||
working-directory: build | ||
- name: vangers -- prepare release folder | ||
run: | | ||
mkdir Vangers.app/Contents/Frameworks | ||
mkdir Vangers.app/Contents/Libs | ||
cp -L /usr/local/lib/libSDL2-2.0.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libSDL2_net-2.0.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libogg.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libvorbis.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libvorbisfile.3.dylib Vangers.app/Contents/Libs/ | ||
cp clunk/build/libclunk.dylib Vangers.app/Contents/Libs/ | ||
cp build/src/vangers Vangers.app/Contents/MacOS/Vangers | ||
dylibbundler -x Vangers.app/Contents/MacOS/Vangers | ||
strip Vangers.app/Contents/MacOS/Vangers | ||
sudo chmod 777 Vangers.app/Contents/Libs/* | ||
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbis.0.dylib | ||
install_name_tool -change /usr/local/Cellar/libvorbis/1.3.6/lib/libvorbis.0.dylib "@executable_path/../Libs/libvorbis.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib | ||
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib | ||
mv Vangers.app/Contents/Libs/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/libavcodec.58.dylib | ||
mv Vangers.app/Contents/Libs/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/libavformat.58.dylib | ||
mv Vangers.app/Contents/Libs/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/libavutil.56.dylib | ||
install_name_tool -change "@executable_path/../libs/libavcodec.58.54.100.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "@executable_path/../libs/libavformat.58.29.100.dylib" "@executable_path/../Libs/libavformat.58.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "@executable_path/../libs/libavutil.56.31.100.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavcodec.58.dylib | ||
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib | ||
install_name_tool -change "/usr/local/lib/libavcodec.58.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib | ||
install_name_tool -change "/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib" "@executable_path/../Libs/libSDL2-2.0.0.dylib" Vangers.app/Contents/Libs/libSDL2_net-2.0.0.dylib | ||
tar -cvf Vangers.app.tar Vangers.app | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: Vangers.app.tar | ||
path: Vangers.app.tar | ||
- name: vange-rs -- install rustup | ||
if: steps.vange-rs-cache-build.outputs.cache-hit != 'true' | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: "stable" | ||
target: x86_64-apple-darwin | ||
default: true | ||
|
||
- name: vange-rs -- build | ||
if: steps.vange-rs-cache-build.outputs.cache-hit != 'true' | ||
run: cargo build --release | ||
working-directory: vange-rs/lib/ffi | ||
|
||
- name: clunk -- download | ||
run: | | ||
git clone --depth 1 https://github.com/stalkerg/clunk.git clunk | ||
echo "CLUNK_SHORT_COMMIT_SHA=$(git -C clunk rev-parse --short HEAD)" >> $GITHUB_ENV | ||
- name: clunk -- cache | ||
id: cache-clunk | ||
uses: actions/cache@v3 | ||
with: | ||
path: clunk/build | ||
key: macos-clunk-${{ env.CLUNK_SHORT_COMMIT_SHA }} | ||
|
||
- name: clunk -- create build dir | ||
if: steps.cache-clunk.outputs.cache-hit != 'true' | ||
run: mkdir clunk/build | ||
|
||
- name: clunk -- build | ||
working-directory: clunk/build | ||
if: steps.cache-clunk.outputs.cache-hit != 'true' | ||
run: | | ||
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -G Ninja .. | ||
ninja | ||
- name: clunk -- install | ||
working-directory: clunk/build | ||
run: sudo ninja install | ||
|
||
- name: ffmpeg -- cache | ||
id: cache-ffmpeg | ||
uses: actions/cache@v3 | ||
with: | ||
path: ffmpeg/build | ||
key: macos-ffmpeg-n4.2.2 | ||
|
||
- name: ffmpeg -- download | ||
run: git clone --depth 1 --branch n4.2.3 https://git.ffmpeg.org/ffmpeg.git ffmpeg | ||
|
||
- name: ffmpeg -- configure | ||
if: steps.cache-ffmpeg.outputs.cache-hit != 'true' | ||
working-directory: ffmpeg | ||
run: ./configure --enable-shared --prefix=/usr/local | ||
--cc=clang | ||
--arch=x86_64 | ||
--cpu=westmere | ||
--disable-everything | ||
--enable-swscale | ||
--enable-zlib | ||
--enable-demuxer=avi,rawvideo | ||
--enable-decoder=png,rawvideo,h264 | ||
--enable-parser=png | ||
--enable-protocol=file | ||
--disable-d3d11va | ||
--disable-dxva2 | ||
--disable-avx | ||
--disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg | ||
--disable-static --disable-bzlib --disable-libopenjpeg --disable-iconv | ||
|
||
- name: ffmpeg -- build | ||
if: steps.cache-ffmpeg.outputs.cache-hit != 'true' | ||
working-directory: ffmpeg | ||
run: | | ||
make -j4 | ||
- name: ffmpeg -- install | ||
working-directory: ffmpeg | ||
run: sudo make install | ||
|
||
- name: vangers -- configure | ||
run: mkdir build && cd build && cmake -G Ninja .. | ||
|
||
- name: vangers -- make | ||
working-directory: build | ||
run: ninja | ||
|
||
- name: vangers -- show depends | ||
working-directory: build | ||
run: otool -L src/vangers | ||
|
||
- name: vangers -- prepare release folder | ||
run: | | ||
mkdir Vangers.app/Contents/Frameworks | ||
mkdir Vangers.app/Contents/Libs | ||
cp -L /usr/local/lib/libSDL2-2.0.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libSDL2_net-2.0.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libogg.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libvorbis.0.dylib Vangers.app/Contents/Libs/ | ||
cp -L /usr/local/lib/libvorbisfile.3.dylib Vangers.app/Contents/Libs/ | ||
cp clunk/build/libclunk.dylib Vangers.app/Contents/Libs/ | ||
cp build/src/vangers Vangers.app/Contents/MacOS/Vangers | ||
dylibbundler -i "@loader_path/" -x Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "@loader_path/libEGL.dylib" "@executable_path/../Libs/libEGL.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "@loader_path/libGLESv2.dylib" "@executable_path/../Libs/libGLESv2.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "@executable_path/../libs/libogg.0.8.5.dylib" "@executable_path/../libs/libogg.0.dylib" Vangers.app/Contents/MacOS/Vangers | ||
rm Vangers.app/Contents/MacOS/libEGL.dylib | ||
rm Vangers.app/Contents/MacOS/libGLESv2.dylib | ||
otool -L Vangers.app/Contents/MacOS/Vangers | ||
strip Vangers.app/Contents/MacOS/Vangers | ||
sudo chmod 777 Vangers.app/Contents/Libs/* | ||
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbis.0.dylib | ||
install_name_tool -change /usr/local/Cellar/libvorbis/1.3.7/lib/libvorbis.0.dylib "@executable_path/../Libs/libvorbis.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib | ||
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib | ||
mv Vangers.app/Contents/Libs/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/libavcodec.58.dylib | ||
mv Vangers.app/Contents/Libs/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/libavformat.58.dylib | ||
mv Vangers.app/Contents/Libs/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/libavutil.56.dylib | ||
install_name_tool -change "@executable_path/../libs/libavcodec.58.54.100.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "@executable_path/../libs/libavformat.58.29.100.dylib" "@executable_path/../Libs/libavformat.58.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "@executable_path/../libs/libavutil.56.31.100.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/MacOS/Vangers | ||
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavcodec.58.dylib | ||
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib | ||
install_name_tool -change "/usr/local/lib/libavcodec.58.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib | ||
install_name_tool -change "/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib" "@executable_path/../Libs/libSDL2-2.0.0.dylib" Vangers.app/Contents/Libs/libSDL2_net-2.0.0.dylib | ||
install_name_tool -change "/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib" "@executable_path/../Libs/libSDL2-2.0.0.dylib" Vangers.app/Contents/Libs/libclunk.dylib | ||
echo "libclunk.dylib" | ||
otool -L Vangers.app/Contents/Libs/libclunk.dylib | ||
echo "libvorbisfile.3.dylib" | ||
otool -L Vangers.app/Contents/Libs/libvorbisfile.3.dylib | ||
echo "libvorbis.0.dylib" | ||
otool -L Vangers.app/Contents/Libs/libvorbis.0.dylib | ||
echo "libogg.0.dylib" | ||
otool -L Vangers.app/Contents/Libs/libogg.0.dylib | ||
echo "libavutil.56.dylib" | ||
otool -L Vangers.app/Contents/Libs/libavutil.56.dylib | ||
echo "libavformat.58.dylib" | ||
otool -L Vangers.app/Contents/Libs/libavformat.58.dylib | ||
echo "libavcodec.58.dylib" | ||
otool -L Vangers.app/Contents/Libs/libavcodec.58.dylib | ||
echo "libSDL2_net-2.0.0.dylib" | ||
otool -L Vangers.app/Contents/Libs/libSDL2_net-2.0.0.dylib | ||
echo "libSDL2-2.0.0.dylib" | ||
otool -L Vangers.app/Contents/Libs/libSDL2-2.0.0.dylib | ||
tar -cvf Vangers.app.tar Vangers.app | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: Vangers-Release-MacOS | ||
path: Vangers.app.tar |
Oops, something went wrong.