Osyotr c6928dfb9e
[python3] Update to 3.11.4 (#31727)
* [python3] Update to 3.11.3

* Force set PythonForBuild on windows

* Set LD_LIBRARY_PATH on unix

* Always use vcpkg_find_acquire_program(PYTHON3) on windows

* Remove LD_LIBRARY_PATH shenanigans

* [vtk] Parse python version from include folder

* Fix static builds on windows

* Pass --with-build-python on unix

* [omniorb] Fix python version in patch

* Resurrect rpath patch

* [python3] fix usage

* [gobject-introspection] don't hardcode python version

* Update vcpkg_find_aquire_program(PYTHON3)
This is also required for gobject-introspection

* [paraview] don't hardcode python version

* [vtk-dicom] don't hardcode python version

* Update python in vcpkgTools.xml

* Fix host arch detection in vcpkg_find_acquire_program(PYTHON3)

* [libpq] Don't hardcode python version

* [shiva] Don't pass python variables

* [vcpkg-get-python-packages] Delete unused file, update hardcoded python version

* [python3] update to 3.11.4

* [omniorb] Use PREPEND in vcpkg_add_to_path
So that python from vcpkg is picked before system python

* libpq quickfix

* re-fix libpq

* fix vcpkg-get-python-packages

* Make windows 7 patch compatible with unix builds

* Copy pyd files to bin
Also fixes copying files that do not belong to current build tree

* Fix static builds

* Speculatively fix osx regression

* Fix omniorb on unix

* [gobject-introspection] fix windows builds

* [vtk] Update vendored copy of mpi4py for python 3.11 support

* [mdl-sdk] Fix python

* [gobject-introspection] fix the fix of a fix...

* Update versions

* Undo changes in gobject-introspection and vcpkg_find_aquire_program(PYTHON3)

---------

Co-authored-by: root <root@DESKTOP-UIPL9V8>
2023-08-07 13:19:53 -07:00

85 lines
3.1 KiB
CMake

set(GI_MAJOR_MINOR 1.72)
set(GI_PATCH 0)
vcpkg_download_distfile(ARCHIVE
URLS "https://download.gnome.org/sources/gobject-introspection/${GI_MAJOR_MINOR}/gobject-introspection-${GI_MAJOR_MINOR}.${GI_PATCH}.tar.xz"
FILENAME "gobject-introspection-${GI_MAJOR_MINOR}.${GI_PATCH}.tar.xz"
SHA512 b8fba2bd12e93776c55228acf3487bef36ee40b1abdc7f681b827780ac94a8bfa1f59b0c30d60fa5a1fea2f610de78b9e52029f411128067808f17eb6374cdc5
)
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES
0001-g-ir-tool-template.in.patch
0002-cross-build.patch
0003-fix-paths.patch
python.patch
)
vcpkg_find_acquire_program(FLEX)
vcpkg_find_acquire_program(BISON)
set(OPTIONS_DEBUG -Dbuild_introspection_data=false)
set(OPTIONS_RELEASE -Dbuild_introspection_data=true)
if(VCPKG_CROSSCOMPILING AND
NOT (CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86"))
list(APPEND OPTIONS_RELEASE -Dgi_cross_use_prebuilt_gi=true)
endif()
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
${OPTIONS_DEBUG}
OPTIONS_RELEASE
${OPTIONS_RELEASE}
ADDITIONAL_BINARIES
flex='${FLEX}'
bison='${BISON}'
g-ir-annotation-tool='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-annotation-tool'
g-ir-compiler='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}'
g-ir-scanner='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-scanner'
)
vcpkg_host_path_list(APPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")
vcpkg_host_path_list(APPEND ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib")
vcpkg_install_meson(ADD_BIN_TO_PATH)
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
set(GI_TOOLS
g-ir-compiler
g-ir-generate
g-ir-inspect
)
set(GI_SCRIPTS
g-ir-annotation-tool
g-ir-scanner
)
vcpkg_copy_tools(TOOL_NAMES ${GI_TOOLS} AUTO_CLEAN)
foreach(script IN LISTS GI_SCRIPTS)
file(READ "${CURRENT_PACKAGES_DIR}/bin/${script}" _contents)
string(REPLACE "#!/usr/bin/env ${PYTHON3}" "#!/usr/bin/env python3" _contents "${_contents}")
string(REPLACE "datadir = \"${CURRENT_PACKAGES_DIR}/share\"" "raise Exception('could not find right path') " _contents "${_contents}")
string(REPLACE "pylibdir = os.path.join('${CURRENT_PACKAGES_DIR}/lib', 'gobject-introspection')" "raise Exception('could not find right path') " _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${script}" "${_contents}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${script}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${script}")
endforeach()
if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB _pyd_lib_files "${CURRENT_PACKAGES_DIR}/lib/gobject-introspection/giscanner/_giscanner.*.lib")
file(REMOVE ${_pyd_lib_files})
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/${PORT}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")