diff --git a/vcpkg/ports/py-pyqt6/portfile.cmake b/vcpkg/ports/py-pyqt6/portfile.cmake new file mode 100644 index 0000000000000..dd4e2a34e5cb0 --- /dev/null +++ b/vcpkg/ports/py-pyqt6/portfile.cmake @@ -0,0 +1,66 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +set(VCPKG_BUILD_TYPE release) + +vcpkg_download_distfile( + ARCHIVE + URLS https://riverbankcomputing.com/pypi/packages/PyQt6/PyQt6-6.8.0.dev2411221125.tar.gz + FILENAME pyqt6.tar.gz + SHA512 f52fe48969a8b86651f6a3bf6156a91c57e42e4192bd184dfe6b7ac8a4728509b4610c2da8fb88039ff2880b02c6dbb455d1ed12fb65b7cd65ddb8ca7fb6a476 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + +# https://www.riverbankcomputing.com/static/Docs/PyQt6/installation.html +set(SIPBUILD_ARGS + "--confirm-license" + "--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake${VCPKG_HOST_EXECUTABLE_SUFFIX}" + "--api-dir" "${CURRENT_PACKAGES_DIR}/share/Qt6/qsci/api/python" + "--verbose" + "--qt-shared" + "--no-make" + "--disable" "QtDesigner" + "--pep484-pyi" + "--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + "--target-dir" "${PYTHON3_SITEPACKAGES}" +) + +if(VCPKG_TARGET_IS_OSX) + if(DEFINED VCPKG_OSX_DEPLOYMENT_TARGET) + vcpkg_list(APPEND SIPBUILD_ARGS "--qmake-setting" "QMAKE_MACOSX_DEPLOYMENT_TARGET=${VCPKG_OSX_DEPLOYMENT_TARGET}") + else() + # https://doc.qt.io/qt-6/macos.html + vcpkg_list(APPEND SIPBUILD_ARGS "--qmake-setting" "QMAKE_MACOSX_DEPLOYMENT_TARGET=10.15") + endif() + vcpkg_list(APPEND SIPBUILD_ARGS "--no-dbus-python") +endif() + + +vcpkg_backup_env_variables(VARS PATH) + +vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/Scripts/" "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt6/bin/" "${CURRENT_HOST_INSTALLED_DIR}/bin") + +message(STATUS "Running sipbuild...") +vcpkg_execute_required_process( + COMMAND "${PYTHON3}" "-m" "sipbuild.tools.build" ${SIPBUILD_ARGS} + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME "sipbuild-${TARGET_TRIPLET}" +) +message(STATUS "Running sipbuild...finished.") + +# inventory.txt is consumed by the distinfo tool which is run during make and should be run against the package directory +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR) +vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/inventory.txt" + "${CURRENT_INSTALLED_DIR}" + "${CURRENT_PACKAGES_DIR}") + vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/inventory.txt" + "${NATIVE_INSTALLED_DIR}" + "${CURRENT_PACKAGES_DIR}") + +vcpkg_qmake_build(BUILD_LOGNAME "install" TARGETS "install") + +vcpkg_restore_env_variables(VARS PATH) + +vcpkg_python_test_import(MODULE "PyQt6.QtCore") diff --git a/vcpkg/ports/py-pyqt6/vcpkg.json b/vcpkg/ports/py-pyqt6/vcpkg.json new file mode 100644 index 0000000000000..d74a6b9bdd00f --- /dev/null +++ b/vcpkg/ports/py-pyqt6/vcpkg.json @@ -0,0 +1,31 @@ +{ + "name": "py-pyqt6", + "version": "6.8.0", + "description": "Python bindings for the Qt cross platform application toolkit", + "homepage": "https://www.riverbankcomputing.com/software/pyqt/", + "dependencies": [ + "py-packaging", + "py-ply", + "py-pyqt-builder", + "py-pyqt6-sip", + "python3", + { + "name": "qtactiveqt", + "platform": "windows" + }, + "qtbase", + "qtmultimedia", + "qtsensors", + "qtsvg", + "qtwebchannel", + "qtwebsockets", + { + "name": "vcpkg-python-scripts", + "host": true + }, + { + "name": "vcpkg-qmake", + "host": true + } + ] +}