Skip to content

Commit 9e7e663

Browse files
authored
Merge pull request #3 from open-vcpkg/fix-pyqt6
Test pyqt6
2 parents 50981d2 + 8a48ae5 commit 9e7e663

34 files changed

+307
-119
lines changed

.github/workflows/macos.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: 🔨 Prepare build env
4141
run: |
42-
brew install autoconf automake autoconf-archive
42+
brew install autoconf automake autoconf-archive libtool
4343
4444
- name: 🐕 Checkout vcpkg
4545
uses: actions/checkout@v4
@@ -59,6 +59,7 @@ jobs:
5959
mono $NUGET_EXE sources add -Name ghpkg -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json" -UserName "$PKG_SOURCE_USER" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText
6060
mono $NUGET_EXE setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json"
6161
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite" >> $GITHUB_ENV
62+
VCPKG_ROOT=$(pwd)/vcpkg
6263
echo "PATH=$VCPKG_ROOT;$PATH" >> $GITHUB_ENV
6364
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV
6465
@@ -67,7 +68,8 @@ jobs:
6768
VCPKG_OPTIONS="--overlay-ports="${{ github.workspace }}/ports" --host-triplet=${{ matrix.triplet }} --triplet=${{ matrix.triplet }} --x-buildtrees-root=${{ env.buildtrees }}"
6869
./vcpkg/vcpkg install $VCPKG_OPTIONS py-pip
6970
./vcpkg/vcpkg install $VCPKG_OPTIONS py-sip
70-
71+
# ./vcpkg/vcpkg install $VCPKG_OPTIONS py-pyqt6
72+
7173
- name: 📑 Upload logs
7274
uses: actions/upload-artifact@v4
7375
if: failure()

.github/workflows/windows.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,18 @@ jobs:
5050
$NUGET_EXE sources add -Name ghpkg -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json" -UserName "$PKG_SOURCE_USER" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText
5151
$NUGET_EXE setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json"
5252
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite" >> $GITHUB_ENV
53+
VCPKG_ROOT=$(cygpath -w $(pwd)/vcpkg)
5354
echo "PATH=$VCPKG_ROOT;$PATH" >> $GITHUB_ENV
5455
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV
5556
57+
5658
- name: 🌋 Build
5759
run: |
58-
.\vcpkg\vcpkg.exe install --overlay-ports="${{ github.workspace }}/ports" --triplet=${{ matrix.triplet }} py-sip
59-
60+
.\vcpkg\vcpkg.exe install --overlay-ports="${{ github.workspace }}/ports" --triplet=${{ matrix.triplet }} --x-buildtrees-root=C:/vcpkg-build py-pyqt6
61+
6062
- name: 📑 Upload logs
6163
uses: actions/upload-artifact@v4
6264
if: failure()
6365
with:
6466
name: logs-${{ matrix.triplet }}
65-
path: /c/vcpkg/buildtrees/**/*.log
67+
path: C:/vcpkg-build/**/*.log

