From 9e0e9762e64db7a085adb4759fad671e9b1d3568 Mon Sep 17 00:00:00 2001 From: Yury Bura Date: Wed, 12 Jan 2022 22:39:19 +0300 Subject: [PATCH] [boost-modular-headers] download the license file only once (#22462) * [boost-modular-headers] download license file only once for every header-only library * update version --- .../boost-modular-headers.cmake | 18 ++++++------------ ports/boost-vcpkg-helpers/portfile.cmake | 13 +++++++++++-- ports/boost-vcpkg-helpers/vcpkg.json | 1 + scripts/boost/generate-ports.ps1 | 3 ++- versions/b-/boost-vcpkg-helpers.json | 5 +++++ versions/baseline.json | 2 +- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/ports/boost-vcpkg-helpers/boost-modular-headers.cmake b/ports/boost-vcpkg-helpers/boost-modular-headers.cmake index f072bbf1bc..6cb052392c 100644 --- a/ports/boost-vcpkg-helpers/boost-modular-headers.cmake +++ b/ports/boost-vcpkg-helpers/boost-modular-headers.cmake @@ -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() diff --git a/ports/boost-vcpkg-helpers/portfile.cmake b/ports/boost-vcpkg-helpers/portfile.cmake index 0233bda5aa..3737f92738 100644 --- a/ports/boost-vcpkg-helpers/portfile.cmake +++ b/ports/boost-vcpkg-helpers/portfile.cmake @@ -1,8 +1,17 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -file(COPY +set(BOOST_VERSION 1.78.0) + +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) diff --git a/ports/boost-vcpkg-helpers/vcpkg.json b/ports/boost-vcpkg-helpers/vcpkg.json index 70d08eb906..8987cc0bad 100644 --- a/ports/boost-vcpkg-helpers/vcpkg.json +++ b/ports/boost-vcpkg-helpers/vcpkg.json @@ -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" diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index 2c1ffb6f3d..7c71e7ba27 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -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 = @{ @@ -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 $_ ` diff --git a/versions/b-/boost-vcpkg-helpers.json b/versions/b-/boost-vcpkg-helpers.json index cbbe4c30c8..652b90ee89 100644 --- a/versions/b-/boost-vcpkg-helpers.json +++ b/versions/b-/boost-vcpkg-helpers.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2b601d13ad505473bac3d555d9e543d981c46565", + "version": "1.78.0", + "port-version": 1 + }, { "git-tree": "b8003935ceb891a870f1bbef0ffd18ef4266c6f7", "version": "1.78.0", diff --git a/versions/baseline.json b/versions/baseline.json index d26bb1a1c0..f435674905 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1102,7 +1102,7 @@ }, "boost-vcpkg-helpers": { "baseline": "1.78.0", - "port-version": 0 + "port-version": 1 }, "boost-vmd": { "baseline": "1.78.0",