From eb3bedf6bbbaa490f1d79357a9734b52d1e4a931 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 23 Jan 2023 05:32:28 +0100 Subject: [PATCH 1/3] deps.windows: Add nghttp2 --- deps.windows/20-nghttp2.ps1 | 67 +++++++++++++++++++++++++++++++++++++ licenses/nghttp2/COPYING | 23 +++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 deps.windows/20-nghttp2.ps1 create mode 100644 licenses/nghttp2/COPYING diff --git a/deps.windows/20-nghttp2.ps1 b/deps.windows/20-nghttp2.ps1 new file mode 100644 index 000000000..ca0646eac --- /dev/null +++ b/deps.windows/20-nghttp2.ps1 @@ -0,0 +1,67 @@ +param( + [string] $Name = 'nghttp2', + [string] $Version = 'v1.58.0', + [string] $Uri = 'https://github.com/nghttp2/nghttp2.git', + [string] $Hash = 'e2bc59bec9004bca47df961cbbad20664d7e53b2' +) + +function Setup { + Setup-Dependency -Uri $Uri -Hash $Hash -DestinationPath $Path +} + +function Clean { + Set-Location $Path + + if ( Test-Path "build_${Target}" ) { + Log-Information "Clean build directory (${Target})" + Remove-Item -Path "build_${Target}" -Recurse -Force + } +} + +function Configure { + Log-Information "Configure (${Target})" + Set-Location $Path + + $Options = @( + $CmakeOptions + '-DENABLE_LIB_ONLY=ON' + '-DENABLE_STATIC_LIB=ON' + '-DENABLE_SHARED_LIB=OFF' + '-DENABLE_HTTP3=OFF' + '-DENABLE_DOC=OFF' + ) + + Invoke-External cmake -S . -B "build_${Target}" @Options +} + +function Build { + Log-Information "Build (${Target})" + Set-Location $Path + + $Options = @( + '--build', "build_${Target}" + '--config', $Configuration + ) + + if ( $VerbosePreference -eq 'Continue' ) { + $Options += '--verbose' + } + + Invoke-External cmake @Options +} + +function Install { + Log-Information "Install (${Target})" + Set-Location $Path + + $Options = @( + '--install', "build_${Target}" + '--config', $Configuration + ) + + if ( $Configuration -match "(Release|MinSizeRel)" ) { + $Options += '--strip' + } + + Invoke-External cmake @Options +} diff --git a/licenses/nghttp2/COPYING b/licenses/nghttp2/COPYING new file mode 100644 index 000000000..80201792e --- /dev/null +++ b/licenses/nghttp2/COPYING @@ -0,0 +1,23 @@ +The MIT License + +Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa +Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From cfff151ae11e68b0e259bccd29f8e7cf7b2f38f3 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 23 Jan 2023 05:32:47 +0100 Subject: [PATCH 2/3] deps.windows: Add brotli --- deps.windows/20-brotli.ps1 | 74 ++++++++++++++++++++++++++++++++++++++ licenses/brotli/LICENSE | 19 ++++++++++ 2 files changed, 93 insertions(+) create mode 100644 deps.windows/20-brotli.ps1 create mode 100644 licenses/brotli/LICENSE diff --git a/deps.windows/20-brotli.ps1 b/deps.windows/20-brotli.ps1 new file mode 100644 index 000000000..92821184a --- /dev/null +++ b/deps.windows/20-brotli.ps1 @@ -0,0 +1,74 @@ +param( + [string] $Name = 'brotli', + [string] $Version = 'v1.1.0', + [string] $Uri = 'https://github.com/google/brotli.git', + [string] $Hash = 'ed738e842d2fbdf2d6459e39267a633c4a9b2f5d' +) + +function Setup { + Setup-Dependency -Uri $Uri -Hash $Hash -DestinationPath $Path +} + +function Clean { + Set-Location $Path + + if ( Test-Path "build_${Target}" ) { + Log-Information "Clean build directory (${Target})" + Remove-Item -Path "build_${Target}" -Recurse -Force + } +} + +function Patch { + Log-Information "Patch (${Target})" + Set-Location $Path + + $Patches | ForEach-Object { + $Params = $_ + Safe-Patch @Params + } +} + +function Configure { + Log-Information "Configure (${Target})" + Set-Location $Path + + $Options = @( + $CmakeOptions + '-DBUILD_SHARED_LIBS=OFF' + '-DBROTLI_DISABLE_TESTS=ON' + ) + + Invoke-External cmake -S . -B "build_${Target}" @Options +} + +function Build { + Log-Information "Build (${Target})" + Set-Location $Path + + $Options = @( + '--build', "build_${Target}" + '--config', $Configuration + ) + + if ( $VerbosePreference -eq 'Continue' ) { + $Options += '--verbose' + } + + Invoke-External cmake @Options +} + +function Install { + Log-Information "Install (${Target})" + Set-Location $Path + + $Options = @( + '--install', "build_${Target}" + '--config', $Configuration + ) + + if ( $Configuration -match "(Release|MinSizeRel)" ) { + $Options += '--strip' + } + + Invoke-External cmake @Options +} diff --git a/licenses/brotli/LICENSE b/licenses/brotli/LICENSE new file mode 100644 index 000000000..33b7cdd2d --- /dev/null +++ b/licenses/brotli/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From c404a4ca39509bddc5d11a972bd5e86a3d9edb01 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 23 Jan 2023 05:33:27 +0100 Subject: [PATCH 3/3] deps.windows: Build libcurl statically with brotli/nghttp --- deps.windows/30-curl.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deps.windows/30-curl.ps1 b/deps.windows/30-curl.ps1 index 994de7a7b..a8454e362 100644 --- a/deps.windows/30-curl.ps1 +++ b/deps.windows/30-curl.ps1 @@ -45,8 +45,13 @@ function Configure { '-DCURL_USE_LIBSSH2:BOOL=OFF' '-DCURL_USE_SCHANNEL:BOOL=ON' '-DCURL_ZLIB:BOOL=OFF' + '-DBUILD_SHARED_LIBS:BOOL=OFF' + '-DCURL_BROTLI:BOOL=ON' + '-DUSE_NGHTTP2:BOOL=ON' ) + $env:CFLAGS="-DNGHTTP2_STATICLIB" + $env:CXXFLAGS="-DNGHTTP2_STATICLIB" Invoke-External cmake -S . -B "build_${Target}" @Options }