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/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index 0462d53eb6f809..991b780172b78e 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -41,3 +41,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/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/double-conversion/portfile.cmake b/ports/double-conversion/portfile.cmake index f5ebb40553dcc8..515c75b9f14b88 100644 --- a/ports/double-conversion/portfile.cmake +++ b/ports/double-conversion/portfile.cmake @@ -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/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/expat/portfile.cmake b/ports/expat/portfile.cmake index 7b97fb3de8f244..81b65bc9980424 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/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/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index db7692779ab379..f94d0cd7a26343 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -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/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/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 9dcf76fa14f146..6051ca1785b862 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -98,3 +98,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/freetype/vcpkg-cmake-wrapper.cmake @ONLY) endif() +vcpkg_pkgconfig(NAME freetype2 RELEASE -lfreetype DEBUG -lfreetyped) 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/glib/portfile.cmake b/ports/glib/portfile.cmake index 80c3c9a1c751c7..84bf28b6640785 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -55,3 +55,13 @@ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL STATIC) + set(_p0 ".0") +else() + set(_p0) +endif() +vcpkg_pkgconfig(NAME glib-2.0 COMMON -lglib-2${_p0} REQUIRES zlib libpcre) +vcpkg_pkgconfig(NAME gmodule-2.0 COMMON -lgmodule-2${_p0} REQUIRES glib-2.0) +vcpkg_pkgconfig(NAME gobject-2.0 COMMON -lgobject-2${_p0} REQUIRES glib-2.0 libffi) +vcpkg_pkgconfig(NAME gthread-2.0 COMMON -lgthread-2${_p0} REQUIRES glib-2.0) +vcpkg_pkgconfig(NAME gio-2.0 COMMON -lgio-2${_p0} REQUIRES gobject-2.0 gmodule-2.0) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 8e82f9d6e65800..8a1d90887eef3f 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -58,3 +58,4 @@ endif() # Handle copyright file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_pkgconfig(REQUIRES freetype2) diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL index e1427b39b61d25..282e5080eff347 100644 --- a/ports/icu/CONTROL +++ b/ports/icu/CONTROL @@ -1,5 +1,5 @@ Source: icu -Version: 67.1 +Version: 67.1-1 Homepage: http://icu-project.org/apiref/icu4c/ Description: Mature and widely used Unicode and localization library. Supports: !(arm|uwp) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 8e13583655ecd6..e7fd45133caa5a 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -223,3 +223,5 @@ vcpkg_copy_pdbs() # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME 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/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/libffi/portfile.cmake b/ports/libffi/portfile.cmake index 7209ce8d609216..145f58dc66e82a 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -32,4 +32,5 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) ) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_pkgconfig() 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/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index 893c25adbd7e27..d17592e7f7d3b9 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -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/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/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake index 8429dbbcaf5b22..83bfe472669eb8 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -88,4 +88,5 @@ endif() 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) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma RENAME copyright) +vcpkg_pkgconfig(RELEASE -llzma DEBUG -llzmad) 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/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 28fee46f3a4522..2ce399429045ef 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -83,3 +83,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/libpng) vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_pkgconfig(COMMON -lpng) 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/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake index 1c1bbae0c242db..6567f4f5ab35ac 100644 --- a/ports/openssl-unix/portfile.cmake +++ b/ports/openssl-unix/portfile.cmake @@ -66,3 +66,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/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/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 546494087190e2..e68b05d46dbbef 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -60,3 +60,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME 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) 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/pcre2/portfile.cmake b/ports/pcre2/portfile.cmake index 9057ede478e4bd..22b139e440ddb5 100644 --- a/ports/pcre2/portfile.cmake +++ b/ports/pcre2/portfile.cmake @@ -55,3 +55,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME 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/CONTROL b/ports/sqlite3/CONTROL index cf4e23139e544d..27da2b2e6448cd 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,5 +1,5 @@ Source: sqlite3 -Version: 3.32.0-0 +Version: 3.32.0-1 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/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index ec78e1578bbaee..8d45c701a11b09 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,48 +1,51 @@ -set(SQLITE_VERSION 3320000) -set(SQLITE_HASH cf176859dfe5b6b92f02c8408faf3389fba0bd441308dea058085e031c45ab28377ce5ae519c48efe0ae51a16d4242e8d00461229ed099ee5cc2741a0f32ecd4 ) - -vcpkg_download_distfile(ARCHIVE - URLS "https://sqlite.org/2020/sqlite-amalgamation-${SQLITE_VERSION}.zip" - FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip" - SHA512 ${SQLITE_HASH} -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${SQLITE_VERSION} - PATCHES fix-arm-uwp.patch -) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES - tool SQLITE3_SKIP_TOOLS -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS ${FEATURE_OPTIONS} - OPTIONS_DEBUG - -DSQLITE3_SKIP_TOOLS=ON -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -if(NOT SQLITE3_SKIP_TOOLS AND EXISTS ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}) - file(RENAME ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX}) -endif() - -configure_file( - ${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake - ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake - @ONLY -) - -file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") -vcpkg_copy_pdbs() +set(SQLITE_VERSION 3320000) +set(SQLITE_HASH cf176859dfe5b6b92f02c8408faf3389fba0bd441308dea058085e031c45ab28377ce5ae519c48efe0ae51a16d4242e8d00461229ed099ee5cc2741a0f32ecd4 ) + +vcpkg_download_distfile(ARCHIVE + URLS "https://sqlite.org/2020/sqlite-amalgamation-${SQLITE_VERSION}.zip" + FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip" + SHA512 ${SQLITE_HASH} +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${SQLITE_VERSION} + PATCHES fix-arm-uwp.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + tool SQLITE3_SKIP_TOOLS +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} + OPTIONS_DEBUG + -DSQLITE3_SKIP_TOOLS=ON +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +if(NOT SQLITE3_SKIP_TOOLS AND EXISTS ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}) + file(RENAME ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX}) +endif() + +configure_file( + ${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake + ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake + @ONLY +) + +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/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/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 diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 01c331b119e34f..837e0721253078 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -38,3 +38,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 7724a3f7f5de58..d9950c7ef74b3c 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -47,5 +47,6 @@ include(vcpkg_get_windows_sdk) include(vcpkg_replace_string) include(vcpkg_from_git) include(vcpkg_test_cmake) +include(vcpkg_pkgconfig) include(vcpkg_prettify_command) include(vcpkg_buildpath_length_warning) 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() - - diff --git a/scripts/cmake/vcpkg_pkgconfig.cmake b/scripts/cmake/vcpkg_pkgconfig.cmake new file mode 100644 index 00000000000000..f768ae1f05bc09 --- /dev/null +++ b/scripts/cmake/vcpkg_pkgconfig.cmake @@ -0,0 +1,90 @@ +## # 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() + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + 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() + 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..307be3a512b01c --- /dev/null +++ b/scripts/templates/debug.pc.in @@ -0,0 +1,12 @@ +prefix=@CURRENT_INSTALLED_DIR@ +exec_prefix=${prefix} +libdir=${prefix}/debug/lib +includedir=${prefix}/include + +Name: @PORT@ +URL: @PORT_HOMEPAGE@ +Description: @PORT_DESCRIPTION@ +Version: @PORT_VERSION@ +Requires: @PORT_REQUIRES_DEBUG@ +Libs: -L${libdir} @PORT_LIBS_DEBUG@ +Cflags: -I${includedir} diff --git a/scripts/templates/release.pc.in b/scripts/templates/release.pc.in new file mode 100644 index 00000000000000..f3ea60f6614b6c --- /dev/null +++ b/scripts/templates/release.pc.in @@ -0,0 +1,12 @@ +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@ +Libs: -L${libdir} @PORT_LIBS_RELEASE@ +Cflags: -I${includedir} diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 425d846df6d7a7..0e4607dc92af97 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -197,4 +197,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/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index 08c306abf17e7d..9b9ababaa094f2 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -28,6 +28,16 @@ namespace vcpkg static Type from_string(const std::string&); }; + /// + /// 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/vcpkg-test/paragraph.cpp b/toolsrc/src/vcpkg-test/paragraph.cpp index 678064f1cccc1e..08351da8f6b9fc 100644 --- a/toolsrc/src/vcpkg-test/paragraph.cpp +++ b/toolsrc/src/vcpkg-test/paragraph.cpp @@ -445,3 +445,22 @@ TEST_CASE ("BinaryParagraph serialize abi", "[paragraph]") REQUIRE(pghs.size() == 1); REQUIRE(pghs[0]["Abi"].first == "123abc"); } + +TEST_CASE ("to_port_version", "[paragraph]") +{ + REQUIRE(vcpkg::to_port_version("1.2.3-1") == "1.2.3"); + REQUIRE(vcpkg::to_port_version("1.2.3-") == "1.2.3"); + REQUIRE(vcpkg::to_port_version("1.2.3") == "1.2.3"); + REQUIRE(vcpkg::to_port_version("").empty()); + REQUIRE(vcpkg::to_port_version("-1").empty()); +} + +TEST_CASE("to_cmake_version", "[paragraph]") +{ + REQUIRE(vcpkg::to_cmake_version("1.2.3-1") == "1.2.3"); + REQUIRE(vcpkg::to_cmake_version("1.2.3a-1") == "1.2.3"); + REQUIRE(vcpkg::to_cmake_version("1.2.3.4.5") == "1.2.3.4"); + REQUIRE(vcpkg::to_cmake_version("1.2.3") == "1.2.3"); + REQUIRE(vcpkg::to_cmake_version("").empty()); + REQUIRE(vcpkg::to_cmake_version("-1").empty()); +} diff --git a/toolsrc/src/vcpkg-test/strings.cpp b/toolsrc/src/vcpkg-test/strings.cpp index eb1f5697f2e485..4fb2686f507da7 100644 --- a/toolsrc/src/vcpkg-test/strings.cpp +++ b/toolsrc/src/vcpkg-test/strings.cpp @@ -41,3 +41,13 @@ TEST_CASE ("split by char", "[strings]") REQUIRE(split(" hello world ", ' ') == result_t{"hello", "world"}); REQUIRE(split("no delimiters", ',') == result_t{"no delimiters"}); } + +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/checks.cpp b/toolsrc/src/vcpkg/base/checks.cpp index 42e0835c6bcdeb..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, '\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); } diff --git a/toolsrc/src/vcpkg/base/strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp index 167053d702fa4d..b68612da99aae5 100644 --- a/toolsrc/src/vcpkg/base/strings.cpp +++ b/toolsrc/src/vcpkg/base/strings.cpp @@ -288,3 +288,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/build.cpp b/toolsrc/src/vcpkg/build.cpp index e73bfce406fc1d..03fd6f92747970 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -371,34 +371,38 @@ namespace vcpkg::Build all_features.append(feature->name + ";"); } - std::vector variables{ - {"CMD", "BUILD"}, - {"PORT", scf.core_paragraph->name}, - {"CURRENT_PORT_DIR", scfl.source_location}, - {"VCPKG_ROOT_DIR", paths.root}, - {"PACKAGES_DIR", paths.packages}, - {"BUILDTREES_DIR", paths.buildtrees}, - {"_VCPKG_INSTALLED_DIR", paths.installed}, - {"TARGET_TRIPLET", triplet.canonical_name()}, - {"TARGET_TRIPLET_FILE", paths.get_triplet_file_path(triplet).u8string()}, - {"VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()}, - {"VCPKG_USE_HEAD_VERSION", Util::Enum::to_bool(action.build_options.use_head_version) ? "1" : "0"}, - {"DOWNLOADS", paths.downloads}, - {"_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(action.build_options.allow_downloads) ? "1" : "0"}, - {"_VCPKG_DOWNLOAD_TOOL", to_string(action.build_options.download_tool)}, - {"FEATURES", Strings::join(";", action.feature_list)}, - {"ALL_FEATURES", all_features}, - {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, - }; + std::unordered_map variables; + variables.emplace("CMD", "BUILD"); + variables.emplace("PORT", scf.core_paragraph->name); + variables.emplace("CURRENT_PORT_DIR", scfl.source_location.generic_u8string()); + variables.emplace("VCPKG_ROOT_DIR", paths.root.generic_u8string()); + variables.emplace("PACKAGES_DIR", paths.packages.generic_u8string()); + variables.emplace("BUILDTREES_DIR", paths.buildtrees.generic_u8string()); + variables.emplace("_VCPKG_INSTALLED_DIR", paths.installed.generic_u8string()); + variables.emplace("TARGET_TRIPLET", triplet.canonical_name()); + variables.emplace("TARGET_TRIPLET_FILE", paths.get_triplet_file_path(triplet).u8string()); + variables.emplace("VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()); + variables.emplace("VCPKG_USE_HEAD_VERSION", Util::Enum::to_bool(action.build_options.use_head_version) ? "1" : "0"); + variables.emplace("DOWNLOADS", paths.downloads.generic_u8string()); + variables.emplace("_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(action.build_options.allow_downloads) ? "1" : "0"); + variables.emplace("_VCPKG_DOWNLOAD_TOOL", to_string(action.build_options.download_tool)); + variables.emplace("FEATURES", Strings::join(";", action.feature_list)); + variables.emplace("ALL_FEATURES", all_features); + variables.emplace("VCPKG_CONCURRENCY", std::to_string(get_concurrency())); + 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", 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)) { - variables.push_back({"VCPKG_DOWNLOAD_MODE", "true"}); + variables.emplace("VCPKG_DOWNLOAD_MODE", "true"); } if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) { - variables.push_back({"GIT", git_exe_path}); + variables.emplace("GIT", git_exe_path.generic_u8string()); } const Files::Filesystem& fs = paths.get_filesystem(); @@ -418,10 +422,21 @@ namespace vcpkg::Build if (!port_configs.empty()) { - variables.emplace_back("VCPKG_PORT_CONFIGS", Strings::join(";", port_configs)); + variables.emplace("VCPKG_PORT_CONFIGS", Strings::join(";", port_configs)); } - return variables; + std::vector sdeps; + for (const auto& dep : filter_dependencies(scf.core_paragraph->depends, triplet, variables)) + { + sdeps.push_back(dep.package_spec.name()); + } + variables.emplace("PORT_DEPENDENCIES", Strings::join(";", sdeps)); + std::vector cvars; + for (const auto& kv : variables) + { + cvars.emplace_back(kv.first, kv.second); + } + return cvars; } static std::string get_triplet_abi(const VcpkgPaths& paths, const PreBuildInfo& pre_build_info, Triplet triplet) diff --git a/toolsrc/src/vcpkg/sourceparagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp index b5e0ebe314606b..2d488a2f6f291c 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -235,4 +235,30 @@ namespace vcpkg } return ret; } + + 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; + } }