From 8a79337389ff32ad079a1a4895cf11dd386ffbd8 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Tue, 2 Jul 2019 12:41:30 +0100 Subject: [PATCH 01/13] create pkg-config files --- ports/bzip2/portfile.cmake | 3 +- ports/double-conversion/portfile.cmake | 3 +- ports/expat/portfile.cmake | 1 + ports/fontconfig/portfile.cmake | 3 +- ports/freetype/portfile.cmake | 3 +- ports/harfbuzz/portfile.cmake | 3 +- ports/icu/portfile.cmake | 2 + ports/libjpeg-turbo/portfile.cmake | 4 +- ports/liblzma/portfile.cmake | 3 +- ports/libpng/portfile.cmake | 3 +- ports/openssl-unix/portfile.cmake | 7 +- ports/pcre2/portfile.cmake | 3 +- ports/sqlite3/portfile.cmake | 1 + ports/zlib/portfile.cmake | 5 +- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_pkgconfig.cmake | 88 ++++++++++++++++++++++ scripts/templates/debug.pc.in | 14 ++++ scripts/templates/release.pc.in | 14 ++++ toolsrc/include/vcpkg/sourceparagraph.h | 10 +++ toolsrc/src/tests.paragraph.cpp | 19 +++++ toolsrc/src/vcpkg/build.cpp | 6 ++ toolsrc/src/vcpkg/sourceparagraph.cpp | 26 +++++++ 22 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 scripts/cmake/vcpkg_pkgconfig.cmake create mode 100644 scripts/templates/debug.pc.in create mode 100644 scripts/templates/release.pc.in diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index 25e3df10f11ecb..91bae8a4fb668d 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -1,5 +1,5 @@ include(vcpkg_common_functions) -set(BZIP2_VERSION 1.0.6) +set(BZIP2_VERSION ${PORT_VERSION}) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/past-due/bzip2-mirror/releases/download/v${BZIP2_VERSION}/bzip2-${BZIP2_VERSION}.tar.gz" FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" @@ -40,3 +40,4 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/ file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) vcpkg_test_cmake(PACKAGE_NAME BZip2 MODULE) +vcpkg_pkgconfig(RELEASE -lbz2 DEBUG -lbz2d) diff --git a/ports/double-conversion/portfile.cmake b/ports/double-conversion/portfile.cmake index d7fd15f219a5f0..62d37e213b6132 100644 --- a/ports/double-conversion/portfile.cmake +++ b/ports/double-conversion/portfile.cmake @@ -5,7 +5,7 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/double-conversion - REF v3.1.4 + REF v${PORT_VERSION} SHA512 715a34ace2ff74b79d80a8c003c16cfbf958ebc92264e28cc572e1a12a786e1df9678abb46f032c2be387495e1a3d02957b12fa4a245ec6cfe19ca637519ac3c HEAD_REF master ) @@ -28,3 +28,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/double-conversion/copyright COPYONLY) +vcpkg_pkgconfig() diff --git a/ports/expat/portfile.cmake b/ports/expat/portfile.cmake index 7e2c322db91dee..036ceed220a36c 100644 --- a/ports/expat/portfile.cmake +++ b/ports/expat/portfile.cmake @@ -45,3 +45,4 @@ endif() file(WRITE ${CURRENT_PACKAGES_DIR}/include/expat_external.h "${EXPAT_EXTERNAL_H}") file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat) +vcpkg_pkgconfig() diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index 772e741fd3c700..cb0b81a13ba723 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) -set(FONTCONFIG_VERSION 2.12.4) +set(FONTCONFIG_VERSION ${PORT_VERSION}) vcpkg_download_distfile(ARCHIVE URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz" FILENAME "fontconfig-${FONTCONFIG_VERSION}.tar.gz" @@ -49,3 +49,4 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontc file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright) vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig) +vcpkg_pkgconfig(REQUIRES expat freetype2) diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 39d462a3498ea0..3863f786697412 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) -set(FT_VERSION 2.10.0) +set(FT_VERSION ${PORT_VERSION}) vcpkg_download_distfile(ARCHIVE URLS "https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${FT_VERSION}.tar.bz2" "https://downloads.sourceforge.net/project/freetype/freetype2/${FT_VERSION}/freetype-${FT_VERSION}.tar.bz2" FILENAME "freetype-${FT_VERSION}.tar.bz2" @@ -86,3 +86,4 @@ vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/freetype) endif() +vcpkg_pkgconfig(NAME freetype2 RELEASE -lfreetype DEBUG -lfreetyped) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index d7fbd9a0d6a0ed..3c4f4c691e81f0 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO harfbuzz/harfbuzz - REF 2.5.1 + REF ${PORT_VERSION} SHA512 e8b4b98e65d809579456551e4dd70bdd847d02cbfa80df479f6f544eff2bdbfaa7502f22e5f4e5217f063badc8874f6e568d49e9c40ab752b233fafa9e74aeab HEAD_REF master PATCHES @@ -89,3 +89,4 @@ endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz RENAME copyright) vcpkg_test_cmake(PACKAGE_NAME harfbuzz) +vcpkg_pkgconfig(REQUIRES freetype2) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 9225246f3d8309..5acd9ef55a3e37 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -223,3 +223,5 @@ vcpkg_copy_pdbs() # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/icu) file(RENAME ${CURRENT_PACKAGES_DIR}/share/icu/LICENSE ${CURRENT_PACKAGES_DIR}/share/icu/copyright) +vcpkg_pkgconfig(NAME icu-uc COMMON -licuuc -licudata -lpthread -ldl -lm) +vcpkg_pkgconfig(NAME icu-i18n COMMON -licui18n REQUIRES icu-uc) diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index a4fbb5b66291a0..0a9bd88c0baf64 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libjpeg-turbo/libjpeg-turbo - REF 2.0.2 + REF ${PORT_VERSION} SHA512 4dcde37ba014500cee69f7d49b359112655c177cf2c0003b4693bfe25f8a55147e9a87f58d31b4fc952a7faed6fecd5087220fd879110ade326922991f11c423 HEAD_REF master PATCHES @@ -86,3 +86,5 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/LICENSE.md ${CURRENT_PAC vcpkg_copy_pdbs() vcpkg_test_cmake(PACKAGE_NAME JPEG MODULE) +vcpkg_pkgconfig(NAME libjpeg COMMON -ljpeg) +vcpkg_pkgconfig(NAME libturbojpeg COMMON -lturbojpeg) diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake index e7260309ba7c46..e997c7b9396ecc 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xz-mirror/xz - REF v5.2.4 + REF v${PORT_VERSION} SHA512 fce7dc65e77a9b89dbdd6192cb37efc39e3f2cf343f79b54d2dfcd845025dab0e1d5b0f59c264eab04e5cbaf914eeb4818d14cdaac3ae0c1c5de24418656a4b7 HEAD_REF master PATCHES @@ -79,3 +79,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma RENAME copyright) +vcpkg_pkgconfig(RELEASE -llzma DEBUG -llzmad) diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 7262d34c72bb35..af97ca8ed2b3db 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO glennrp/libpng - REF v1.6.37 + REF v${PORT_VERSION} SHA512 ccb3705c23b2724e86d072e2ac8cfc380f41fadfd6977a248d588a8ad57b6abe0e4155e525243011f245e98d9b7afbe2e8cc7fd4ff7d82fcefb40c0f48f88918 HEAD_REF master PATCHES @@ -55,3 +55,4 @@ vcpkg_copy_pdbs() if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/png) endif() +vcpkg_pkgconfig(COMMON -lpng) diff --git a/ports/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake index a5915f1b9b6771..a1ba9936f2e073 100644 --- a/ports/openssl-unix/portfile.cmake +++ b/ports/openssl-unix/portfile.cmake @@ -13,10 +13,10 @@ endif() vcpkg_find_acquire_program(PERL) -set(OPENSSL_VERSION 1.0.2s) +set(OPENSSL_VERSION ${PORT_VERSION}) vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE - URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.0.2/openssl-${OPENSSL_VERSION}.tar.gz" + URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/${PORT_CMAKE_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" SHA512 9f745452c4f777df694158e95003cde78a2cf8199bc481a563ec36644664c3c1415a774779b9791dd18f2aeb57fa1721cb52b3db12d025955e970071d5b66d2a ) @@ -70,3 +70,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() vcpkg_test_cmake(PACKAGE_NAME OpenSSL MODULE) +vcpkg_pkgconfig(NAME libcrypto COMMON -lcrypto -ldl REQUIRES zlib) +vcpkg_pkgconfig(NAME libssl COMMON -lssl REQUIRES libcrypto) +vcpkg_pkgconfig(NAME openssl COMMON -lssl REQUIRES libcrypto) diff --git a/ports/pcre2/portfile.cmake b/ports/pcre2/portfile.cmake index 82b9014d11eba4..474d5dbca8930c 100644 --- a/ports/pcre2/portfile.cmake +++ b/ports/pcre2/portfile.cmake @@ -1,4 +1,4 @@ -set(PCRE2_VERSION 10.30) +set(PCRE2_VERSION ${PORT_VERSION}) include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE @@ -48,3 +48,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcre2) file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcre2/COPYING ${CURRENT_PACKAGES_DIR}/share/pcre2/copyright) +vcpkg_pkgconfig(NAME libpcre2-16 COMMON -lpcre2-16) diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 131469c12ca477..c2eae66c178c6f 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -44,3 +44,4 @@ configure_file( file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") vcpkg_copy_pdbs() +vcpkg_pkgconfig(COMMON -lsqlite3 -ldl -lpthread) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 78030309b1b2a3..156ee54eca7e23 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(VERSION 1.2.11) +set(VERSION ${PORT_VERSION}) vcpkg_download_distfile(ARCHIVE_FILE URLS "http://www.zlib.net/zlib-${VERSION}.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/${VERSION}/zlib-${VERSION}.tar.gz" - FILENAME "zlib1211.tar.gz" + FILENAME "zlib-${VERSION}.tar.gz" SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae ) @@ -48,3 +48,4 @@ vcpkg_copy_pdbs() file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) vcpkg_test_cmake(PACKAGE_NAME ZLIB MODULE) +vcpkg_pkgconfig(COMMON -lz) diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 515b2bafe46cd2..ad0cb85d005153 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -32,4 +32,5 @@ include(vcpkg_get_windows_sdk) include(vcpkg_replace_string) include(vcpkg_from_git) include(vcpkg_test_cmake) +include(vcpkg_pkgconfig) include(vcpkg_prettify_command) diff --git a/scripts/cmake/vcpkg_pkgconfig.cmake b/scripts/cmake/vcpkg_pkgconfig.cmake new file mode 100644 index 00000000000000..717f5a47b65431 --- /dev/null +++ b/scripts/cmake/vcpkg_pkgconfig.cmake @@ -0,0 +1,88 @@ +## # vcpkg_pkgconfig +## +## Create pkgconfig files. Function does nothing on windows. +## +## ## Usage +## ```cmake +## vcpkg_pkgconfig( +## [NAME <${PORT}>] +## [REMOVE] +## [COMMON <-l${PORT}>...] +## [RELEASE ...] +## [DEBUG ...] +## [DEPENDS ...] +## [DEPENDS_RELEASE ...] +## [DEPENDS_DEBUG ...] +## ) +## ``` +## +## ## Parameters +## ### NAME +## Specifies the name of pc file. By default `${PORT}` is used as name. +## +## ### REMOVE +## Remove pkgconfig directory before creating pc files. +## +## ### COMMON +## Common libraries for `Libs:` section +## +## ### RELEASE +## Additional Release libraries. These are in addition to `COMMON`. +## +## ### DEBUG +## Additional Debug libraries. These are in addition to `COMMON`. +## +## ### REQUIRES +## Common dependencies for `Requires:` section +## +## ### REQUIRES_RELEASE +## Additional Release dependencies. These are in addition to `REQUIRES`. +## +## ### REQUIRES_DEBUG +## Additional Debug dependencies. These are in addition to `REQUIRES`. +## +## ## Notes +## If libraries are not specified `-l${PORT}` used. +## If dependencies are not specified, port dependencies are used. +## +function(vcpkg_pkgconfig) + if(CMAKE_HOST_WIN32) + return() + endif() + cmake_parse_arguments(_pc "REMOVE" "NAME" "COMMON;RELEASE;DEBUG;REQUIRES;REQUIRES_RELEASE;REQUIRES_DEBUG" ${ARGN}) + set(PORT_LIBS_RELEASE ${_pc_COMMON} ${_pc_RELEASE}) + set(PORT_LIBS_DEBUG ${_pc_COMMON} ${_pc_DEBUG}) + if(NOT PORT_LIBS_RELEASE) + set(PORT_LIBS_RELEASE "-l${PORT}") + endif() + if(NOT PORT_LIBS_DEBUG) + set(PORT_LIBS_DEBUG "-l${PORT}") + endif() + set(PORT_REQUIRES_RELEASE ${_pc_REQUIRES} ${_pc_REQUIRES_RELEASE}) + set(PORT_REQUIRES_DEBUG ${_pc_REQUIRES} ${_pc_REQUIRES_DEBUG}) + if(NOT PORT_REQUIRES_RELEASE) + set(PORT_REQUIRES_RELEASE ${PORT_DEPENDENCIES}) + endif() + if(NOT PORT_REQUIRES_DEBUG) + set(PORT_REQUIRES_DEBUG ${PORT_DEPENDENCIES}) + endif() + if(NOT _pc_NAME) + set(_pc_NAME ${PORT}) + endif() + list(JOIN PORT_LIBS_RELEASE " " PORT_LIBS_RELEASE) + list(JOIN PORT_LIBS_DEBUG " " PORT_LIBS_DEBUG) + list(JOIN PORT_REQUIRES_RELEASE ", " PORT_REQUIRES_RELEASE) + list(JOIN PORT_REQUIRES_DEBUG ", " PORT_REQUIRES_DEBUG) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + if(_pc_REMOVE) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig") + endif() + configure_file("${VCPKG_ROOT_DIR}/scripts/templates/release.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${_pc_NAME}.pc" @ONLY) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(_pc_REMOVE) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") + endif() + configure_file("${VCPKG_ROOT_DIR}/scripts/templates/debug.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_pc_NAME}.pc" @ONLY) + endif() +endfunction() diff --git a/scripts/templates/debug.pc.in b/scripts/templates/debug.pc.in new file mode 100644 index 00000000000000..240bec1b215abc --- /dev/null +++ b/scripts/templates/debug.pc.in @@ -0,0 +1,14 @@ +prefix=@CURRENT_INSTALLED_DIR@ +exec_prefix=${prefix} +libdir=${prefix}/debug/lib +includedir=${prefix}/include + +Name: @PORT@ +URL: @PORT_HOMEPAGE@ +Description: @PORT_DESCRIPTION@ +Version: @PORT_COMPATIBLE_VERSION@ +Requires: @PORT_REQUIRES_DEBUG@ +Requires.private: +Libs: -L${libdir} @PORT_LIBS_DEBUG@ +Libs.private: +Cflags: -I${includedir} \ No newline at end of file diff --git a/scripts/templates/release.pc.in b/scripts/templates/release.pc.in new file mode 100644 index 00000000000000..72976575309027 --- /dev/null +++ b/scripts/templates/release.pc.in @@ -0,0 +1,14 @@ +prefix=@CURRENT_INSTALLED_DIR@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: @PORT@ +URL: @PORT_HOMEPAGE@ +Description: @PORT_DESCRIPTION@ +Version: @PORT_VERSION@ +Requires: @PORT_REQUIRES_RELEASE@ +Requires.private: +Libs: -L${libdir} @PORT_LIBS_RELEASE@ +Libs.private: +Cflags: -I${includedir} \ No newline at end of file diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index 6232a3fd292440..5b9ff3d42e7058 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -29,6 +29,16 @@ namespace vcpkg std::string to_string(const Dependency& dep); + /// + /// Port version does not have packaging suffix, 1.2.3-1 -> 1.2.3 + /// + std::string to_port_version(std::string version); + + /// + /// Cmake version has up to 4 components and has only digits in each component 1.2.3a -> 1.2.3 + /// + std::string to_cmake_version(std::string version); + /// /// Port metadata of additional feature in a package (part of CONTROL file) /// diff --git a/toolsrc/src/tests.paragraph.cpp b/toolsrc/src/tests.paragraph.cpp index e99d07694e7013..2bab9461571862 100644 --- a/toolsrc/src/tests.paragraph.cpp +++ b/toolsrc/src/tests.paragraph.cpp @@ -437,5 +437,24 @@ namespace UnitTest1 Assert::AreEqual(size_t(1), pghs.size()); Assert::AreEqual("123abc", pghs[0]["Abi"].c_str()); } + + TEST_METHOD(to_port_version) + { + Assert::AreEqual("1.2.3", vcpkg::to_port_version("1.2.3-1").c_str()); + Assert::AreEqual("1.2.3", vcpkg::to_port_version("1.2.3-").c_str()); + Assert::AreEqual("1.2.3", vcpkg::to_port_version("1.2.3").c_str()); + Assert::AreEqual("", vcpkg::to_port_version("").c_str()); + Assert::AreEqual("", vcpkg::to_port_version("-1").c_str()); + } + + TEST_METHOD(to_cmake_version) + { + Assert::AreEqual("1.2.3", vcpkg::to_cmake_version("1.2.3-1").c_str()); + Assert::AreEqual("1.2.3", vcpkg::to_cmake_version("1.2.3a-1").c_str()); + Assert::AreEqual("1.2.3.4", vcpkg::to_cmake_version("1.2.3.4.5").c_str()); + Assert::AreEqual("1.2.3", vcpkg::to_cmake_version("1.2.3").c_str()); + Assert::AreEqual("", vcpkg::to_port_version("").c_str()); + Assert::AreEqual("", vcpkg::to_port_version("-1").c_str()); + } }; } diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 1975d3aaf31632..1f1199dc807308 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -405,6 +405,12 @@ namespace vcpkg::Build {"FEATURES", Strings::join(";", config.feature_list)}, {"ALL_FEATURES", all_features}, {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, + {"PORT_FULL_VERSION", config.scf.core_paragraph->version}, + {"PORT_VERSION", to_port_version(config.scf.core_paragraph->version)}, + {"PORT_CMAKE_VERSION", to_cmake_version(config.scf.core_paragraph->version)}, + {"PORT_DESCRIPTION", config.scf.core_paragraph->description}, + {"PORT_HOMEPAGE", config.scf.core_paragraph->homepage}, + {"PORT_DEPENDENCIES", Strings::join(";", filter_dependencies(config.scf.core_paragraph->depends, triplet))}, }; if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) diff --git a/toolsrc/src/vcpkg/sourceparagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp index 9bc59cbe71be77..6d541b00fa1499 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -245,6 +245,32 @@ namespace vcpkg std::string to_string(const Dependency& dep) { return dep.name(); } + std::string to_port_version(std::string version) + { + auto pos = version.find('-'); + if (pos != version.npos) { version.erase(pos); } + return version; + } + + std::string to_cmake_version(std::string version) + { + auto versions = Strings::split(version, "."); + if (versions.size() > 4) { versions.erase(versions.begin() + 4, versions.end()); } + version.clear(); + for (auto& v : versions) + { + size_t i = 0; + for (; i < v.size(); ++i) + { + if (v[i] < '0' || v[i] > '9') { break; } + } + if (i == 0) { return version; } + if (!version.empty()) { version.append("."); } + version.append(v.begin(), v.begin() + i); + } + return version; + } + ExpectedT> Supports::parse(const std::vector& strs) { Supports ret; From dc6ee8e40c20e91993e916e2b5eb61a85fee3a02 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Tue, 2 Jul 2019 14:11:36 +0100 Subject: [PATCH 02/13] Enable pkgconfig on windows too --- scripts/cmake/vcpkg_pkgconfig.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_pkgconfig.cmake b/scripts/cmake/vcpkg_pkgconfig.cmake index 717f5a47b65431..3801a6800afa71 100644 --- a/scripts/cmake/vcpkg_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_pkgconfig.cmake @@ -1,6 +1,6 @@ ## # vcpkg_pkgconfig ## -## Create pkgconfig files. Function does nothing on windows. +## Create pkgconfig files. ## ## ## Usage ## ```cmake @@ -46,9 +46,6 @@ ## If dependencies are not specified, port dependencies are used. ## function(vcpkg_pkgconfig) - if(CMAKE_HOST_WIN32) - return() - endif() cmake_parse_arguments(_pc "REMOVE" "NAME" "COMMON;RELEASE;DEBUG;REQUIRES;REQUIRES_RELEASE;REQUIRES_DEBUG" ${ARGN}) set(PORT_LIBS_RELEASE ${_pc_COMMON} ${_pc_RELEASE}) set(PORT_LIBS_DEBUG ${_pc_COMMON} ${_pc_DEBUG}) From 885d3912b982578e69905db9493b7d67458b553f Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Thu, 4 Jul 2019 10:42:24 +0100 Subject: [PATCH 03/13] more configs, remove windows generation --- ports/fontconfig/CONTROL | 2 +- ports/gettext/CONTROL | 2 +- ports/glib/CONTROL | 2 +- ports/glib/portfile.cmake | 7 ++++++- ports/icu/portfile.cmake | 2 +- ports/libffi/portfile.cmake | 3 ++- ports/pcre/portfile.cmake | 9 +++++++-- ports/pcre2/portfile.cmake | 3 +++ ports/sqlite3/portfile.cmake | 2 +- scripts/cmake/vcpkg_pkgconfig.cmake | 5 ++++- scripts/templates/debug.pc.in | 6 ++---- scripts/templates/release.pc.in | 4 +--- 12 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index fbcc3f53674b8b..dc7e64646f2636 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -2,4 +2,4 @@ Source: fontconfig Version: 2.12.4-9 Homepage: https://www.freedesktop.org/software/fontconfig/front.html Description: Library for configuring and customizing font access. -Build-Depends: freetype, expat, libiconv, dirent +Build-Depends: freetype, expat, libiconv, dirent (uwp) diff --git a/ports/gettext/CONTROL b/ports/gettext/CONTROL index a6adfefc63e888..60b30a809f04da 100644 --- a/ports/gettext/CONTROL +++ b/ports/gettext/CONTROL @@ -2,4 +2,4 @@ Source: gettext Version: 0.19-10 Homepage: https://www.gnu.org/software/gettext/ Description: The GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. Provides libintl. -Build-Depends: libiconv +Build-Depends: libiconv (uwp) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index e589ba426fbd66..e191c557125fd0 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -2,4 +2,4 @@ Source: glib Version: 2.52.3-14-2 Homepage: https://developer.gnome.org/glib/ Description: Portable, general-purpose utility library. -Build-Depends: zlib, pcre, libffi, gettext, libiconv +Build-Depends: zlib, pcre, libffi, gettext (uwp|osx) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index 44a49932032f59..082bf249c5c1d8 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -10,7 +10,7 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME) vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) endif() -set(GLIB_VERSION 2.52.3) +set(GLIB_VERSION ${PORT_VERSION}) vcpkg_download_distfile(ARCHIVE URLS "https://ftp.gnome.org/pub/gnome/sources/glib/2.52/glib-${GLIB_VERSION}.tar.xz" FILENAME "glib-${GLIB_VERSION}.tar.xz" @@ -50,3 +50,8 @@ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) +vcpkg_pkgconfig(NAME glib-2.0 COMMON -lglib-2.0 REQUIRES zlib libpcre) +vcpkg_pkgconfig(NAME gmodule-2.0 COMMON -lgmodule-2.0 REQUIRES glib-2.0) +vcpkg_pkgconfig(NAME gobject-2.0 COMMON -lgobject-2.0 REQUIRES glib-2.0 libffi) +vcpkg_pkgconfig(NAME gthread-2.0 COMMON -lgthread-2.0 REQUIRES glib-2.0) +vcpkg_pkgconfig(NAME gio-2.0 COMMON -lgio-2.0 REQUIRES gobject-2.0 gmodule-2.0) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 5acd9ef55a3e37..e14a7299417389 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -223,5 +223,5 @@ vcpkg_copy_pdbs() # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/icu) file(RENAME ${CURRENT_PACKAGES_DIR}/share/icu/LICENSE ${CURRENT_PACKAGES_DIR}/share/icu/copyright) -vcpkg_pkgconfig(NAME icu-uc COMMON -licuuc -licudata -lpthread -ldl -lm) +vcpkg_pkgconfig(NAME icu-uc COMMON -licuuc -licudata -lpthread -pthread -ldl -lm) vcpkg_pkgconfig(NAME icu-i18n COMMON -licui18n REQUIRES icu-uc) diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake index bbb4daf83992db..2b023ef0596e5a 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -9,7 +9,7 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libffi/libffi - REF v3.1 + REF v${PORT_VERSION} SHA512 b214e4a876995f44e0a93bad5bf1b3501ea1fbedafbf33ea600007bd08c9bc965a1f0dd90ea870281c3add6c051febd19aa6cdce36f3ee8ba535ba2c0703153c HEAD_REF master PATCHES @@ -40,3 +40,4 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libffi) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libffi/LICENSE ${CURRENT_PACKAGES_DIR}/share/libffi/copyright) +vcpkg_pkgconfig() diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index ac99a478bfe3fb..14ea292afae79a 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -6,7 +6,7 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -set(PCRE_VERSION 8.41) +set(PCRE_VERSION ${PORT_VERSION}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-${PCRE_VERSION}) vcpkg_download_distfile(ARCHIVE @@ -66,4 +66,9 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcre) file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcre/COPYING ${CURRENT_PACKAGES_DIR}/share/pcre/copyright) -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() +vcpkg_pkgconfig(NAME libpcre COMMON -lpcre -lpthread -pthread) +vcpkg_pkgconfig(NAME libpcre-16 COMMON -lpcre-16 -pthread) +vcpkg_pkgconfig(NAME libpcre-32 COMMON -lpcre-32 -pthread) +vcpkg_pkgconfig(NAME libpcre-cpp COMMON -lpcre-cpp REQUIRES libpcre-8) +vcpkg_pkgconfig(NAME libpcre-posix COMMON -lpcre-posix REQUIRES libpcre-8) diff --git a/ports/pcre2/portfile.cmake b/ports/pcre2/portfile.cmake index 474d5dbca8930c..8afbec2a335ce1 100644 --- a/ports/pcre2/portfile.cmake +++ b/ports/pcre2/portfile.cmake @@ -48,4 +48,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcre2) file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcre2/COPYING ${CURRENT_PACKAGES_DIR}/share/pcre2/copyright) +vcpkg_pkgconfig(NAME libpcre2-8 COMMON -lpcre2-8) vcpkg_pkgconfig(NAME libpcre2-16 COMMON -lpcre2-16) +vcpkg_pkgconfig(NAME libpcre2-32 COMMON -lpcre2-32) +vcpkg_pkgconfig(NAME libpcre2-posix COMMON -lpcre2-posix REQUIRES libpcre2-8) diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index c2eae66c178c6f..d82763b9a64cb9 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -44,4 +44,4 @@ configure_file( file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") vcpkg_copy_pdbs() -vcpkg_pkgconfig(COMMON -lsqlite3 -ldl -lpthread) +vcpkg_pkgconfig(COMMON -lsqlite3 -ldl -lpthread -pthread) diff --git a/scripts/cmake/vcpkg_pkgconfig.cmake b/scripts/cmake/vcpkg_pkgconfig.cmake index 3801a6800afa71..717f5a47b65431 100644 --- a/scripts/cmake/vcpkg_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_pkgconfig.cmake @@ -1,6 +1,6 @@ ## # vcpkg_pkgconfig ## -## Create pkgconfig files. +## Create pkgconfig files. Function does nothing on windows. ## ## ## Usage ## ```cmake @@ -46,6 +46,9 @@ ## If dependencies are not specified, port dependencies are used. ## function(vcpkg_pkgconfig) + if(CMAKE_HOST_WIN32) + return() + endif() cmake_parse_arguments(_pc "REMOVE" "NAME" "COMMON;RELEASE;DEBUG;REQUIRES;REQUIRES_RELEASE;REQUIRES_DEBUG" ${ARGN}) set(PORT_LIBS_RELEASE ${_pc_COMMON} ${_pc_RELEASE}) set(PORT_LIBS_DEBUG ${_pc_COMMON} ${_pc_DEBUG}) diff --git a/scripts/templates/debug.pc.in b/scripts/templates/debug.pc.in index 240bec1b215abc..307be3a512b01c 100644 --- a/scripts/templates/debug.pc.in +++ b/scripts/templates/debug.pc.in @@ -6,9 +6,7 @@ includedir=${prefix}/include Name: @PORT@ URL: @PORT_HOMEPAGE@ Description: @PORT_DESCRIPTION@ -Version: @PORT_COMPATIBLE_VERSION@ +Version: @PORT_VERSION@ Requires: @PORT_REQUIRES_DEBUG@ -Requires.private: Libs: -L${libdir} @PORT_LIBS_DEBUG@ -Libs.private: -Cflags: -I${includedir} \ No newline at end of file +Cflags: -I${includedir} diff --git a/scripts/templates/release.pc.in b/scripts/templates/release.pc.in index 72976575309027..f3ea60f6614b6c 100644 --- a/scripts/templates/release.pc.in +++ b/scripts/templates/release.pc.in @@ -8,7 +8,5 @@ URL: @PORT_HOMEPAGE@ Description: @PORT_DESCRIPTION@ Version: @PORT_VERSION@ Requires: @PORT_REQUIRES_RELEASE@ -Requires.private: Libs: -L${libdir} @PORT_LIBS_RELEASE@ -Libs.private: -Cflags: -I${includedir} \ No newline at end of file +Cflags: -I${includedir} From d127fbe86b7e5b94bf71dace4e94da276df9f1f4 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Mon, 8 Jul 2019 13:34:36 +0100 Subject: [PATCH 04/13] Added missed windows dependecies --- ports/fontconfig/CONTROL | 2 +- ports/gettext/CONTROL | 2 +- ports/glib/CONTROL | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index dc7e64646f2636..628eb4f9c8f426 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -2,4 +2,4 @@ Source: fontconfig Version: 2.12.4-9 Homepage: https://www.freedesktop.org/software/fontconfig/front.html Description: Library for configuring and customizing font access. -Build-Depends: freetype, expat, libiconv, dirent (uwp) +Build-Depends: freetype, expat, libiconv (windows|uwp), dirent (windows|uwp) diff --git a/ports/gettext/CONTROL b/ports/gettext/CONTROL index 60b30a809f04da..24aaa2416a9657 100644 --- a/ports/gettext/CONTROL +++ b/ports/gettext/CONTROL @@ -2,4 +2,4 @@ Source: gettext Version: 0.19-10 Homepage: https://www.gnu.org/software/gettext/ Description: The GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. Provides libintl. -Build-Depends: libiconv (uwp) +Build-Depends: libiconv (windows|uwp) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index e191c557125fd0..3bbbb02a22f373 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -2,4 +2,4 @@ Source: glib Version: 2.52.3-14-2 Homepage: https://developer.gnome.org/glib/ Description: Portable, general-purpose utility library. -Build-Depends: zlib, pcre, libffi, gettext (uwp|osx) +Build-Depends: zlib, pcre, libffi, gettext (!linux) From 10fa9790d4f8d33580c13971968393451a188a5f Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Mon, 8 Jul 2019 14:21:57 +0100 Subject: [PATCH 05/13] fix dependencies syntax --- ports/fontconfig/CONTROL | 2 +- ports/gettext/CONTROL | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index 628eb4f9c8f426..409d7881964cab 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -2,4 +2,4 @@ Source: fontconfig Version: 2.12.4-9 Homepage: https://www.freedesktop.org/software/fontconfig/front.html Description: Library for configuring and customizing font access. -Build-Depends: freetype, expat, libiconv (windows|uwp), dirent (windows|uwp) +Build-Depends: freetype, expat, libiconv (!linux&!osx), dirent (!linux&!osx) diff --git a/ports/gettext/CONTROL b/ports/gettext/CONTROL index 24aaa2416a9657..dc6ac1479c641a 100644 --- a/ports/gettext/CONTROL +++ b/ports/gettext/CONTROL @@ -2,4 +2,4 @@ Source: gettext Version: 0.19-10 Homepage: https://www.gnu.org/software/gettext/ Description: The GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. Provides libintl. -Build-Depends: libiconv (windows|uwp) +Build-Depends: libiconv (!linux&!osx) From 406e954f29f15fe16989882c39ad68c18d617ab6 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Tue, 9 Jul 2019 12:10:04 +0100 Subject: [PATCH 06/13] WIP: Temporary remove changes to ports --- ports/bzip2/portfile.cmake | 3 +-- ports/double-conversion/portfile.cmake | 3 +-- ports/expat/portfile.cmake | 1 - ports/fontconfig/CONTROL | 2 +- ports/fontconfig/portfile.cmake | 3 +-- ports/freetype/portfile.cmake | 3 +-- ports/gettext/CONTROL | 2 +- ports/glib/CONTROL | 2 +- ports/glib/portfile.cmake | 7 +------ ports/harfbuzz/portfile.cmake | 3 +-- ports/icu/portfile.cmake | 2 -- ports/libffi/portfile.cmake | 3 +-- ports/libjpeg-turbo/portfile.cmake | 4 +--- ports/liblzma/portfile.cmake | 3 +-- ports/libpng/portfile.cmake | 3 +-- ports/openssl-unix/portfile.cmake | 7 ++----- ports/pcre/portfile.cmake | 9 ++------- ports/pcre2/portfile.cmake | 6 +----- ports/sqlite3/portfile.cmake | 1 - ports/zlib/portfile.cmake | 5 ++--- 20 files changed, 20 insertions(+), 52 deletions(-) diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index 91bae8a4fb668d..25e3df10f11ecb 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -1,5 +1,5 @@ include(vcpkg_common_functions) -set(BZIP2_VERSION ${PORT_VERSION}) +set(BZIP2_VERSION 1.0.6) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/past-due/bzip2-mirror/releases/download/v${BZIP2_VERSION}/bzip2-${BZIP2_VERSION}.tar.gz" FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" @@ -40,4 +40,3 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/ file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) vcpkg_test_cmake(PACKAGE_NAME BZip2 MODULE) -vcpkg_pkgconfig(RELEASE -lbz2 DEBUG -lbz2d) diff --git a/ports/double-conversion/portfile.cmake b/ports/double-conversion/portfile.cmake index 62d37e213b6132..d7fd15f219a5f0 100644 --- a/ports/double-conversion/portfile.cmake +++ b/ports/double-conversion/portfile.cmake @@ -5,7 +5,7 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/double-conversion - REF v${PORT_VERSION} + REF v3.1.4 SHA512 715a34ace2ff74b79d80a8c003c16cfbf958ebc92264e28cc572e1a12a786e1df9678abb46f032c2be387495e1a3d02957b12fa4a245ec6cfe19ca637519ac3c HEAD_REF master ) @@ -28,4 +28,3 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/double-conversion/copyright COPYONLY) -vcpkg_pkgconfig() diff --git a/ports/expat/portfile.cmake b/ports/expat/portfile.cmake index 036ceed220a36c..7e2c322db91dee 100644 --- a/ports/expat/portfile.cmake +++ b/ports/expat/portfile.cmake @@ -45,4 +45,3 @@ endif() file(WRITE ${CURRENT_PACKAGES_DIR}/include/expat_external.h "${EXPAT_EXTERNAL_H}") file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat) -vcpkg_pkgconfig() diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index 409d7881964cab..fbcc3f53674b8b 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -2,4 +2,4 @@ Source: fontconfig Version: 2.12.4-9 Homepage: https://www.freedesktop.org/software/fontconfig/front.html Description: Library for configuring and customizing font access. -Build-Depends: freetype, expat, libiconv (!linux&!osx), dirent (!linux&!osx) +Build-Depends: freetype, expat, libiconv, dirent diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index cb0b81a13ba723..772e741fd3c700 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) -set(FONTCONFIG_VERSION ${PORT_VERSION}) +set(FONTCONFIG_VERSION 2.12.4) vcpkg_download_distfile(ARCHIVE URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz" FILENAME "fontconfig-${FONTCONFIG_VERSION}.tar.gz" @@ -49,4 +49,3 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontc file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright) vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig) -vcpkg_pkgconfig(REQUIRES expat freetype2) diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 99d1c3377d0217..a5c2fde79fba7b 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) -set(FT_VERSION ${PORT_VERSION}) +set(FT_VERSION 2.10.0) vcpkg_download_distfile(ARCHIVE URLS "https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${FT_VERSION}.tar.bz2" "https://downloads.sourceforge.net/project/freetype/freetype2/${FT_VERSION}/freetype-${FT_VERSION}.tar.bz2" FILENAME "freetype-${FT_VERSION}.tar.bz2" @@ -81,4 +81,3 @@ vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/freetype) endif() -vcpkg_pkgconfig(NAME freetype2 RELEASE -lfreetype DEBUG -lfreetyped) diff --git a/ports/gettext/CONTROL b/ports/gettext/CONTROL index dc6ac1479c641a..a6adfefc63e888 100644 --- a/ports/gettext/CONTROL +++ b/ports/gettext/CONTROL @@ -2,4 +2,4 @@ Source: gettext Version: 0.19-10 Homepage: https://www.gnu.org/software/gettext/ Description: The GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. Provides libintl. -Build-Depends: libiconv (!linux&!osx) +Build-Depends: libiconv diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index 3bbbb02a22f373..e589ba426fbd66 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -2,4 +2,4 @@ Source: glib Version: 2.52.3-14-2 Homepage: https://developer.gnome.org/glib/ Description: Portable, general-purpose utility library. -Build-Depends: zlib, pcre, libffi, gettext (!linux) +Build-Depends: zlib, pcre, libffi, gettext, libiconv diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index 082bf249c5c1d8..44a49932032f59 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -10,7 +10,7 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME) vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) endif() -set(GLIB_VERSION ${PORT_VERSION}) +set(GLIB_VERSION 2.52.3) vcpkg_download_distfile(ARCHIVE URLS "https://ftp.gnome.org/pub/gnome/sources/glib/2.52/glib-${GLIB_VERSION}.tar.xz" FILENAME "glib-${GLIB_VERSION}.tar.xz" @@ -50,8 +50,3 @@ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) -vcpkg_pkgconfig(NAME glib-2.0 COMMON -lglib-2.0 REQUIRES zlib libpcre) -vcpkg_pkgconfig(NAME gmodule-2.0 COMMON -lgmodule-2.0 REQUIRES glib-2.0) -vcpkg_pkgconfig(NAME gobject-2.0 COMMON -lgobject-2.0 REQUIRES glib-2.0 libffi) -vcpkg_pkgconfig(NAME gthread-2.0 COMMON -lgthread-2.0 REQUIRES glib-2.0) -vcpkg_pkgconfig(NAME gio-2.0 COMMON -lgio-2.0 REQUIRES gobject-2.0 gmodule-2.0) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 3c4f4c691e81f0..d7fbd9a0d6a0ed 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO harfbuzz/harfbuzz - REF ${PORT_VERSION} + REF 2.5.1 SHA512 e8b4b98e65d809579456551e4dd70bdd847d02cbfa80df479f6f544eff2bdbfaa7502f22e5f4e5217f063badc8874f6e568d49e9c40ab752b233fafa9e74aeab HEAD_REF master PATCHES @@ -89,4 +89,3 @@ endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz RENAME copyright) vcpkg_test_cmake(PACKAGE_NAME harfbuzz) -vcpkg_pkgconfig(REQUIRES freetype2) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index e14a7299417389..9225246f3d8309 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -223,5 +223,3 @@ vcpkg_copy_pdbs() # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/icu) file(RENAME ${CURRENT_PACKAGES_DIR}/share/icu/LICENSE ${CURRENT_PACKAGES_DIR}/share/icu/copyright) -vcpkg_pkgconfig(NAME icu-uc COMMON -licuuc -licudata -lpthread -pthread -ldl -lm) -vcpkg_pkgconfig(NAME icu-i18n COMMON -licui18n REQUIRES icu-uc) diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake index 2b023ef0596e5a..bbb4daf83992db 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -9,7 +9,7 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libffi/libffi - REF v${PORT_VERSION} + REF v3.1 SHA512 b214e4a876995f44e0a93bad5bf1b3501ea1fbedafbf33ea600007bd08c9bc965a1f0dd90ea870281c3add6c051febd19aa6cdce36f3ee8ba535ba2c0703153c HEAD_REF master PATCHES @@ -40,4 +40,3 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libffi) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libffi/LICENSE ${CURRENT_PACKAGES_DIR}/share/libffi/copyright) -vcpkg_pkgconfig() diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index 0a9bd88c0baf64..a4fbb5b66291a0 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libjpeg-turbo/libjpeg-turbo - REF ${PORT_VERSION} + REF 2.0.2 SHA512 4dcde37ba014500cee69f7d49b359112655c177cf2c0003b4693bfe25f8a55147e9a87f58d31b4fc952a7faed6fecd5087220fd879110ade326922991f11c423 HEAD_REF master PATCHES @@ -86,5 +86,3 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/LICENSE.md ${CURRENT_PAC vcpkg_copy_pdbs() vcpkg_test_cmake(PACKAGE_NAME JPEG MODULE) -vcpkg_pkgconfig(NAME libjpeg COMMON -ljpeg) -vcpkg_pkgconfig(NAME libturbojpeg COMMON -lturbojpeg) diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake index e997c7b9396ecc..e7260309ba7c46 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xz-mirror/xz - REF v${PORT_VERSION} + REF v5.2.4 SHA512 fce7dc65e77a9b89dbdd6192cb37efc39e3f2cf343f79b54d2dfcd845025dab0e1d5b0f59c264eab04e5cbaf914eeb4818d14cdaac3ae0c1c5de24418656a4b7 HEAD_REF master PATCHES @@ -79,4 +79,3 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma RENAME copyright) -vcpkg_pkgconfig(RELEASE -llzma DEBUG -llzmad) diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index af97ca8ed2b3db..7262d34c72bb35 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO glennrp/libpng - REF v${PORT_VERSION} + REF v1.6.37 SHA512 ccb3705c23b2724e86d072e2ac8cfc380f41fadfd6977a248d588a8ad57b6abe0e4155e525243011f245e98d9b7afbe2e8cc7fd4ff7d82fcefb40c0f48f88918 HEAD_REF master PATCHES @@ -55,4 +55,3 @@ vcpkg_copy_pdbs() if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/png) endif() -vcpkg_pkgconfig(COMMON -lpng) diff --git a/ports/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake index a1ba9936f2e073..a5915f1b9b6771 100644 --- a/ports/openssl-unix/portfile.cmake +++ b/ports/openssl-unix/portfile.cmake @@ -13,10 +13,10 @@ endif() vcpkg_find_acquire_program(PERL) -set(OPENSSL_VERSION ${PORT_VERSION}) +set(OPENSSL_VERSION 1.0.2s) vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE - URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/${PORT_CMAKE_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" + URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.0.2/openssl-${OPENSSL_VERSION}.tar.gz" FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" SHA512 9f745452c4f777df694158e95003cde78a2cf8199bc481a563ec36644664c3c1415a774779b9791dd18f2aeb57fa1721cb52b3db12d025955e970071d5b66d2a ) @@ -70,6 +70,3 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() vcpkg_test_cmake(PACKAGE_NAME OpenSSL MODULE) -vcpkg_pkgconfig(NAME libcrypto COMMON -lcrypto -ldl REQUIRES zlib) -vcpkg_pkgconfig(NAME libssl COMMON -lssl REQUIRES libcrypto) -vcpkg_pkgconfig(NAME openssl COMMON -lssl REQUIRES libcrypto) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 14ea292afae79a..ac99a478bfe3fb 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -6,7 +6,7 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -set(PCRE_VERSION ${PORT_VERSION}) +set(PCRE_VERSION 8.41) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-${PCRE_VERSION}) vcpkg_download_distfile(ARCHIVE @@ -66,9 +66,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcre) file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcre/COPYING ${CURRENT_PACKAGES_DIR}/share/pcre/copyright) -vcpkg_copy_pdbs() -vcpkg_pkgconfig(NAME libpcre COMMON -lpcre -lpthread -pthread) -vcpkg_pkgconfig(NAME libpcre-16 COMMON -lpcre-16 -pthread) -vcpkg_pkgconfig(NAME libpcre-32 COMMON -lpcre-32 -pthread) -vcpkg_pkgconfig(NAME libpcre-cpp COMMON -lpcre-cpp REQUIRES libpcre-8) -vcpkg_pkgconfig(NAME libpcre-posix COMMON -lpcre-posix REQUIRES libpcre-8) +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/pcre2/portfile.cmake b/ports/pcre2/portfile.cmake index 8afbec2a335ce1..82b9014d11eba4 100644 --- a/ports/pcre2/portfile.cmake +++ b/ports/pcre2/portfile.cmake @@ -1,4 +1,4 @@ -set(PCRE2_VERSION ${PORT_VERSION}) +set(PCRE2_VERSION 10.30) include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE @@ -48,7 +48,3 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcre2) file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcre2/COPYING ${CURRENT_PACKAGES_DIR}/share/pcre2/copyright) -vcpkg_pkgconfig(NAME libpcre2-8 COMMON -lpcre2-8) -vcpkg_pkgconfig(NAME libpcre2-16 COMMON -lpcre2-16) -vcpkg_pkgconfig(NAME libpcre2-32 COMMON -lpcre2-32) -vcpkg_pkgconfig(NAME libpcre2-posix COMMON -lpcre2-posix REQUIRES libpcre2-8) diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index d82763b9a64cb9..131469c12ca477 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -44,4 +44,3 @@ configure_file( file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") vcpkg_copy_pdbs() -vcpkg_pkgconfig(COMMON -lsqlite3 -ldl -lpthread -pthread) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 156ee54eca7e23..78030309b1b2a3 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(VERSION ${PORT_VERSION}) +set(VERSION 1.2.11) vcpkg_download_distfile(ARCHIVE_FILE URLS "http://www.zlib.net/zlib-${VERSION}.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/${VERSION}/zlib-${VERSION}.tar.gz" - FILENAME "zlib-${VERSION}.tar.gz" + FILENAME "zlib1211.tar.gz" SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae ) @@ -48,4 +48,3 @@ vcpkg_copy_pdbs() file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) vcpkg_test_cmake(PACKAGE_NAME ZLIB MODULE) -vcpkg_pkgconfig(COMMON -lz) From 39356dec4ddff1224d1a0912387c9597382909cf Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Tue, 9 Jul 2019 15:07:18 +0100 Subject: [PATCH 07/13] pkgconfig for zlib --- ports/zlib/portfile.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 78030309b1b2a3..156ee54eca7e23 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(VERSION 1.2.11) +set(VERSION ${PORT_VERSION}) vcpkg_download_distfile(ARCHIVE_FILE URLS "http://www.zlib.net/zlib-${VERSION}.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/${VERSION}/zlib-${VERSION}.tar.gz" - FILENAME "zlib1211.tar.gz" + FILENAME "zlib-${VERSION}.tar.gz" SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae ) @@ -48,3 +48,4 @@ vcpkg_copy_pdbs() file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) vcpkg_test_cmake(PACKAGE_NAME ZLIB MODULE) +vcpkg_pkgconfig(COMMON -lz) From 3ad4324bd7b299e08e42fbbe7a246d45e1759779 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Tue, 12 May 2020 16:34:34 +0100 Subject: [PATCH 08/13] clean shell processed string from dangerous characters --- toolsrc/src/vcpkg/base/system.process.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index 4c7f712e5e1175..da596c8ce8d677 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -166,12 +166,22 @@ namespace vcpkg #endif } - System::CMakeVariable::CMakeVariable(const StringView varname, const char* varvalue) - : s(Strings::format(R"("-D%s=%s")", varname, varvalue)) + std::string clean_shell_string(std::string s) { + s = Strings::replace_all(std::move(s), "\\", StringView()); + s = Strings::replace_all(std::move(s), "`", StringView()); + s = Strings::replace_all(std::move(s), "'", StringView()); + s = Strings::replace_all(std::move(s), "\"", StringView()); + s = Strings::replace_all(std::move(s), "$", StringView()); + return s; } + System::CMakeVariable::CMakeVariable(const StringView varname, const std::string& varvalue) - : CMakeVariable(varname, varvalue.c_str()) + : s(Strings::format(R"("-D%s=%s")", varname, clean_shell_string(varvalue))) + { + } + System::CMakeVariable::CMakeVariable(const StringView varname, const char* varvalue) + : CMakeVariable(varname, std::string(varvalue)) { } System::CMakeVariable::CMakeVariable(const StringView varname, const fs::path& path) From e1f890f27a3a8cd13fd4fa7b61e38c7bbca6de3b Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Wed, 13 May 2020 11:44:56 +0100 Subject: [PATCH 09/13] clean only description value --- toolsrc/include/vcpkg/base/strings.h | 2 ++ toolsrc/src/vcpkg-test/strings.cpp | 10 ++++++++++ toolsrc/src/vcpkg/base/strings.cpp | 17 +++++++++++++++++ toolsrc/src/vcpkg/base/system.process.cpp | 16 +++------------- toolsrc/src/vcpkg/build.cpp | 2 +- 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 481e686d11088a..6d9d6a2cae7e52 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -198,4 +198,6 @@ namespace vcpkg::Strings // base 32 encoding, following IETC RFC 4648 std::string b32_encode(std::uint64_t x) noexcept; + + std::string clean_shell_string(std::string s); } diff --git a/toolsrc/src/vcpkg-test/strings.cpp b/toolsrc/src/vcpkg-test/strings.cpp index d58d1b17256b41..00882bb21e2d7f 100644 --- a/toolsrc/src/vcpkg-test/strings.cpp +++ b/toolsrc/src/vcpkg-test/strings.cpp @@ -31,3 +31,13 @@ TEST_CASE ("b32 encoding", "[strings]") REQUIRE(vcpkg::Strings::b32_encode(pr.first) == pr.second); } } + +TEST_CASE ("clean_shell_string", "[strings]") +{ + REQUIRE(vcpkg::Strings::clean_shell_string("") == ""); + REQUIRE(vcpkg::Strings::clean_shell_string("\n") == " "); + REQUIRE(vcpkg::Strings::clean_shell_string("\r\\\"`$") == ""); + REQUIRE(vcpkg::Strings::clean_shell_string("`123") == "123"); + REQUIRE(vcpkg::Strings::clean_shell_string("123`") == "123"); + REQUIRE(vcpkg::Strings::clean_shell_string("`1`2`3`") == "123"); +} diff --git a/toolsrc/src/vcpkg/base/strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp index 46e78a36346783..b61a8f400e9f93 100644 --- a/toolsrc/src/vcpkg/base/strings.cpp +++ b/toolsrc/src/vcpkg/base/strings.cpp @@ -328,3 +328,20 @@ namespace vcpkg::Strings std::string b32_encode(std::uint64_t x) noexcept { return b32_encode_implementation(x); } } + +std::string Strings::clean_shell_string(std::string s) +{ + for (int pos = static_cast(s.size()); pos >= 0; --pos) + { + auto c = s[pos]; + if (c == '\n') + { + s[pos] = ' '; + } + else if (c == '\r' || c == '\\' || c == '`' || c == '"' || c == '$') + { + s.erase(pos, 1); + } + } + return std::move(s); +} diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index da596c8ce8d677..4c7f712e5e1175 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -166,22 +166,12 @@ namespace vcpkg #endif } - std::string clean_shell_string(std::string s) + System::CMakeVariable::CMakeVariable(const StringView varname, const char* varvalue) + : s(Strings::format(R"("-D%s=%s")", varname, varvalue)) { - s = Strings::replace_all(std::move(s), "\\", StringView()); - s = Strings::replace_all(std::move(s), "`", StringView()); - s = Strings::replace_all(std::move(s), "'", StringView()); - s = Strings::replace_all(std::move(s), "\"", StringView()); - s = Strings::replace_all(std::move(s), "$", StringView()); - return s; } - System::CMakeVariable::CMakeVariable(const StringView varname, const std::string& varvalue) - : s(Strings::format(R"("-D%s=%s")", varname, clean_shell_string(varvalue))) - { - } - System::CMakeVariable::CMakeVariable(const StringView varname, const char* varvalue) - : CMakeVariable(varname, std::string(varvalue)) + : CMakeVariable(varname, varvalue.c_str()) { } System::CMakeVariable::CMakeVariable(const StringView varname, const fs::path& path) diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index d3f2f912f39d50..739c37b4ed6452 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -387,7 +387,7 @@ namespace vcpkg::Build variables.emplace("PORT_FULL_VERSION", scf.core_paragraph->version); variables.emplace("PORT_VERSION", to_port_version(scf.core_paragraph->version)); variables.emplace("PORT_CMAKE_VERSION", to_cmake_version(scf.core_paragraph->version)); - variables.emplace("PORT_DESCRIPTION", scf.core_paragraph->description); + variables.emplace("PORT_DESCRIPTION", Strings::clean_shell_string(scf.core_paragraph->description)); variables.emplace("PORT_HOMEPAGE", scf.core_paragraph->homepage); if (Util::Enum::to_bool(action.build_options.only_downloads)) From 4f6a328f43fa68341b6de71ea4ee8c14f8214203 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Wed, 13 May 2020 12:20:08 +0100 Subject: [PATCH 10/13] print exit code value --- toolsrc/src/vcpkg/base/checks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg/base/checks.cpp b/toolsrc/src/vcpkg/base/checks.cpp index 42e0835c6bcdeb..ab89571bbf53e8 100644 --- a/toolsrc/src/vcpkg/base/checks.cpp +++ b/toolsrc/src/vcpkg/base/checks.cpp @@ -50,7 +50,7 @@ namespace vcpkg [[noreturn]] void Checks::exit_with_code(const LineInfo& line_info, const int exit_code) { - Debug::print(System::Color::error, line_info, '\n'); + Debug::print(System::Color::error, line_info, " exit code = ", exit_code, '\n'); final_cleanup_and_exit(exit_code); } From c5c36d5485dee042dd0fce5fcc9cd8301cde0071 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Wed, 13 May 2020 15:50:50 +0100 Subject: [PATCH 11/13] attempt to trigger full rebuild --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index b2faa4abe3a0cf..dba3e1a8b6c1b8 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -194,5 +194,3 @@ function(vcpkg_fixup_cmake_targets) file(WRITE ${CMAKE_FILE} "${_contents}") endforeach() endfunction() - - From 4c686c6a69e2a68dd843a674172f27fd4df32bb5 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Mon, 18 May 2020 12:18:18 +0100 Subject: [PATCH 12/13] updated versions of affected ports --- ports/bzip2/CONTROL | 2 +- ports/double-conversion/CONTROL | 2 +- ports/expat/CONTROL | 2 +- ports/fontconfig/CONTROL | 2 +- ports/freetype/CONTROL | 2 +- ports/glib/CONTROL | 2 +- ports/harfbuzz/CONTROL | 2 +- ports/icu/CONTROL | 2 +- ports/libffi/CONTROL | 2 +- ports/libjpeg-turbo/CONTROL | 2 +- ports/liblzma/CONTROL | 2 +- ports/libpng/CONTROL | 2 +- ports/openssl-unix/CONTROL | 2 +- ports/pcre/CONTROL | 2 +- ports/pcre2/CONTROL | 2 +- ports/sqlite3/CONTROL | 2 +- ports/zlib/CONTROL | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ports/bzip2/CONTROL b/ports/bzip2/CONTROL index 695925c073b7c5..4734c417155908 100644 --- a/ports/bzip2/CONTROL +++ b/ports/bzip2/CONTROL @@ -1,4 +1,4 @@ Source: bzip2 -Version: 1.0.6-5 +Version: 1.0.6-6 Homepage: http://www.bzip.org/ Description: High-quality data compressor. diff --git a/ports/double-conversion/CONTROL b/ports/double-conversion/CONTROL index 215bb77fb0aa78..0fe92b337d468a 100644 --- a/ports/double-conversion/CONTROL +++ b/ports/double-conversion/CONTROL @@ -1,4 +1,4 @@ Source: double-conversion -Version: 3.1.5 +Version: 3.1.5-1 Homepage: https://github.com/google/double-conversion Description: Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles. diff --git a/ports/expat/CONTROL b/ports/expat/CONTROL index 9007da6cdd7703..77af3d48254a6b 100644 --- a/ports/expat/CONTROL +++ b/ports/expat/CONTROL @@ -1,5 +1,5 @@ Source: expat -Version: 2.2.7 +Version: 2.2.7-1 Homepage: https://github.com/libexpat/libexpat Description: XML parser library written in C Supports: !uwp \ No newline at end of file diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index d350c7fc4a25b2..3943b16cb93b46 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -1,5 +1,5 @@ Source: fontconfig -Version: 2.12.4-10 +Version: 2.12.4-11 Homepage: https://www.freedesktop.org/software/fontconfig/front.html Description: Library for configuring and customizing font access. Build-Depends: freetype, expat, libiconv, dirent diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 8503efed4f5239..1a62c628a26dca 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,5 +1,5 @@ Source: freetype -Version: 2.10.1-6 +Version: 2.10.1-7 Build-Depends: zlib Homepage: https://www.freetype.org/ Description: A library to render fonts. diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index e93f07ccb47612..643cad770054ad 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -1,5 +1,5 @@ Source: glib -Version: 2.52.3-14-6 +Version: 2.52.3-15 Homepage: https://developer.gnome.org/glib/ Description: Portable, general-purpose utility library. Build-Depends: zlib, pcre, libffi, gettext, libiconv diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 04c85fb5ca8bd3..0d1005ac0a97c0 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,5 +1,5 @@ Source: harfbuzz -Version: 2.5.3-1 +Version: 2.5.3-2 Description: HarfBuzz OpenType text shaping engine Homepage: https://github.com/behdad/harfbuzz Build-Depends: freetype[core], ragel, gettext (osx) diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL index c592e69f2616df..96b1c93527f919 100644 --- a/ports/icu/CONTROL +++ b/ports/icu/CONTROL @@ -1,5 +1,5 @@ Source: icu -Version: 65.1-4 +Version: 65.1-5 Homepage: http://icu-project.org/apiref/icu4c/ Description: Mature and widely used Unicode and localization library. Supports: !(arm|uwp) diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index 655f6023c83189..a16bd5b1cc4159 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,4 +1,4 @@ Source: libffi -Version: 3.3-2 +Version: 3.3-3 Homepage: https://github.com/libffi/libffi Description: Portable, high level programming interface to various calling conventions \ No newline at end of file diff --git a/ports/libjpeg-turbo/CONTROL b/ports/libjpeg-turbo/CONTROL index 42825d88363ee0..9e9098e4380df3 100644 --- a/ports/libjpeg-turbo/CONTROL +++ b/ports/libjpeg-turbo/CONTROL @@ -1,4 +1,4 @@ Source: libjpeg-turbo -Version: 2.0.4 +Version: 2.0.4-1 Homepage: https://github.com/libjpeg-turbo/libjpeg-turbo Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL index 465efb05472240..f770d15458e931 100644 --- a/ports/liblzma/CONTROL +++ b/ports/liblzma/CONTROL @@ -1,4 +1,4 @@ Source: liblzma -Version: 5.2.4-5 +Version: 5.2.4-6 Homepage: https://github.com/xz-mirror/xz Description: Compression library with an API similar to that of zlib. diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index 0258a720e625ff..f05692745ba359 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,5 +1,5 @@ Source: libpng -Version: 1.6.37-9 +Version: 1.6.37-10 Build-Depends: zlib Homepage: https://github.com/glennrp/libpng Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL index ca6094ae58a03a..0e1d8b8f6e24ef 100644 --- a/ports/openssl-unix/CONTROL +++ b/ports/openssl-unix/CONTROL @@ -1,4 +1,4 @@ Source: openssl-unix -Version: 1.1.1d-3 +Version: 1.1.1d-4 Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. Supports: !(windows|uwp) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index 58e40065ddb93c..4626a33b322838 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,4 +1,4 @@ Source: pcre -Version: 8.44 +Version: 8.44-1 Homepage: https://www.pcre.org/ Description: Perl Compatible Regular Expressions diff --git a/ports/pcre2/CONTROL b/ports/pcre2/CONTROL index 044bb81d36c138..b8109b744f37fd 100644 --- a/ports/pcre2/CONTROL +++ b/ports/pcre2/CONTROL @@ -1,4 +1,4 @@ Source: pcre2 -Version: 10.30-7 +Version: 10.30-8 Homepage: https://pcre.org/ Description: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL index 711e8a077731a1..b0c89681d6b166 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,5 +1,5 @@ Source: sqlite3 -Version: 3.31.1-1 +Version: 3.31.1-2 Homepage: https://sqlite.org/ Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index 601fb1bc0eda06..e9db7059b65b52 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,4 +1,4 @@ Source: zlib -Version: 1.2.11-6 +Version: 1.2.11-7 Homepage: https://www.zlib.net/ Description: A compression library From 829014eb70548b0d6418315f7b626d4cfc0d0350 Mon Sep 17 00:00:00 2001 From: Igor Kostenko Date: Mon, 18 May 2020 17:08:34 +0100 Subject: [PATCH 13/13] do not use error color on success --- toolsrc/src/vcpkg/base/checks.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg/base/checks.cpp b/toolsrc/src/vcpkg/base/checks.cpp index ab89571bbf53e8..7c2129b7729583 100644 --- a/toolsrc/src/vcpkg/base/checks.cpp +++ b/toolsrc/src/vcpkg/base/checks.cpp @@ -50,7 +50,8 @@ namespace vcpkg [[noreturn]] void Checks::exit_with_code(const LineInfo& line_info, const int exit_code) { - Debug::print(System::Color::error, line_info, " exit code = ", exit_code, '\n'); + Debug::print(exit_code == 0 ? System::Color::success : System::Color::error, + line_info, " exit code = ", exit_code, '\n'); final_cleanup_and_exit(exit_code); }