diff --git a/.github/scripts/macOS/build-qt.sh b/.github/scripts/macOS/build-qt.sh new file mode 100755 index 000000000..b497f4060 --- /dev/null +++ b/.github/scripts/macOS/build-qt.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -ex + +wget --no-verbose https://download.qt.io/archive/qt/5.13/5.13.2/single/qt-everywhere-src-5.13.2.tar.xz +tar xJf qt-everywhere-src-5.13.2.tar.xz +cd qt-everywhere-src-5.13.2 +./configure -static -release -nomake examples -opensource -confirm-license -opengl -prefix /usr/local/opt/qt +make -j 3 && sudo make install + diff --git a/.github/scripts/macOS/prepare.sh b/.github/scripts/macOS/prepare.sh new file mode 100755 index 000000000..7a6335429 --- /dev/null +++ b/.github/scripts/macOS/prepare.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -ex + +echo "::set-env name=AJA_DIRECTORY::/var/tmp/ntv2sdk" +echo "::set-env name=UG_SKIP_NET_TESTS::1" +echo "::set-env name=CPATH::/usr/local/include:/usr/local/opt/qt/include" +echo "::set-env name=LIBRARY_PATH::/usr/local/lib:/usr/local/opt/qt/lib" +echo "::set-env name=PKG_CONFIG_PATH::/usr/local/lib/pkgconfig:/usr/local/opt/qt/lib/pkgconfig" +echo "::set-env name=SDKROOT::macosx10.14" # SDK 10.15 crashes Qt in High Sierra +echo "::add-path::/usr/local/opt/qt/bin" + +curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/10.14-beta4/MacOSX10.14.sdk.tar.xz +tar xJf MacOSX10.14.sdk.tar.xz +mv MacOSX10.14.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs +brew install autoconf automake cppunit dylibbundler libtool pkg-config +brew install ffmpeg portaudio sdl2 +brew install ossp-uuid # for cineform +( cd cineform-sdk/ && cmake . && make CFHDCodecStatic ) + +# Install XIMEA +if [ -z "$sdk_pass" ]; then exit 0; fi +curl --netrc-file <(cat <<<"machine frakira.fi.muni.cz login sdk password $sdk_pass") https://frakira.fi.muni.cz/~xpulec/sdks/m3api.tar.xz -O +sudo tar xJf m3api.tar.xz -C $(xcrun --show-sdk-path)/$SDKPATH/System/Library/Frameworks + +# Install AJA +if [ -z "$sdk_pass" ]; then exit 0; fi +curl --netrc-file <(cat <<<"machine frakira.fi.muni.cz login sdk password $sdk_pass") https://frakira.fi.muni.cz/~xpulec/sdks/ntv2sdkmac.zip -O +unzip ntv2sdkmac.zip -d /var/tmp +mv /var/tmp/ntv2sdk* /var/tmp/ntv2sdk +cd /var/tmp/ntv2sdk/ajalibraries/ajantv2/build +xcodebuild -project ajantv2.xcodeproj +sudo rm -f /usr/local/lib/libajantv2.dylib +sudo cp ../../../bin/ajantv2.dylib /usr/local/lib/libajantv2.dylib +sudo ln -fs /usr/local/lib/libajantv2.dylib /usr/local/lib/ajantv2.dylib + diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 989369a89..a74673f3d 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -63,29 +63,14 @@ jobs: name: run macOS runs-on: macos-latest env: - AJA_DIRECTORY: "/var/tmp/ntv2sdk" - UG_SKIP_NET_TESTS: 1 - CPATH: "/usr/local/include:/usr/local/opt/qt/include" - LIBRARY_PATH: "/usr/local/lib:/usr/local/opt/qt/lib" - PKG_CONFIG_PATH: "/usr/local/lib/pkgconfig:/usr/local/opt/qt/lib/pkgconfig" - SDKROOT: "macosx10.14" # SDK 10.15 crashes Qt in High Sierra sdk_pass: ${{ secrets.sdk_pass }} steps: - uses: actions/checkout@v1 with: submodules: true - - name: set-path - run: echo "::add-path::/usr/local/opt/qt/bin" - name: bootstrap - run: | - curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/10.14-beta4/MacOSX10.14.sdk.tar.xz - tar xJf MacOSX10.14.sdk.tar.xz - mv MacOSX10.14.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs - brew install autoconf automake cppunit dylibbundler libtool pkg-config - brew install ffmpeg portaudio sdl2 - brew install ossp-uuid # for cineform - ( cd cineform-sdk/ && cmake . && make CFHDCodecStatic ) + run: .github/scripts/macOS/prepare.sh - name: Cache static Qt id: cache-qt-mac uses: actions/cache@v1 @@ -94,30 +79,9 @@ jobs: key: cache-qt-mac - name: Build static Qt if: steps.cache-qt-mac.outputs.cache-hit != 'true' - run: | - wget --no-verbose https://download.qt.io/archive/qt/5.13/5.13.2/single/qt-everywhere-src-5.13.2.tar.xz - tar xJf qt-everywhere-src-5.13.2.tar.xz - cd qt-everywhere-src-5.13.2 - ./configure -static -release -nomake examples -opensource -confirm-license -opengl -prefix /usr/local/opt/qt - make -j 3 && sudo make install - - name: Install XIMEA - run: | - if [ -z "$sdk_pass" ]; then exit 0; fi - curl --netrc-file <(cat <<<"machine frakira.fi.muni.cz login sdk password $sdk_pass") https://frakira.fi.muni.cz/~xpulec/sdks/m3api.tar.xz -O - sudo tar xJf m3api.tar.xz -C $(xcrun --show-sdk-path)/$SDKPATH/System/Library/Frameworks - - name: Install AJA - run: | - if [ -z "$sdk_pass" ]; then exit 0; fi - curl --netrc-file <(cat <<<"machine frakira.fi.muni.cz login sdk password $sdk_pass") https://frakira.fi.muni.cz/~xpulec/sdks/ntv2sdkmac.zip -O - unzip ntv2sdkmac.zip -d /var/tmp - mv /var/tmp/ntv2sdk* /var/tmp/ntv2sdk - cd /var/tmp/ntv2sdk/ajalibraries/ajantv2/build - xcodebuild -project ajantv2.xcodeproj - sudo rm -f /usr/local/lib/libajantv2.dylib - sudo cp ../../../bin/ajantv2.dylib /usr/local/lib/libajantv2.dylib - sudo ln -fs /usr/local/lib/libajantv2.dylib /usr/local/lib/ajantv2.dylib + run: .github/scripts/macOS/build-qt.sh - name: configure - run: export CPATH LIBRARY_PATH PKG_CONFIG_PATH && ./autogen.sh --enable-qt --enable-static-qt + run: ./autogen.sh --enable-qt --enable-static-qt - name: make run: make osx-gui-dmg - name: make check