From c1b768b0d6bc9b05d6272d604496d33a3faedd90 Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Wed, 18 May 2022 02:26:19 -0700 Subject: [PATCH] Add vcpkg_from_*** and ${PORT} usage improvements to the `vcpkg create` templates. (#24763) * Add vcpkg_from_*** and ${PORT} usage improvements to the `vcpkg create` templates. * Also add some more quotes. * Back out quotes to vcpkg_cmake_config_fixup as suggested by @JackBoosY --- scripts/templates/portfile.in.cmake | 12 +++++++++--- scripts/templates/vcpkg.json.in | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index 3ceac93d11..a997cd22cc 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -29,6 +29,12 @@ # # See additional helpful variables in /docs/maintainers/vcpkg_common_definitions.md +# Also consider vcpkg_from_* functions if you can; the generated code here is for any web accessable +# source archive. +# vcpkg_from_github +# vcpkg_from_gitlab +# vcpkg_from_bitbucket +# vcpkg_from_sourceforge vcpkg_download_distfile(ARCHIVE URLS "@URL@" FILENAME "@FILENAME@" @@ -37,7 +43,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + ARCHIVE "${ARCHIVE}" # (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag). # REF 1.0.0 # (Optional) Read the docs for how to generate patches at: @@ -74,5 +80,5 @@ vcpkg_cmake_install() #} # vcpkg_cmake_config_fixup(CONFIG_PATH cmake TARGET_PATH share/@PORT@) -# # Handle copyright -# file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/@PORT@" RENAME copyright) +# Uncomment the line below if necessary to install the license file for the port to share/${PORT}/copyright +# file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/scripts/templates/vcpkg.json.in b/scripts/templates/vcpkg.json.in index 15fcaa1677..81004e8eeb 100644 --- a/scripts/templates/vcpkg.json.in +++ b/scripts/templates/vcpkg.json.in @@ -1,6 +1,6 @@ { "name": "@PORT@", - "version-string": "", + "version": "", "homepage": "", "description": "", "dependencies": [