diff --git a/.github/scripts/Linux/prepare.sh b/.github/scripts/Linux/prepare.sh index 33ecd92dc..6b37a2f6a 100755 --- a/.github/scripts/Linux/prepare.sh +++ b/.github/scripts/Linux/prepare.sh @@ -76,18 +76,17 @@ if [ -n "$SDK_URL" ]; then fi # Install NDI -if [ -n "$SDK_URL" ]; then - if curl -f -S $SDK_URL/NDISDK_Linux.tar.gz -O; then - tar -C /var/tmp -xzf NDISDK_Linux.tar.gz - yes | PAGER=cat /var/tmp/Install*NDI*sh - sudo cp -r NDI\ SDK\ for\ Linux/include/* /usr/local/include - cat NDI\ SDK\ for\ Linux/Version.txt | sed 's/\(.*\)/\#define NDI_VERSION \"\1\"/' | sudo tee /usr/local/include/ndi_version.h - sudo cp -r NDI\ SDK\ for\ Linux/lib/x86_64-linux-gnu/* /usr/local/lib - FEATURES="${FEATURES:+$FEATURES }--enable-ndi" - echo "FEATURES=$FEATURES" >> $GITHUB_ENV - sudo ldconfig - fi -fi +install_ndi() { +( + cd /var/tmp + tar -xzf Install_NDI_SDK_Linux.tar.gz + yes | PAGER=cat ./Install*NDI*sh + sudo cp -r NDI\ SDK\ for\ Linux/include/* /usr/local/include + cat NDI\ SDK\ for\ Linux/Version.txt | sed 's/\(.*\)/\#define NDI_VERSION \"\1\"/' | sudo tee /usr/local/include/ndi_version.h + sudo cp -r NDI\ SDK\ for\ Linux/lib/x86_64-linux-gnu/* /usr/local/lib + sudo ldconfig +) +} # Install live555 git clone https://github.com/xanview/live555/ @@ -98,6 +97,8 @@ make -j $(nproc) CPLUSPLUS_COMPILER="c++ -DXLOCALE_NOT_USED" sudo make install cd .. +install_ndi + # Install cross-platform deps $GITHUB_WORKSPACE/.github/scripts/install-common-deps.sh diff --git a/.github/scripts/Windows/prepare.ps1 b/.github/scripts/Windows/prepare.ps1 index ce4ca7b2c..781381430 100644 --- a/.github/scripts/Windows/prepare.ps1 +++ b/.github/scripts/Windows/prepare.ps1 @@ -18,19 +18,12 @@ Start-Process -FilePath .\XIMEA_API_Installer.exe -ArgumentList "/S /SecXiApi=ON Remove-Item XIMEA_API_Installer.exe # Install NDI -if (${env:SDK_URL}) { - try { - Invoke-WebRequest ${env:SDK_URL}/NDI_SDK.exe -OutFile C:\ndi.exe - # TODO: NDI installer opens a manual in a browser and doesn't end, thus StartProcess with -Wait - # waits infinitely. Therefore, there is a hack with Sleep (and not removint the installer) - #Start-Process -FilePath "C:\ndi.exe" -ArgumentList "/VERYSILENT" -Wait -NoNewWindow - Start-Process -FilePath "C:\ndi.exe" -ArgumentList "/VERYSILENT" - Sleep 10 - $sdk=(dir "C:\Program Files\NDI" -Filter *SDK -Name) - echo "C:\Program Files\NDI\$sdk\Bin\x64" >> ${env:GITHUB_PATH} - #Remove-Item C:\ndi.exe - } catch { - Write-Output "Status Code --- $($_.Exception.Response.StatusCode.Value__) " - } -} +# TODO: NDI installer opens a manual in a browser and doesn't end, thus StartProcess with -Wait +# waits infinitely. Therefore, there is a hack with Sleep (and not removint the installer) +#Start-Process -FilePath "C:\ndi.exe" -ArgumentList "/VERYSILENT" -Wait -NoNewWindow +Start-Process -FilePath "C:\ndi.exe" -ArgumentList "/VERYSILENT" +Sleep 10 +$sdk=(dir "C:\Program Files\NDI" -Filter *SDK -Name) +echo "C:\Program Files\NDI\$sdk\Bin\x64" >> ${env:GITHUB_PATH} +#Remove-Item C:\ndi.exe diff --git a/.github/scripts/Windows/prepare_msys.sh b/.github/scripts/Windows/prepare_msys.sh index 153325404..2de318bab 100644 --- a/.github/scripts/Windows/prepare_msys.sh +++ b/.github/scripts/Windows/prepare_msys.sh @@ -20,7 +20,6 @@ if test -d /c/Program\ Files/NDI; then export CPATH=$CPATH:$NDI_D/Include export LIBRARY_PATH=$LIBRARY_PATH:$NDI_D/Lib/x64 cat $NDI_D/Version.txt | sed 's/\(.*\)/\#define NDI_VERSION \"\1\"/' | tee /usr/local/include/ndi_version.h - FEATURES="$FEATURES --enable-ndi" fi JACK_D=/c/Program\ Files/JACK2 diff --git a/.github/scripts/macOS/prepare.sh b/.github/scripts/macOS/prepare.sh index 0f9a98000..a039939d9 100755 --- a/.github/scripts/macOS/prepare.sh +++ b/.github/scripts/macOS/prepare.sh @@ -53,8 +53,8 @@ if [ -d $DELTA_CACHE_INST ]; then fi # Install NDI -if [ -f $SDK_NONFREE_PATH/NDISDK_Apple.pkg ]; then - sudo installer -pkg $SDK_NONFREE_PATH/NDISDK_Apple.pkg -target / +install_ndi() { + sudo installer -pkg /private/var/tmp/Install_NDI_SDK_Apple.pkg -target / sudo mv /Library/NDI\ SDK\ for\ * /Library/NDI cat /Library/NDI/Version.txt | sed 's/\(.*\)/\#define NDI_VERSION \"\1\"/' | sudo tee /usr/local/include/ndi_version.h if [ -d /Library/NDI/lib/x64 ]; then # NDI 4 @@ -70,12 +70,10 @@ if [ -f $SDK_NONFREE_PATH/NDISDK_Apple.pkg ]; then export MY_DYLD_LIBRARY_PATH="${MY_DYLD_LIBRARY_PATH:+$MY_DYLD_LIBRARY_PATH:}$NDI_LIB" echo "CPATH=$CPATH" >> $GITHUB_ENV echo "DYLIBBUNDLER_FLAGS=$DYLIBBUNDLER_FLAGS" >> $GITHUB_ENV - FEATURES="$FEATURES --enable-ndi" - echo "FEATURES=$FEATURES" >> $GITHUB_ENV echo "LIBRARY_PATH=$LIBRARY_PATH" >> $GITHUB_ENV echo "MY_DYLD_LIBRARY_PATH=$MY_DYLD_LIBRARY_PATH" >> $GITHUB_ENV cd $TEMP_INST -fi +} # Install live555 git clone https://github.com/xanview/live555/ @@ -90,6 +88,8 @@ wget --no-verbose https://github.com/Syphon/Syphon-Framework/releases/download/5 unzip Syphon.SDK.5.zip sudo cp -R 'Syphon SDK 5/Syphon.framework' /Library/Frameworks +install_ndi + # Install cross-platform deps $GITHUB_WORKSPACE/.github/scripts/install-common-deps.sh diff --git a/.github/workflows/README.md b/.github/workflows/README.md index ca4d2bce4..1679aa54b 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -26,20 +26,17 @@ Further subsection briefly describe individual assets and how to obtain them. A are unmodified files downloaded from vendor website. However, rename may be required. ### Linux -- **NDISDK\_Linux.tar.gz** - [NDI SDK](https://ndi.tv/sdk/) installer for Linux - **ntv2sdklinux.zip** - Linux NTV2 SDK ([AJA](https://sdksupport.aja.com/)) **Note:** _VideoMaster SDK_ is not used because DELTACAST doesn't provide redistributable libraries for Linux (as does for macOS and Windows). ### macOS -- **NDISDK\_Apple.pkg** - NDI SDK for macOS from NewTek - **ntv2sdkmac.zip** - NTV2 SDK downloaded from AJA - **VideoMaster\_SDK\_MacOSX.zip** - VideoMaster SDK for Mac from [DELTACAST](https://www.deltacast.tv/support/download-center) ### Windows -- **NDI\_SDK.exe** - Windows NDI installer downloaded from NewTek - **ntv2sdkwin.zip** - NTV2 SDK downloaded from AJA - **VideoMaster\_SDK\_Windows.zip** - VideoMaster SDK from DELTACAST for Windows diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 31c49d952..82c23adbc 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -1,7 +1,7 @@ name: C/C++ CI env: - FEATURES: '--enable-option-checking=fatal --with-live555=/usr/local --enable-blank --enable-cineform --enable-decklink --enable-file --enable-gl --enable-jack --enable-jack-transport --enable-libavcodec --enable-natpmp --enable-openssl --enable-pcp --enable-portaudio --enable-qt --enable-rtdxt --enable-rtsp --enable-rtsp-server --enable-scale --enable-sdl2 --enable-sdp-http --enable-speexdsp --enable-swmix --enable-libswscale --enable-text --enable-video-mixer --enable-ximea --enable-zfec' + FEATURES: '--enable-option-checking=fatal --with-live555=/usr/local --enable-blank --enable-cineform --enable-decklink --enable-file --enable-gl --enable-jack --enable-jack-transport --enable-libavcodec --enable-natpmp --enable-ndi --enable-openssl --enable-pcp --enable-portaudio --enable-qt --enable-rtdxt --enable-rtsp --enable-rtsp-server --enable-scale --enable-sdl2 --enable-sdp-http --enable-speexdsp --enable-swmix --enable-libswscale --enable-text --enable-video-mixer --enable-ximea --enable-zfec' CUDA_FEATURES: '--enable-cuda_dxt --enable-gpujpeg --enable-ldgm-gpu --enable-uyvy' on: @@ -62,6 +62,19 @@ jobs: steps: - uses: actions/checkout@v1 + - name: Fetch SDKs ETags + id: etags + run: | + echo "::set-output name=ndi::$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v5_Linux.tar.gz)" + - name: Cache NDI + id: cache-ndi + uses: actions/cache@v2 + with: + path: /var/tmp/Install_NDI_SDK_Linux.tar.gz + key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }} + - name: Download NDI + if: steps.cache-ndi.outputs.cache-hit != 'true' + run: curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v5_Linux.tar.gz -o /var/tmp/Install_NDI_SDK_Linux.tar.gz - name: bootstrap run: | . .github/scripts/environment.sh @@ -148,6 +161,7 @@ jobs: run: | echo "::set-output name=free::$($GITHUB_WORKSPACE/.github/scripts/macOS/prepare_free_sdks.sh -e)" echo "::set-output name=nonfree::$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh $SDK_URL/ntv2sdkmac.zip $SDK_URL/VideoMaster_SDK_MacOSX.zip $SDK_URL/NDISDK_Apple.pkg)" + echo "::set-output name=ndi::$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK_Mac/Install_NDI_SDK_v5_Apple.pkg)" - name: Cache Non-Free SDKs id: cache-macos-nonfree-sdks uses: actions/cache@v2 @@ -160,7 +174,7 @@ jobs: rm -rf ${{ env.SDK_NONFREE_PATH }} mkdir -p ${{ env.SDK_NONFREE_PATH }} cd ${{ env.SDK_NONFREE_PATH }} - curl -S -f -O $SDK_URL/ntv2sdkmac.zip --next -f -O $SDK_URL/VideoMaster_SDK_MacOSX.zip --next -f -O $SDK_URL/NDISDK_Apple.pkg || true + curl -S -f -O $SDK_URL/ntv2sdkmac.zip --next -f -O $SDK_URL/VideoMaster_SDK_MacOSX.zip || true $GITHUB_WORKSPACE/.github/scripts/macOS/prepare_nonfree_sdks.sh - name: Cache Free SDKs id: cache-macos-free-sdks @@ -171,6 +185,15 @@ jobs: - name: Download Free SDKs if: steps.cache-macos-free-sdks.outputs.cache-hit != 'true' run: $GITHUB_WORKSPACE/.github/scripts/macOS/prepare_free_sdks.sh + - name: Cache NDI + id: cache-ndi + uses: actions/cache@v2 + with: + path: /private/var/tmp/Install_NDI_SDK_Apple.pkg + key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }} + - name: Download NDI + if: steps.cache-ndi.outputs.cache-hit != 'true' + run: curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Mac/Install_NDI_SDK_v5_Apple.pkg -o /private/var/tmp/Install_NDI_SDK_Apple.pkg - name: bootstrap run: | . .github/scripts/environment.sh @@ -221,14 +244,24 @@ jobs: - uses: actions/checkout@v1 - name: Fetch SDKs ETags id: etags - run: + run: | echo "::set-output name=aja::$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh $SDK_URL/ntv2sdkwin.zip)" + echo "::set-output name=ndi::$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK/NDI%205%20SDK.exe)" shell: bash - name: Set environment run: .github/scripts/environment.sh shell: bash - name: Find MSVC run: .github/scripts/Windows/find_msvc.ps1 + - name: Cache NDI + id: cache-ndi + uses: actions/cache@v2 + with: + path: 'C:\ndi.exe' + key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }} + - name: Download NDI + if: steps.cache-ndi.outputs.cache-hit != 'true' + run: Invoke-WebRequest https://downloads.ndi.tv/SDK/NDI_SDK/NDI%205%20SDK.exe -OutFile C:\ndi.exe - name: bootsrap run: .github/scripts/Windows/prepare.ps1 - name: Cache AJA