Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test pyqt6 #3

Merged
merged 41 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
bc726c1
Test pyqt6
m-kuhn Feb 12, 2024
258d8f7
Build on C: there is more empty space
m-kuhn Feb 12, 2024
68f02c0
Fix paths
m-kuhn Feb 12, 2024
befc623
debug
m-kuhn Feb 12, 2024
ee231b5
debug
m-kuhn Feb 12, 2024
254f6b3
Improve debugging
m-kuhn Feb 12, 2024
4a6a463
Add deps
m-kuhn Feb 12, 2024
19da51a
debug
m-kuhn Feb 12, 2024
4f7f0f7
Debug2
m-kuhn Feb 13, 2024
ad3070a
activeqt is windows only
m-kuhn Feb 13, 2024
e2e5d0d
Update portfile.cmake
m-kuhn Feb 13, 2024
173387c
Properly initialize vcpkg_root
m-kuhn Feb 13, 2024
e4bcf4d
More path
m-kuhn Feb 13, 2024
2c9eb0e
comment hack
m-kuhn Feb 13, 2024
43c6eb4
Update portfile.cmake
m-kuhn Feb 13, 2024
4ffab8d
nmake on windows
m-kuhn Feb 13, 2024
ae5822d
[py-pyqt-builder] Fix python lib path
m-kuhn Feb 26, 2024
4589a54
temp
m-kuhn Feb 27, 2024
80b884c
Use tricks from qmake
m-kuhn Feb 27, 2024
7c85572
Remove .exe
m-kuhn Feb 27, 2024
51f74b9
[py-pyqt6] Update port version
m-kuhn Feb 27, 2024
9fc2aa3
Install libtool
m-kuhn Feb 27, 2024
0da362c
exe on windows
m-kuhn Feb 27, 2024
48d7dc2
Fix non windows
m-kuhn Feb 27, 2024
d17d00d
adjust port version
m-kuhn Feb 27, 2024
20243ae
install and test
m-kuhn Feb 27, 2024
ccda10e
Apply suggestions from code review
m-kuhn Feb 28, 2024
6ef122a
Add py-pyqt6-sip
m-kuhn Feb 28, 2024
1974a03
Update portfile.cmake
m-kuhn Feb 29, 2024
4465ecc
Add vcpkg-make
m-kuhn Feb 29, 2024
49c60e0
some updates
m-kuhn Feb 29, 2024
1b5827d
Fix staging dir
m-kuhn Mar 1, 2024
a2d0252
Add target dir
m-kuhn Mar 2, 2024
52db76b
Fixup inventory
m-kuhn Mar 2, 2024
08bb2b5
Set osx deployment target
m-kuhn Mar 2, 2024
c38149f
Add vcpkg search path
m-kuhn Mar 2, 2024
ebd850e
Remove add_dll_directory patch
m-kuhn Mar 2, 2024
89bf29d
Fixups
m-kuhn Mar 2, 2024
e7cced1
Readd paths
m-kuhn Mar 2, 2024
f6fc755
Fixups
m-kuhn Mar 3, 2024
8a48ae5
version db
m-kuhn Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: 🔨 Prepare build env
run: |
brew install autoconf automake autoconf-archive
brew install autoconf automake autoconf-archive libtool

- name: 🐕 Checkout vcpkg
uses: actions/checkout@v4
Expand All @@ -59,6 +59,7 @@ jobs:
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
mono $NUGET_EXE setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json"
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite" >> $GITHUB_ENV
VCPKG_ROOT=$(pwd)/vcpkg
echo "PATH=$VCPKG_ROOT;$PATH" >> $GITHUB_ENV
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV

Expand All @@ -67,7 +68,8 @@ jobs:
VCPKG_OPTIONS="--overlay-ports="${{ github.workspace }}/ports" --host-triplet=${{ matrix.triplet }} --triplet=${{ matrix.triplet }} --x-buildtrees-root=${{ env.buildtrees }}"
./vcpkg/vcpkg install $VCPKG_OPTIONS py-pip
./vcpkg/vcpkg install $VCPKG_OPTIONS py-sip

# ./vcpkg/vcpkg install $VCPKG_OPTIONS py-pyqt6

- name: 📑 Upload logs
uses: actions/upload-artifact@v4
if: failure()
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,18 @@ jobs:
$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
$NUGET_EXE setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json"
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite" >> $GITHUB_ENV
VCPKG_ROOT=$(cygpath -w $(pwd)/vcpkg)
echo "PATH=$VCPKG_ROOT;$PATH" >> $GITHUB_ENV
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV


- name: 🌋 Build
run: |
.\vcpkg\vcpkg.exe install --overlay-ports="${{ github.workspace }}/ports" --triplet=${{ matrix.triplet }} py-sip
.\vcpkg\vcpkg.exe install --overlay-ports="${{ github.workspace }}/ports" --triplet=${{ matrix.triplet }} --x-buildtrees-root=C:/vcpkg-build py-pyqt6

