diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2021-01-13 14:41:23 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-13 14:41:23 -0800 |
| commit | 4783c36f8c04f584ec4d232958afae9d32bc61d5 (patch) | |
| tree | 7124916dabdd1a6872e4b5040cce016c61a80421 /scripts | |
| parent | 8414e15973097e70fe40149e922c402799804b3d (diff) | |
| download | vcpkg-4783c36f8c04f584ec4d232958afae9d32bc61d5.tar.gz vcpkg-4783c36f8c04f584ec4d232958afae9d32bc61d5.zip | |
[boost][many ports] Reformat manifest files in preparation for #15424 (#15616)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/boost/generate-ports.ps1 | 154 |
1 files changed, 85 insertions, 69 deletions
diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index afa7d64da..f3620aa73 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -16,15 +16,19 @@ if ($null -eq $portsDir) if ($IsWindows)
{
$vcpkg = "$scriptsDir/../../vcpkg.exe"
+ $curl = "curl.exe"
}
else
{
$vcpkg = "$scriptsDir/../../vcpkg"
+ $curl = "curl"
}
-# Optionally clear this array when moving to a new boost version
+# Clear this array when moving to a new boost version
$port_versions = @{
#e.g. "asio" = 1;
+ "asio" = 1;
+ "python" = 1;
}
$per_port_data = @{
@@ -42,25 +46,32 @@ $per_port_data = @{ "log" = @{ "supports" = "!uwp&!emscripten" };
"locale" = @{
"supports" = "!uwp";
- "features" = @(
- "Feature: icu"
- "Build-Depends: icu"
- "Description: ICU backend for Boost.Locale"
- )};
+ "features" = @{
+ icu=@{
+ dependencies=@("icu")
+ description="ICU backend for Boost.Locale"
+ }
+ }
+ };
"parameter-python" = @{ "supports" = "!emscripten" };
"process" = @{ "supports" = "!emscripten" };
"python" = @{
"supports" = "!uwp&!(arm&windows)&!emscripten";
- "features" = @(
- "Feature: python2"
- "Build-Depends: python2 (windows)"
- "Description: Build with Python2 support"
- )};
- "regex" = @{ "features" = @(
- "Feature: icu"
- "Build-Depends: icu"
- "Description: ICU backend for Boost.Regex"
- )}
+ "features" = @{
+ python2=@{
+ dependencies=@(@{name="python2"; platform="windows"})
+ description="Build with Python2 support"
+ }
+ }
+ };
+ "regex" = @{
+ "features" = @{
+ icu=@{
+ dependencies=@("icu")
+ description="ICU backend for Boost.Regex"
+ }
+ }
+ }
}
function TransformReference()
@@ -71,11 +82,11 @@ function TransformReference() if ($per_port_data[$library].supports)
{
- "$library ($($per_port_data[$library].supports))"
+ @{name="boost-$library"; platform=$per_port_data[$library].supports}
}
else
{
- "$library"
+ "boost-$library"
}
}
@@ -89,32 +100,25 @@ function Generate() $Depends = @()
)
- $controlDeps = ($Depends | sort) -join ", "
-
- mkdir "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null
- $controlLines = @(
- "# Automatically generated by scripts/boost/generate-ports.ps1"
- "Source: boost-$PortName"
- "Version: $version"
- )
- if ($port_versions[$PortName])
- {
- $controlLines += @("Port-Version: $($port_versions[$PortName])")
+ New-Item -ItemType "Directory" "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null
+ $controlLines = @{
+ name="boost-$PortName"; `
+ "version-string"=$version; `
+ dependencies=$Depends; `
+ homepage="https://github.com/boostorg/$Name"; `
+ description="Boost $Name module" `
}
- $controlLines += @(
- "Build-Depends: $controlDeps"
- "Homepage: https://github.com/boostorg/$Name"
- "Description: Boost $Name module"
- )
- if ($per_port_data[$PortName].supports)
+ if ($port_versions[$PortName])
{
- $controlLines += @("Supports: $($per_port_data[$PortName].supports)")
+ $controlLines["port-version"] = $port_versions[$PortName]
}
- if ($per_port_data[$PortName].features)
+
+ if ($per_port_data[$PortName])
{
- $controlLines += @("") + $per_port_data[$PortName].features
+ $controlLines += $per_port_data[$PortName]
}
- $controlLines | out-file -enc ascii "$portsDir/boost-$PortName/CONTROL"
+ $controlLines | ConvertTo-Json -Depth 10 -Compress | out-file -enc ascii "$portsDir/boost-$PortName/vcpkg.json"
+ & $vcpkg format-manifest "$portsDir/boost-$PortName/vcpkg.json"
$portfileLines = @(
"# Automatically generated by scripts/boost/generate-ports.ps1"
@@ -137,7 +141,7 @@ function Generate() " SHA512 $Hash"
" HEAD_REF master"
)
- $patches = ls $portsDir/boost-$PortName/*.patch
+ $patches = Get-ChildItem $portsDir/boost-$PortName/*.patch
if ($patches.Count -eq 0)
{
}
@@ -210,7 +214,8 @@ function Generate() $portfileLines += @(get-content "$scriptsDir/post-build-stubs/$PortName.cmake")
}
- $portfileLines | out-file -enc ascii "$portsDir/boost-$PortName/portfile.cmake"
+ $portfileLines += @("")
+ $($portfileLines -join "`r`n") | out-file -enc ascii "$portsDir/boost-$PortName/portfile.cmake" -NoNewline
}
if (!(Test-Path "$scriptsDir/boost"))
@@ -240,7 +245,7 @@ else }
}
-$libraries_found = ls $scriptsDir/boost/libs -directory | % name | % {
+$libraries_found = Get-ChildItem $scriptsDir/boost/libs -directory | % name | % {
if ($_ -match "numeric")
{
"numeric_conversion"
@@ -258,7 +263,7 @@ $libraries_found = ls $scriptsDir/boost/libs -directory | % name | % { }
}
-mkdir $scriptsDir/downloads -erroraction SilentlyContinue | out-null
+New-Item -ItemType "Directory" $scriptsDir/downloads -erroraction SilentlyContinue | out-null
if ($libraries.Length -eq 0)
{
@@ -274,14 +279,14 @@ foreach ($library in $libraries) if (!(Test-Path $archive))
{
"Downloading boost/$library..."
- & @(& $vcpkg fetch aria2)[-1] "https://github.com/boostorg/$library/archive/boost-$version.tar.gz" -d "$scriptsDir/downloads" -o "$library-boost-$version.tar.gz"
+ & $curl -L "https://github.com/boostorg/$library/archive/boost-$version.tar.gz" --output "$scriptsDir/downloads/$library-boost-$version.tar.gz"
}
$hash = & $vcpkg hash $archive
$unpacked = "$scriptsDir/libs/$library-boost-$version"
if (!(Test-Path $unpacked))
{
"Unpacking boost/$library..."
- mkdir $scriptsDir/libs -erroraction SilentlyContinue | out-null
+ New-Item -ItemType "Directory" $scriptsDir/libs -erroraction SilentlyContinue | out-null
pushd $scriptsDir/libs
try
{
@@ -295,12 +300,22 @@ foreach ($library in $libraries) pushd $unpacked
try
{
- $groups = $(
- findstr /si /C:"include <boost/" include/*
- findstr /si /C:"include <boost/" src/*
- ) |
+ if ($IsWindows)
+ {
+ $groups = $(
+ findstr /si /C:"include <boost/" include/*
+ findstr /si /C:"include <boost/" src/*
+ ) | % { $_ -replace "^[^:]*:","" }
+ }
+ else
+ {
+ $groups = $(
+ grep -irhs "include <boost/" include src
+ )
+ }
+
+ $groups = $groups |
% { $_ `
- -replace "^[^:]*:","" `
-replace "boost/numeric/conversion/","boost/numeric_conversion/" `
-replace "boost/functional/hash.hpp","boost/container_hash/hash.hpp" `
-replace "boost/detail/([^/]+)/","boost/`$1/" `
@@ -375,9 +390,7 @@ foreach ($library in $libraries) (($library -notmatch "iostreams|math") -or ($_ -notmatch "random"))`
-and `
(($library -notmatch "utility|concept_check") -or ($_ -notmatch "iterator"))
- } | % { $_ -replace "_","-" } | % {
- "boost-" + (TransformReference $_)
- })
+ } | % { $_ -replace "_","-" } | % { TransformReference $_ })
$deps += @("boost-vcpkg-helpers")
@@ -399,7 +412,7 @@ foreach ($library in $libraries) }
elseif ($library -eq "locale")
{
- $deps += @("libiconv (!uwp&!windows&!mingw)", "boost-system")
+ $deps += @(@{ name="libiconv"; platform="!uwp&!windows&!mingw" }, "boost-system")
}
elseif ($library -eq "asio")
{
@@ -430,21 +443,24 @@ foreach ($library in $libraries) if ($libraries_in_boost_port.length -gt 1) {
# Generate master boost control file which depends on each individual library
# mpi is excluded due to it having a dependency on msmpi/openmpi
- $boostDependsList = @($libraries_in_boost_port | % { "boost-$_" } | ? { $_ -notmatch "boost-mpi" }) -join ", "
-
- @(
- "# Automatically generated by scripts/boost/generate-ports.ps1"
- "Source: boost"
- "Version: $version"
- "Port-Version: $($port_versions.boost)"
- "Homepage: https://boost.org"
- "Description: Peer-reviewed portable C++ source libraries"
- "Build-Depends: $boostDependsList"
- ""
- "Feature: mpi"
- "Description: Build with MPI support"
- "Build-Depends: boost-mpi"
- ) | out-file -enc ascii $portsDir/boost/CONTROL
+ $boostDependsList = $libraries_in_boost_port | ? { $_ -notmatch "boost-mpi" }
+
+ @{
+ name="boost";
+ "version-string"=$version;
+ "port-version"= $port_versions.boost ? $port_versions.boost : 0;
+ homepage="https://boost.org";
+ description="Peer-reviewed portable C++ source libraries";
+ dependencies=$boostDependsList;
+ features=@(
+ @{
+ name="mpi";
+ description="Build with MPI support";
+ dependencies=@("boost-mpi");
+ }
+ );
+ } | ConvertTo-Json -Depth 10 -Compress | out-file -enc ascii $portsDir/boost/vcpkg.json
+ & $vcpkg format-manifest "$portsDir/boost/vcpkg.json"
"set(VCPKG_POLICY_EMPTY_PACKAGE enabled)`n" | out-file -enc ascii $portsDir/boost/portfile.cmake
}
|
