Skip to content

Commit

Permalink
[boost-modular-headers] download the license file only once (microsof…
Browse files Browse the repository at this point in the history
…t#22462)

* [boost-modular-headers] download license file only once for every header-only library

* update version
  • Loading branch information
yurybura authored Jan 12, 2022
1 parent e16a8ac commit 9e0e976
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
18 changes: 6 additions & 12 deletions ports/boost-vcpkg-helpers/boost-modular-headers.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
function(boost_modular_headers)
cmake_parse_arguments(_bm "" "SOURCE_PATH" "" ${ARGN})

set(BOOST_VERSION 1.78.0)

if(NOT DEFINED _bm_SOURCE_PATH)
message(FATAL_ERROR "SOURCE_PATH is a required argument to boost_modular_headers.")
endif()

message(STATUS "Packaging headers")

message(STATUS "Copying headers")
file(
COPY ${_bm_SOURCE_PATH}/include/boost
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
message(STATUS "Copying headers done")

message(STATUS "Packaging headers done")

vcpkg_download_distfile(ARCHIVE
URLS "https://raw.githubusercontent.com/boostorg/boost/boost-${BOOST_VERSION}/LICENSE_1_0.txt"
FILENAME "boost_LICENSE_1_0.txt"
SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8
file(INSTALL
${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/usage
${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/copyright
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
)
file(INSTALL ${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL ${ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
endfunction()
13 changes: 11 additions & 2 deletions ports/boost-vcpkg-helpers/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

set(BOOST_VERSION 1.78.0)

file(COPY
file(INSTALL
${CMAKE_CURRENT_LIST_DIR}/boost-modular-headers.cmake
${CMAKE_CURRENT_LIST_DIR}/usage
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
)

set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_download_distfile(LICENSE
URLS "https://raw.githubusercontent.com/boostorg/boost/boost-${BOOST_VERSION}/LICENSE_1_0.txt"
FILENAME "boost_LICENSE_1_0.txt"
SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8
)

file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
1 change: 1 addition & 0 deletions ports/boost-vcpkg-helpers/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "boost-vcpkg-helpers",
"version": "1.78.0",
"port-version": 1,
"description": "Internal vcpkg port used to modularize Boost",
"dependencies": [
"boost-uninstall"
Expand Down
3 changes: 2 additions & 1 deletion scripts/boost/generate-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ else {
# Clear this array when moving to a new boost version
$portVersions = @{
#e.g. "boost-asio" = 1;
"boost-vcpkg-helpers" = 1;
}

$portData = @{
Expand Down Expand Up @@ -598,7 +599,7 @@ if ($updateServicePorts) {
$files_with_boost_version = @(
"$portsDir/boost-build/portfile.cmake",
"$portsDir/boost-modular-build-helper/boost-modular-build.cmake",
"$portsDir/boost-vcpkg-helpers/boost-modular-headers.cmake"
"$portsDir/boost-vcpkg-helpers/portfile.cmake"
)
$files_with_boost_version | % {
$content = Get-Content -LiteralPath $_ `
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-vcpkg-helpers.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2b601d13ad505473bac3d555d9e543d981c46565",
"version": "1.78.0",
"port-version": 1
},
{
"git-tree": "b8003935ceb891a870f1bbef0ffd18ef4266c6f7",
"version": "1.78.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@
},
"boost-vcpkg-helpers": {
"baseline": "1.78.0",
"port-version": 0
"port-version": 1
},
"boost-vmd": {
"baseline": "1.78.0",
Expand Down

0 comments on commit 9e0e976

Please sign in to comment.