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 26 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
8 changes: 7 additions & 1 deletion .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,12 @@ 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

- uses: m-kuhn/action-tmate@patch-1
if: failure()


- 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
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
2 changes: 1 addition & 1 deletion ports/py-pyqt-builder/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"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": [
Expand Down
99 changes: 34 additions & 65 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,59 @@ vcpkg_from_pythonhosted(
SHA512 c2ff8c47c9b0e43c009d0c90f565a54344e6f384c67dd30c2d422465d0702c07713acc0095c8b67827d1146675611c07d548ba282a26e41bb60a0a21977a7a64
)

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"
"--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(CMAKE_HOST_WIN32)
set(EXE_SUFFIX ".exe")
endif()

set(SIPBUILD_ARGS
"--confirm-license"
"--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake.exe" #TODO: append .exe only on windows
"--qmake" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qmake${EXE_SUFFIX}"
"--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"
"--build-dir" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
)

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.")
message(STATUS "Running sipbuild...")

# 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})
# Make sure sipbuild can find QtCore.dll
vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/" "${CURRENT_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)
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)
if(CMAKE_HOST_WIN32)
if(VCPKG_TARGET_IS_MINGW)
find_program(MINGW32_MAKE mingw32-make REQUIRED)
set(invoke_command "${MINGW32_MAKE}")
else()
find_program(Z_VCPKG_MAKE make REQUIRED)
vcpkg_find_acquire_program(JOM)
set(invoke_command "${JOM}")
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)

# To find sip-distinfo and python3 during install
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/tools:${CURRENT_INSTALLED_DIR}/tools/python3:$ENV{PATH}")
else()
find_program(MAKE make)
set(invoke_command "${MAKE}")
endif()

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

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}"
COMMAND "${invoke_command}" -j ${VCPKG_CONCURRENCY} install
NO_PARALLEL_COMMAND "${invoke_command}" -j 1 install
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
LOGNAME "build-${TARGET_TRIPLET}-rel"
)
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}")
message(STATUS "Running build...finished.")

vcpkg_python_test_import(MODULE PyQt6)

vcpkg_restore_env_variables(VARS PATH)
11 changes: 10 additions & 1 deletion ports/py-pyqt6/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"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": [
Expand All @@ -10,7 +10,16 @@
"py-pyqt-builder",
"py-ply",
"py-packaging",
{
"name": "qtactiveqt",
"platform": "windows"
},
"qtbase",
"qtmultimedia",
"qtsensors",
"qtsvg",
"qtwebchannel",
"qtwebsockets",
{
"name": "vcpkg-python-scripts",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion ports/py-sip/add_dll_directory.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index 3a3b094..a551b47 100644

# Publish the public API.
+import os
+os.add_dll_directory(os.path.abspath(os.path.join(__file__, "../../../../../../bin")))
+os.add_dll_directory(os.path.abspath(os.path.join(__file__, "../../../../../../bin"))) if os.name == 'nt' else None
from .abstract_builder import AbstractBuilder
from .abstract_project import AbstractProject
from .bindings import Bindings
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