mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 06:40:15 +00:00
CI: simplified Win
This commit is contained in:
22
.github/scripts/Windows/find_msvc.ps1
vendored
Normal file
22
.github/scripts/Windows/find_msvc.ps1
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Set-PSDebug -Trace 1
|
||||
|
||||
# Find VS
|
||||
$vswhere = "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
$installDir = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
if (-Not $installDir) {
|
||||
throw "Vswhere failed"
|
||||
}
|
||||
$path = join-path $installDir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'
|
||||
$pathPresent = test-path $path
|
||||
if (-Not $pathPresent) {
|
||||
throw "MSVS not found"
|
||||
}
|
||||
$version = gc -raw $path
|
||||
if (-Not $version) {
|
||||
throw "Cannot get MSVS version"
|
||||
}
|
||||
$version = $version.Trim()
|
||||
echo "::add-path::$installDir\VC\Tools\MSVC\$version\bin\HostX64\x64" # cl
|
||||
echo "::add-path::$installDir\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
|
||||
echo "::add-path::$installDir\MSBuild\Current\Bin"
|
||||
|
||||
33
.github/scripts/Windows/prepare.ps1
vendored
Normal file
33
.github/scripts/Windows/prepare.ps1
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
Set-PSDebug -Trace 1
|
||||
|
||||
# Install MSYS2
|
||||
choco install --no-progress msys2 --params "/NoUpdate /InstallDir:C:\msys64"
|
||||
echo "::set-env name=MSYS2_PATH_TYPE::inherit" # MSYS2 inherits PATH from Windows
|
||||
|
||||
# Install CUDA
|
||||
Invoke-WebRequest https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_441.22_win10.exe -OutFile cuda_inst.exe
|
||||
Start-Process -FilePath "cuda_inst.exe" -ArgumentList "-s nvcc_10.2" -Wait -NoNewWindow
|
||||
echo "::add-path::C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin"
|
||||
|
||||
# Build AJA
|
||||
if (${env:sdk_pass}) {
|
||||
$pair = "sdk:${env:sdk_pass}"
|
||||
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
|
||||
$basicAuthValue = "Basic $encodedCreds"
|
||||
$Headers = @{Authorization = $basicAuthValue}
|
||||
Invoke-WebRequest -Headers $Headers https://frakira.fi.muni.cz/~xpulec/sdks/ntv2sdkwin.zip -OutFile aja.zip
|
||||
Expand-Archive -LiteralPath 'aja.zip' -DestinationPath 'C:'
|
||||
mv c:\ntv2sdk* c:\AJA
|
||||
cd c:\AJA
|
||||
MSBuild.exe ntv2_vs12.sln -p:PlatformToolset=v142 -p:Configuration=Release -p:Platform=x64 -t:libajantv2
|
||||
}
|
||||
|
||||
# Install XIMEA
|
||||
if (${env:sdk_pass}) {
|
||||
$pair = "sdk:${env:sdk_pass}"
|
||||
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
|
||||
$basicAuthValue = "Basic $encodedCreds"
|
||||
$Headers = @{Authorization = $basicAuthValue}
|
||||
Invoke-WebRequest -Headers $Headers https://frakira.fi.muni.cz/~xpulec/sdks/ximea.zip -OutFile ximea.zip
|
||||
Expand-Archive -LiteralPath 'ximea.zip' -DestinationPath 'C:'
|
||||
}
|
||||
31
.github/scripts/Windows/prepare_msys.sh
vendored
Normal file
31
.github/scripts/Windows/prepare_msys.sh
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
mkdir -p /usr/local/lib /usr/local/bin /usr/local/include
|
||||
cat >> ~/.bash_profile <<'EOF'
|
||||
export PATH=/mingw64/bin:/usr/local/bin:$PATH
|
||||
export CPATH=/usr/local/include
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/mingw64/lib/pkgconfig
|
||||
export LIBRARY_PATH=/usr/local/lib
|
||||
export CPATH=$CPATH:/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v10.2/include
|
||||
EOF
|
||||
echo cd `cygpath $GITHUB_WORKSPACE` >> ~/.bash_profile
|
||||
|
||||
. ~/.bash_profile
|
||||
|
||||
# Install MSYS2 packages
|
||||
pacman -Sy --noconfirm automake autoconf git make pkg-config mingw-w64-x86_64-toolchain mingw-w64-x86_64-cppunit unzip zip
|
||||
|
||||
# Build AJA wrapper
|
||||
data/scripts/build_aja_lib_win64.sh
|
||||
|
||||
# Install FFMPEG
|
||||
wget --no-verbose https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-latest-win64-dev.zip && wget --no-verbose https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-latest-win64-shared.zip && unzip ffmpeg-latest-win64-dev.zip && unzip ffmpeg-latest-win64-shared.zip && cp -r ffmpeg-latest-win64-dev/include/* /usr/local/include && cp -r ffmpeg-latest-win64-dev/lib/* /usr/local/lib && cp -r ffmpeg-latest-win64-shared/bin/* /usr/local/bin && rm -rf ffmpeg-latest-*
|
||||
|
||||
# Build GPUJPEG
|
||||
( cd gpujpeg && nvcc -I. -DGPUJPEG_EXPORTS -o gpujpeg.dll --shared src/gpujpeg_*c src/gpujpeg*cu && cp gpujpeg.lib /usr/local/lib && cp gpujpeg.dll /usr/local/bin && cp -r libgpujpeg /usr/local/include )
|
||||
|
||||
# Build CineForm
|
||||
( cd cineform-sdk && cmake -DBUILD_STATIC=false -G Visual\ Studio\ 16\ 2019 -A x64 && MSBuild.exe CineFormSDK.sln -property:Configuration=Release && cp Release/CFHDCodec.dll /usr/local/bin && cp Release/CFHDCodec.lib /usr/local/lib && cp Common/* /usr/local/include && cp libcineformsdk.pc /usr/local/lib/pkgconfig )
|
||||
|
||||
Reference in New Issue
Block a user