- name: 📑 Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs-${{ matrix.triplet }}
path: /c/vcpkg/buildtrees/**/*.log
path: C:/vcpkg-build/**/*.log
2 changes: 1 addition & 1 deletion ports/py-packaging/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"homepage": "packaging.pypa.io/",
"license": "MIT",
"dependencies": [
"python3",
"py-flit-core",
"py-gpep517",
"python3",
{
"name": "vcpkg-python-scripts",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion ports/py-pip/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"description": "Tool for installing and managing Python packages",
"homepage": "https://pypi.org/project/setuptools",
"dependencies": [
"python3",
{
"name": "py-setuptools",
"host": true
},
"python3",
{
"name": "vcpkg-python-scripts",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion ports/py-ply/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"description": "Python Lex & Yacc",
"homepage": "https://www.dabeaz.com/ply/",
"dependencies": [
"python3",
{
"name": "py-setuptools",
"host": true
},
"python3",
{
"name": "vcpkg-python-scripts",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion ports/py-pyparsing/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"homepage": "https://github.com/pyparsing/pyparsing",
"license": "MIT",
"dependencies": [
"python3",
{
"name": "py-setuptools",
"host": true
},
"python3",
{
"name": "vcpkg-python-scripts",
"host": true
Expand Down
14 changes: 14 additions & 0 deletions ports/py-pyqt-builder/libpath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/pyqtbuild/project.py b/pyqtbuild/project.py
index 20ab60f..4f4d105 100644
--- a/pyqtbuild/project.py
+++ b/pyqtbuild/project.py
@@ -73,7 +73,8 @@ class PyQtProject(Project):
# these are actually non-user options but we need the 'link_full_dll'
# user option in order to set them.
if self.py_platform == 'win32':
- pylib_dir = os.path.join(sys.base_prefix, 'libs')
+ # vcpkg install python3.lib into [installed]/lib
+ pylib_dir = os.path.join(sys.base_prefix, '..', '..', 'lib')

debug_suffix = '_d' if self.py_debug else ''

2 changes: 2 additions & 0 deletions ports/py-pyqt-builder/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ vcpkg_from_pythonhosted(
PACKAGE_NAME PyQt-builder
VERSION ${VERSION}
SHA512 ec0b9f7784a32af744111615b93f98d73f284bb752fd71359c798d3b093a01925823effea72c866a5f49f77e3dfc5dee4125bbb289f647d84000bf34b5db6931
PATCHES
libpath.patch
)

vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -x)
Expand Down
4 changes: 2 additions & 2 deletions ports/py-pyqt-builder/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "py-pyqt-builder",
"version": "1.15.4",
"port-version": 2,
"port-version": 3,
"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.",
"homepage": "https://www.riverbankcomputing.com/software/pyqt-builder",
"dependencies": [
"python3",
{
"name": "py-setuptools",
"host": true
},
"python3",
{
"name": "vcpkg-python-scripts",
"host": true
Expand Down
16 changes: 16 additions & 0 deletions ports/py-pyqt6-sip/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

vcpkg_from_pythonhosted(
OUT_SOURCE_PATH SOURCE_PATH
PACKAGE_NAME PyQt6_sip
VERSION ${VERSION}
SHA512 bd2fa70d64544d8104d3477cb650a0e6bcefa0008680afcf7d187ba3fb1117871c0237d3a7f047144c8a8a8eeb8da941a3b206f8ee0601cb2cc734243cdb9d46
)

vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

vcpkg_python_test_import(MODULE "PyQt6.sip")

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
18 changes: 18 additions & 0 deletions ports/py-pyqt6-sip/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "py-pyqt6-sip",
"version": "13.6.0",
"description": "Python bindings for the Qt cross platform application toolkit",
"homepage": "https://www.riverbankcomputing.com/software/pyqt/",
"dependencies": [
{
"name": "py-setuptools",
"host": true
},
"py-sip",
"python3",
{
"name": "vcpkg-python-scripts",
"host": true
}
]
}
106 changes: 35 additions & 71 deletions ports/py-pyqt6/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
set(VCPKG_BUILD_TYPE release)

vcpkg_from_pythonhosted(
OUT_SOURCE_PATH SOURCE_PATH
Expand All @@ -7,91 +8,54 @@ vcpkg_from_pythonhosted(
SHA512 c2ff8c47c9b0e43c009d0c90f565a54344e6f384c67dd30c2d422465d0702c07713acc0095c8b67827d1146675611c07d548ba282a26e41bb60a0a21977a7a64
)

# https://www.riverbankcomputing.com/static/Docs/PyQt6/installation.html
set(SIPBUILD_ARGS
"--confirm-license"
"--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake.exe" #TODO: append .exe only on windows
"--api-dir" "${CURRENT_PACKAGES_DIR}/share/qt6/qsci/api/python"
"--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"
"--debug"
"--target-dir" "${CURRENT_PACKAGES_DIR}/lib/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}/site-packages"
"--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
"--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
"--target-dir" "${PYTHON3_SITEPACKAGES}"
)

set(SIPBUILD_ARGS
"--confirm-license"
"--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake.exe" #TODO: append .exe only on windows
"--api-dir" "${CURRENT_PACKAGES_DIR}/share/qt6/qsci/api/python"
"--verbose"
"--qt-shared"
"--no-make"
"--disable" "QtDesigner"
"--pep484-pyi"
# "--debug" # will create debuggable bindings
"--target-dir" "${CURRENT_PACKAGES_DIR}/lib/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}/site-packages"
"--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
)
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()

message(STATUS "Running sipbuild... (${PYTHON3})")
vcpkg_execute_required_process(
COMMAND "${PYTHON3}" "-m" "sipbuild.tools.build" ${SIPBUILD_ARGS}
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "sipbuild-${TARGET_TRIPLET}-0"
)
message(STATUS "Running sipbuild...finished.")

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

vcpkg_list(SET make_opts)
vcpkg_list(SET install_opts)
set(path_backup "$ENV{PATH}")
if (CMAKE_HOST_WIN32)
vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper")
if(NOT DEFINED Z_VCPKG_MAKE)
vcpkg_acquire_msys(MSYS_ROOT)
find_program(Z_VCPKG_MAKE make PATHS "${MSYS_ROOT}/usr/bin" NO_DEFAULT_PATH REQUIRED)
endif()
set(make_command "${Z_VCPKG_MAKE}")
vcpkg_list(SET make_opts -j ${VCPKG_CONCURRENCY} --trace -f ${MAKEFILE})
vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/Scripts/" "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt6/bin/" "${CURRENT_HOST_INSTALLED_DIR}/bin")

string(REPLACE " " [[\ ]] vcpkg_package_prefix "${CURRENT_PACKAGES_DIR}")
string(REGEX REPLACE [[([a-zA-Z]):/]] [[/\1/]] vcpkg_package_prefix "${vcpkg_package_prefix}")
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)
#TODO: optimize for install-data (release) and install-exec (release/debug)
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.")

else()
if(VCPKG_HOST_IS_OPENBSD)
find_program(Z_VCPKG_MAKE gmake REQUIRED)
else()
find_program(Z_VCPKG_MAKE make REQUIRED)
endif()
set(make_command "${Z_VCPKG_MAKE}")
vcpkg_list(SET make_opts V=1 -j ${VCPKG_CONCURRENCY} -f ${MAKEFILE})
vcpkg_list(SET install_opts -j ${VCPKG_CONCURRENCY} -f ${MAKEFILE} DESTDIR=${CURRENT_PACKAGES_DIR}/lib/python${PYTHON3_VERSION_MAJOR}.${PYTHON3_VERSION_MINOR}/site-packages)
# 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}")

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

vcpkg_list(SET make_cmd_line ${make_command} ${make_opts})
vcpkg_list(SET install_cmd_line ${make_command} install ${install_opts})
vcpkg_restore_env_variables(VARS PATH)

message(STATUS "Running build...")
vcpkg_execute_build_process(
COMMAND ${make_cmd_line}
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
LOGNAME "build-${TARGET_TRIPLET}${short_buildtype}"
)
message(STATUS "Running build... finished.")
message(STATUS "Running install...")
vcpkg_execute_build_process(
COMMAND ${install_cmd_line}
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel-build"
LOGNAME "install-${TARGET_TRIPLET}${short_buildtype}"
)
message(STATUS "Running install... finished.")
set(ENV{PATH} "${path_backup}")
vcpkg_python_test_import(MODULE "PyQt6.QtCore")
21 changes: 15 additions & 6 deletions ports/py-pyqt6/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
{
"name": "py-pyqt6",
"version": "6.6.1",
"port-version": 1,
"port-version": 2,
"description": "Python bindings for the Qt cross platform application toolkit",
"homepage": "https://www.riverbankcomputing.com/software/pyqt/",
"dependencies": [
"python3",
"py-sip",
"py-pyqt-builder",
"py-ply",
"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-cmake-get-vars",
"name": "vcpkg-qmake",
"host": true
}
]
Expand Down
13 changes: 0 additions & 13 deletions ports/py-sip/add_dll_directory.patch

This file was deleted.

2 changes: 0 additions & 2 deletions ports/py-sip/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ vcpkg_from_pythonhosted(
PACKAGE_NAME sip
VERSION ${VERSION}
SHA512 885c32a051e882b82b59bf1365050933f8fc1c619b19f4bc03235edc5741a5e14aae8edf90479ad0283f74ba5c5233a2589c151ec865b130199a6db9800a2294
PATCHES
add_dll_directory.patch
)

vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -x)
Expand Down
2 changes: 1 addition & 1 deletion ports/py-sip/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "py-sip",
"version": "6.7.12",
"port-version": 2,
"port-version": 3,
"description": "A tool that makes it easy to create Python bindings for C and C++ libraries",
"homepage": "https://www.riverbankcomputing.com/software/sip",
"dependencies": [
Expand Down
Loading