1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 15:54:57 +00:00
transmission/release/windows/build-curl.ps1

41 lines
1.3 KiB
PowerShell

#!/usr/bin/env pwsh
$global:CurlVersion = '7.70.0'
$global:CurlDeps = @(
'OpenSsl'
'Zlib'
)
function global:Build-Curl([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir) {
$Filename = "curl-${CurlVersion}.tar.gz"
$Url = "https://curl.haxx.se/download/${Filename}"
$SourceDir = Invoke-DownloadAndUnpack $Url $Filename
$BuildDir = Join-Path $SourceDir .build
$ConfigOptions = @(
'-DCMAKE_BUILD_TYPE=RelWithDebInfo'
"-DCMAKE_INSTALL_PREFIX=${PrefixDir}"
"-DCMAKE_PREFIX_PATH=${DepsPrefixDir}"
'-DCMAKE_USE_OPENSSL=ON'
'-DCURL_WINDOWS_SSPI=OFF'
'-DBUILD_CURL_EXE=OFF'
'-DBUILD_TESTING=OFF'
'-DCURL_DISABLE_DICT=ON'
'-DCURL_DISABLE_GOPHER=ON'
'-DCURL_DISABLE_IMAP=ON'
'-DCURL_DISABLE_SMTP=ON'
'-DCURL_DISABLE_POP3=ON'
'-DCURL_DISABLE_RTSP=ON'
'-DCURL_DISABLE_TFTP=ON'
'-DCURL_DISABLE_TELNET=ON'
'-DCURL_DISABLE_LDAP=ON'
'-DCURL_DISABLE_LDAPS=ON'
'-DENABLE_MANUAL=OFF'
)
Invoke-CMakeBuildAndInstall $SourceDir $BuildDir $ConfigOptions
Invoke-NativeCommand cmake -E remove_directory (Join-Path $PrefixDir lib cmake CURL) # until we support it
Copy-Item -Path (Join-Path $BuildDir lib libcurl.pdb) -Destination (Join-Path $PrefixDir bin)
}