[python3] Install pkg-config files on Windows platforms (#22198)

This commit is contained in:
Max Khon 2022-01-04 01:24:11 +03:00 committed by GitHub
parent c3dfd6ade0
commit c662463c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 2 deletions

View File

@ -0,0 +1,11 @@
diff --git a/Misc/python-embed.pc.in b/Misc/python-embed.pc.in
index 2be9df8..a2e5ff7 100644
--- a/Misc/python-embed.pc.in
+++ b/Misc/python-embed.pc.in
@@ -9,5 +9,5 @@ Description: Embed Python into an application
Requires:
Version: @VERSION@
Libs.private: @LIBS@
-Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
+Libs: -L${libdir} -lpython@ABIVERSION@@ABIFLAGS@@ABISUFFIX@
Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@

View File

@ -34,6 +34,7 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
if("${WINSDK_VERSION}" VERSION_GREATER_EQUAL "10.0.22000")
list(APPEND PATCHES "0007-workaround-windows-11-sdk-rc-compiler-error.patch")
endif()
list(APPEND PATCHES "0009-python-embed.pc.patch")
endif()
vcpkg_from_github(
@ -158,6 +159,30 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
)
endif()
# pkg-config files
set(prefix "${CURRENT_PACKAGES_DIR}")
set(libdir [[${prefix}/lib]])
set(ABIVERSION "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
set(VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
set(exec_prefix "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
set(includedir [[${prefix}/include]])
set(ABISUFFIX "")
configure_file("${SOURCE_PATH}/Misc/python.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/python-${VERSION}.pc" @ONLY)
configure_file("${SOURCE_PATH}/Misc/python-embed.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/python-${VERSION}-embed.pc" @ONLY)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(exec_prefix "\${prefix}/../tools/${PORT}")
set(includedir [[${prefix}/../include]])
set(ABISUFFIX "_d")
configure_file("${SOURCE_PATH}/Misc/python.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/python-${VERSION}.pc" @ONLY)
configure_file("${SOURCE_PATH}/Misc/python-embed.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/python-${VERSION}-embed.pc" @ONLY)
endif()
vcpkg_fixup_pkgconfig()
vcpkg_clean_msbuild()
else()
set(OPTIONS

View File

@ -1,7 +1,7 @@
{
"name": "python3",
"version-semver": "3.10.1",
"port-version": 3,
"port-version": 4,
"description": "The Python programming language",
"homepage": "https://github.com/python/cpython",
"supports": "!uwp",

View File

@ -5498,7 +5498,7 @@
},
"python3": {
"baseline": "3.10.1",
"port-version": 3
"port-version": 4
},
"qca": {
"baseline": "2.3.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "75172bc36c45d15ee298de1803625af1770cb805",
"version-semver": "3.10.1",
"port-version": 4
},
{
"git-tree": "35f071d147af8c4d8dfac5eaa95ad41e395448a5",
"version-semver": "3.10.1",