Provide a script and workflow for building the project natively on MacOS (#145)

master
Daniel Kamil Kozar 2020-04-28 23:49:48 +02:00 committed by GitHub
parent 86fce382c0
commit 59f22eb481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 1 deletions

28
.github/workflows/mac_native.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Build for Mac
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build-mac-native:
runs-on: macos-latest
steps:
- uses: actions/checkout@master
name: checkout
- name: Install Qt
uses: jurplel/install-qt-action@v2
- run: ./build_macos_native.sh
name: build-for-mac
- uses: actions/upload-artifact@master
with:
name: tsMuxer
path: build/bin/mac.tar.bz2
name: upload-artefact

35
build_macos_native.sh Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -x
set -e
export MACOSX_DEPLOYMENT_TARGET=10.10
brew install pkg-config
brew install freetype
brew install zlib
builddir=$PWD
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=Release -DTSMUXER_GUI=TRUE ..
make -j$(sysctl -n hw.logicalcpu)
pushd tsMuxerGUI
pushd tsMuxerGUI.app/Contents
defaults write "$PWD/Info.plist" NSPrincipalClass -string NSApplication
defaults write "$PWD/Info.plist" NSHighResolutionCapable -string True
plutil -convert xml1 Info.plist
popd
macdeployqt tsMuxerGUI.app
popd
mkdir bin
pushd bin
mv ../tsMuxer/tsmuxer tsMuxeR
mv ../tsMuxerGUI/tsMuxerGUI.app .
BZIP2=-9 tar cjf mac.tar.bz2 tsMuxeR tsMuxerGUI.app
popd
popd

View File

@ -109,7 +109,7 @@ if (WIN32)
target_compile_definitions(tsmuxer PRIVATE "-DUNICODE")
else()
target_sources(tsmuxer PRIVATE osdep/textSubtitlesRenderFT.cpp)
target_link_libraries(tsmuxer ${FREETYPE2_LIBRARIES})
target_link_libraries(tsmuxer ${FREETYPE2_LIBRARIES} ${FREETYPE2_LDFLAGS})
target_include_directories(tsmuxer PRIVATE ${FREETYPE2_INCLUDE_DIRS})
endif()