ports/py-packaging/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"homepage": "packaging.pypa.io/",
66
"license": "MIT",
77
"dependencies": [
8-
"python3",
98
"py-flit-core",
109
"py-gpep517",
10+
"python3",
1111
{
1212
"name": "vcpkg-python-scripts",
1313
"host": true

ports/py-pip/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"description": "Tool for installing and managing Python packages",
66
"homepage": "https://pypi.org/project/setuptools",
77
"dependencies": [
8-
"python3",
98
{
109
"name": "py-setuptools",
1110
"host": true
1211
},
12+
"python3",
1313
{
1414
"name": "vcpkg-python-scripts",
1515
"host": true

ports/py-ply/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"description": "Python Lex & Yacc",
66
"homepage": "https://www.dabeaz.com/ply/",
77
"dependencies": [
8-
"python3",
98
{
109
"name": "py-setuptools",
1110
"host": true
1211
},
12+
"python3",
1313
{
1414
"name": "vcpkg-python-scripts",
1515
"host": true

ports/py-pyparsing/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"homepage": "https://github.com/pyparsing/pyparsing",
77
"license": "MIT",
88
"dependencies": [
9-
"python3",
109
{
1110
"name": "py-setuptools",
1211
"host": true
1312
},
13+
"python3",
1414
{
1515
"name": "vcpkg-python-scripts",
1616
"host": true

ports/py-pyqt-builder/libpath.patch

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/pyqtbuild/project.py b/pyqtbuild/project.py
2+
index 20ab60f..4f4d105 100644
3+
--- a/pyqtbuild/project.py
4+
+++ b/pyqtbuild/project.py
5+
@@ -73,7 +73,8 @@ class PyQtProject(Project):
6+
# these are actually non-user options but we need the 'link_full_dll'
7+
# user option in order to set them.
8+
if self.py_platform == 'win32':
9+
- pylib_dir = os.path.join(sys.base_prefix, 'libs')
10+
+ # vcpkg install python3.lib into [installed]/lib
11+
+ pylib_dir = os.path.join(sys.base_prefix, '..', '..', 'lib')
12+
13+
debug_suffix = '_d' if self.py_debug else ''
14+

ports/py-pyqt-builder/portfile.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ vcpkg_from_pythonhosted(
33
PACKAGE_NAME PyQt-builder
44
VERSION ${VERSION}
55
SHA512 ec0b9f7784a32af744111615b93f98d73f284bb752fd71359c798d3b093a01925823effea72c866a5f49f77e3dfc5dee4125bbb289f647d84000bf34b5db6931
6+
PATCHES
7+
libpath.patch
68
)
79

810
vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -x)

ports/py-pyqt-builder/vcpkg.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "py-pyqt-builder",
33
"version": "1.15.4",
4-
"port-version": 2,
4+
"port-version": 3,
55
"description": "PyQt-builder is the PEP 517 compliant build system for PyQt and projects that extend PyQt. It extends the SIP build system and uses Qt’s qmake to perform the actual compilation and installation of extension modules.",
66
"homepage": "https://www.riverbankcomputing.com/software/pyqt-builder",
77
"dependencies": [
8-
"python3",
98
{
109
"name": "py-setuptools",
1110
"host": true
1211
},
12+
"python3",
1313
{
1414
"name": "vcpkg-python-scripts",
1515
"host": true

ports/py-pyqt6-sip/portfile.cmake

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
2+
3+
vcpkg_from_pythonhosted(
4+
OUT_SOURCE_PATH SOURCE_PATH
5+
PACKAGE_NAME PyQt6_sip
6+
VERSION ${VERSION}
7+
SHA512 bd2fa70d64544d8104d3477cb650a0e6bcefa0008680afcf7d187ba3fb1117871c0237d3a7f047144c8a8a8eeb8da941a3b206f8ee0601cb2cc734243cdb9d46
8+
)
9+
10+
vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}")
11+
12+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
13+
14+
vcpkg_python_test_import(MODULE "PyQt6.sip")
15+
16+
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

ports/py-pyqt6-sip/vcpkg.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "py-pyqt6-sip",
3+
"version": "13.6.0",
4+
"description": "Python bindings for the Qt cross platform application toolkit",
5+
"homepage": "https://www.riverbankcomputing.com/software/pyqt/",
6+
"dependencies": [
7+
{
8+
"name": "py-setuptools",
9+
"host": true
10+
},
11+
"py-sip",
12+
"python3",
13+
{
14+
"name": "vcpkg-python-scripts",
15+
"host": true
16+
}
17+
]
18+
}

ports/py-pyqt6/portfile.cmake

+35-71
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
2+
set(VCPKG_BUILD_TYPE release)
23

34
vcpkg_from_pythonhosted(
45
OUT_SOURCE_PATH SOURCE_PATH
@@ -7,91 +8,54 @@ vcpkg_from_pythonhosted(
78
SHA512 c2ff8c47c9b0e43c009d0c90f565a54344e6f384c67dd30c2d422465d0702c07713acc0095c8b67827d1146675611c07d548ba282a26e41bb60a0a21977a7a64
89
)
910

11+
# https://www.riverbankcomputing.com/static/Docs/PyQt6/installation.html
1012
set(SIPBUILD_ARGS
1113
"--confirm-license"
12-
"--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake.exe" #TODO: append .exe only on windows
13-
"--api-dir" "${CURRENT_PACKAGES_DIR}/share/qt6/qsci/api/python"
14+
"--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake${VCPKG_HOST_EXECUTABLE_SUFFIX}"
15+
"--api-dir" "${CURRENT_PACKAGES_DIR}/share/Qt6/qsci/api/python"
1416
"--verbose"
1517
"--qt-shared"
1618
"--no-make"
1719
"--disable" "QtDesigner"
1820
"--pep484-pyi"
19-
"--debug"
20-
"--target-dir" "${CURRENT_PACKAGES_DIR}/lib/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}/site-packages"
21-
"--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
21+
"--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
22+
"--target-dir" "${PYTHON3_SITEPACKAGES}"
2223
)
2324

24-
set(SIPBUILD_ARGS
25-
"--confirm-license"
26-
"--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake.exe" #TODO: append .exe only on windows
27-
"--api-dir" "${CURRENT_PACKAGES_DIR}/share/qt6/qsci/api/python"
28-
"--verbose"
29-
"--qt-shared"
30-
"--no-make"
31-
"--disable" "QtDesigner"
32-
"--pep484-pyi"
33-
# "--debug" # will create debuggable bindings
34-
"--target-dir" "${CURRENT_PACKAGES_DIR}/lib/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}/site-packages"
35-
"--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
36-
)
25+
if(VCPKG_TARGET_IS_OSX)
26+
if(DEFINED VCPKG_OSX_DEPLOYMENT_TARGET)
27+
vcpkg_list(APPEND SIPBUILD_ARGS "--qmake-setting" "QMAKE_MACOSX_DEPLOYMENT_TARGET=${VCPKG_OSX_DEPLOYMENT_TARGET}")
28+
else()
29+
# https://doc.qt.io/qt-6/macos.html
30+
vcpkg_list(APPEND SIPBUILD_ARGS "--qmake-setting" "QMAKE_MACOSX_DEPLOYMENT_TARGET=10.15")
31+
endif()
32+
vcpkg_list(APPEND SIPBUILD_ARGS "--no-dbus-python")
33+
endif()
3734

38-
message(STATUS "Running sipbuild... (${PYTHON3})")
39-
vcpkg_execute_required_process(
40-
COMMAND "${PYTHON3}" "-m" "sipbuild.tools.build" ${SIPBUILD_ARGS}
41-
WORKING_DIRECTORY "${SOURCE_PATH}"
42-
LOGNAME "sipbuild-${TARGET_TRIPLET}-0"
43-
)
44-
message(STATUS "Running sipbuild...finished.")
4535

46-
# TODO: Can we use vcpkg_install_make here instead of duplicating code?
47-
set(MAKEFILE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build/Makefile")
36+
vcpkg_backup_env_variables(VARS PATH)
4837

49-
vcpkg_list(SET make_opts)
50-
vcpkg_list(SET install_opts)
51-
set(path_backup "$ENV{PATH}")
52-
if (CMAKE_HOST_WIN32)
53-
vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper")
54-
if(NOT DEFINED Z_VCPKG_MAKE)
55-
vcpkg_acquire_msys(MSYS_ROOT)
56-
find_program(Z_VCPKG_MAKE make PATHS "${MSYS_ROOT}/usr/bin" NO_DEFAULT_PATH REQUIRED)
57-
endif()
58-
set(make_command "${Z_VCPKG_MAKE}")
59-
vcpkg_list(SET make_opts -j ${VCPKG_CONCURRENCY} --trace -f ${MAKEFILE})
38+
vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/Scripts/" "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt6/bin/" "${CURRENT_HOST_INSTALLED_DIR}/bin")
6039

61-
string(REPLACE " " [[\ ]] vcpkg_package_prefix "${CURRENT_PACKAGES_DIR}")
62-
string(REGEX REPLACE [[([a-zA-Z]):/]] [[/\1/]] vcpkg_package_prefix "${vcpkg_package_prefix}")
63-
vcpkg_list(SET install_opts -j ${VCPKG_CONCURRENCY} --trace -f ${MAKEFILE} DESTDIR=${vcpkg_package_prefix}/lib/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}/site-packages)
64-
#TODO: optimize for install-data (release) and install-exec (release/debug)
40+
message(STATUS "Running sipbuild...")
41+
vcpkg_execute_required_process(
42+
COMMAND "${PYTHON3}" "-m" "sipbuild.tools.build" ${SIPBUILD_ARGS}
43+
WORKING_DIRECTORY "${SOURCE_PATH}"
44+
LOGNAME "sipbuild-${TARGET_TRIPLET}"
45+
)
46+
message(STATUS "Running sipbuild...finished.")
6547

66-
else()
67-
if(VCPKG_HOST_IS_OPENBSD)
68-
find_program(Z_VCPKG_MAKE gmake REQUIRED)
69-
else()
70-
find_program(Z_VCPKG_MAKE make REQUIRED)
71-
endif()
72-
set(make_command "${Z_VCPKG_MAKE}")
73-
vcpkg_list(SET make_opts V=1 -j ${VCPKG_CONCURRENCY} -f ${MAKEFILE})
74-
vcpkg_list(SET install_opts -j ${VCPKG_CONCURRENCY} -f ${MAKEFILE} DESTDIR=${CURRENT_PACKAGES_DIR}/lib/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}/site-packages)
48+
# inventory.txt is consumed by the distinfo tool which is run during make and should be run against the package directory
49+
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
50+
vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/inventory.txt"
51+
"${CURRENT_INSTALLED_DIR}"
52+
"${CURRENT_PACKAGES_DIR}")
53+
vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/inventory.txt"
54+
"${NATIVE_INSTALLED_DIR}"
55+
"${CURRENT_PACKAGES_DIR}")
7556

76-
# To find sip-distinfo and python3 during install
77-
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/tools:${CURRENT_INSTALLED_DIR}/tools/python3:$ENV{PATH}")
78-
endif()
57+
vcpkg_qmake_build(BUILD_LOGNAME "install" TARGETS "install")
7958

80-
vcpkg_list(SET make_cmd_line ${make_command} ${make_opts})
81-
vcpkg_list(SET install_cmd_line ${make_command} install ${install_opts})
59+
vcpkg_restore_env_variables(VARS PATH)
8260

83-
message(STATUS "Running build...")
84-
vcpkg_execute_build_process(
85-
COMMAND ${make_cmd_line}
86-
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
87-
LOGNAME "build-${TARGET_TRIPLET}${short_buildtype}"
88-
)
89-
message(STATUS "Running build... finished.")
90-
message(STATUS "Running install...")
91-
vcpkg_execute_build_process(
92-
COMMAND ${install_cmd_line}
93-
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
94-
LOGNAME "install-${TARGET_TRIPLET}${short_buildtype}"
95-
)
96-
message(STATUS "Running install... finished.")
97-
set(ENV{PATH} "${path_backup}")
61+
vcpkg_python_test_import(MODULE "PyQt6.QtCore")

ports/py-pyqt6/vcpkg.json

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
{
22
"name": "py-pyqt6",
33
"version": "6.6.1",
4-
"port-version": 1,
4+
"port-version": 2,
55
"description": "Python bindings for the Qt cross platform application toolkit",
66
"homepage": "https://www.riverbankcomputing.com/software/pyqt/",
77
"dependencies": [
8-
"python3",
9-
"py-sip",
10-
"py-pyqt-builder",
11-
"py-ply",
128
"py-packaging",
9+
"py-ply",
10+
"py-pyqt-builder",
11+
"py-pyqt6-sip",
12+
"python3",
13+
{
14+
"name": "qtactiveqt",
15+
"platform": "windows"
16+
},
1317
"qtbase",
18+
"qtmultimedia",
19+
"qtsensors",
20+
"qtsvg",
21+
"qtwebchannel",
22+
"qtwebsockets",
1423
{
1524
"name": "vcpkg-python-scripts",
1625
"host": true
1726
},
1827
{
19-
"name": "vcpkg-cmake-get-vars",
28+
"name": "vcpkg-qmake",
2029
"host": true
2130
}
2231
]

ports/py-sip/add_dll_directory.patch

-13
This file was deleted.

ports/py-sip/portfile.cmake

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ vcpkg_from_pythonhosted(
33
PACKAGE_NAME sip
44
VERSION ${VERSION}
55
SHA512 885c32a051e882b82b59bf1365050933f8fc1c619b19f4bc03235edc5741a5e14aae8edf90479ad0283f74ba5c5233a2589c151ec865b130199a6db9800a2294
6-
PATCHES
7-
add_dll_directory.patch
86
)
97

108
vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -x)

ports/py-sip/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "py-sip",
33
"version": "6.7.12",
4-
"port-version": 2,
4+
"port-version": 3,
55
"description": "A tool that makes it easy to create Python bindings for C and C++ libraries",
66
"homepage": "https://www.riverbankcomputing.com/software/sip",
77
"dependencies": [

0 commit comments

Comments
 (0)