From b6130d17a3f422986fc558bcb721717de0818931 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Fri, 14 Nov 2025 17:19:54 +0300 Subject: [PATCH 1/7] Integrate the build system for the project --- build/PythonQt.prf | 10 ++++++---- build/PythonQt_QtAll.prf | 6 ++---- build/common.prf | 4 ++++ extensions/PythonQt_QtAll/PythonQt_QtAll.pro | 6 ++---- generator/generator.pri | 2 +- src/src.pro | 5 ++--- tests/tests.pro | 4 +--- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/build/PythonQt.prf b/build/PythonQt.prf index 208c10742..ad05eb2fa 100644 --- a/build/PythonQt.prf +++ b/build/PythonQt.prf @@ -11,8 +11,10 @@ CONFIG(debug, debug|release) { DEBUG_EXT = } -PYTHONQT_LIB_NAME=PythonQt-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} +PYTHONQT_LIB_NAME=trikPythonQt-Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} +!isEmpty(DESTDIR) { + LIBS += -L$$DESTDIR + QMAKE_RPATHDIR += $$DESTDIR +} -win32-g++: LIBS += $$DESTDIR/../lib/$${PYTHONQT_LIB_NAME}.dll -win32-*msvc*: LIBS += $$DESTDIR/../lib/$${PYTHONQT_LIB_NAME}.lib -unix: LIBS += -L$$DESTDIR/../lib -l$${PYTHONQT_LIB_NAME} +LIBS += -ltrikPythonQt-Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} \ No newline at end of file diff --git a/build/PythonQt_QtAll.prf b/build/PythonQt_QtAll.prf index dffc4806d..2f86c4912 100644 --- a/build/PythonQt_QtAll.prf +++ b/build/PythonQt_QtAll.prf @@ -1,5 +1,6 @@ # profile for non-mevis users to link to PythonQt_QtAll +include(../build/PythonQt.prf) INCLUDEPATH += $$PWD/../extensions/PythonQt_QtAll # check if debug or release @@ -9,7 +10,4 @@ CONFIG(debug, debug|release) { DEBUG_EXT = } - -win32-g++: LIBS += $$DESTDIR/../lib/PythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT}.dll -win32-msvc*: LIBS += $$DESTDIR/../lib/PythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT}.lib -unix: LIBS += -L$$DESTDIR/../lib -lPythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} \ No newline at end of file +LIBS += -ltrikPythonQt_QtAll-Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} \ No newline at end of file diff --git a/build/common.prf b/build/common.prf index 90a845f48..882692f88 100644 --- a/build/common.prf +++ b/build/common.prf @@ -17,6 +17,10 @@ CONFIG(debug, debug|release) { TARGET = $${TARGET}_d } +isEmpty(DESTDIR) { + DESTDIR = $$GLOBAL_DESTDIR +} + # Allow override (e.g., qmake PYTHONQT_GENERATED_PATH=/abs/path) isEmpty(PYTHONQT_GENERATED_PATH) { PYTHONQT_GENERATED_PATH = $$PWD/../generated_cpp diff --git a/extensions/PythonQt_QtAll/PythonQt_QtAll.pro b/extensions/PythonQt_QtAll/PythonQt_QtAll.pro index 39293951d..1b7090f07 100644 --- a/extensions/PythonQt_QtAll/PythonQt_QtAll.pro +++ b/extensions/PythonQt_QtAll/PythonQt_QtAll.pro @@ -30,15 +30,13 @@ isEmpty( PYTHONQTALL_CONFIG ) { eval(CONFIG += $${PYTHONQTALL_CONFIG}) } -TARGET = PythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-PythonXY +TARGET = trikPythonQt_QtAll-QtXY-PythonXY TEMPLATE = lib -DESTDIR = ../../lib - include ( ../../build/common.prf ) include ( ../../build/PythonQt.prf ) TARGET = $$replace(TARGET, PythonXY, Python$${PYTHON_VERSION}) - +TARGET = $$replace(TARGET, QtXY, Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}) CONFIG += qt strict_c++ msvc_mp !static:!staticlib { diff --git a/generator/generator.pri b/generator/generator.pri index c7d58552e..68a34e3f8 100644 --- a/generator/generator.pri +++ b/generator/generator.pri @@ -18,7 +18,7 @@ include($$GENERATORPATH/parser/rxx.pri) include($$GENERATORPATH/simplecpp/simplecpp.pri) -CONFIG += strict_c++ +CONFIG += qt strict_c++ win32-msvc*{ #Disable warning C4996 (deprecated declarations) QMAKE_CXXFLAGS += -wd4996 diff --git a/src/src.pro b/src/src.pro index bba84356c..45cfb9254 100644 --- a/src/src.pro +++ b/src/src.pro @@ -4,11 +4,9 @@ # $Source$ # -------------------------------------------------- -TARGET = PythonQt-Qt$${QT_MAJOR_VERSION}-PythonXY +TARGET = trikPythonQt-QtXY-PythonXY TEMPLATE = lib -DESTDIR = ../lib - CONFIG += qt msvc_mp CONFIG -= flat @@ -38,6 +36,7 @@ macx { include ( ../build/common.prf ) include ( ../build/python.prf ) TARGET = $$replace(TARGET, PythonXY, Python$${PYTHON_VERSION}) +TARGET = $$replace(TARGET, QtXY, Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}) include ( src.pri ) diff --git a/tests/tests.pro b/tests/tests.pro index 90a72ce07..2fc231a85 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -6,11 +6,9 @@ TARGET = PythonQtTest TEMPLATE = app -DESTDIR = ../lib QMAKE_RPATHDIR += $$DESTDIR - QT += testlib -CONFIG += testcase cmdline exceptions testcase_no_bundle no_testcase_installs +CONFIG += qt testcase cmdline exceptions testcase_no_bundle no_testcase_installs #Workaround for MinGW build. Qt incorrectly sets it to empty string on Win32 for bash mingw: TEST_TARGET_DIR = . From 8e85bd93f3fef17e85b7e2fdae938e00042e0f94 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Fri, 14 Nov 2025 17:45:58 +0300 Subject: [PATCH 2/7] Adapt to the original PythonQt --- build/common.prf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/common.prf b/build/common.prf index 882692f88..ac3bed1e6 100644 --- a/build/common.prf +++ b/build/common.prf @@ -18,9 +18,11 @@ CONFIG(debug, debug|release) { } isEmpty(DESTDIR) { - DESTDIR = $$GLOBAL_DESTDIR + isEmpty(GLOBAL_DESTDIR): DESTDIR = $$PWD/../bin + !isEmpty(GLOBAL_DESTDIR): DESTDIR = $$GLOBAL_DESTDIR } + # Allow override (e.g., qmake PYTHONQT_GENERATED_PATH=/abs/path) isEmpty(PYTHONQT_GENERATED_PATH) { PYTHONQT_GENERATED_PATH = $$PWD/../generated_cpp From 4df3309f51fe3557e356ca56a99d6a942844325c Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Fri, 14 Nov 2025 17:54:14 +0300 Subject: [PATCH 3/7] Add log info --- build/PythonQt.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/PythonQt.prf b/build/PythonQt.prf index ad05eb2fa..df910f0f7 100644 --- a/build/PythonQt.prf +++ b/build/PythonQt.prf @@ -11,10 +11,10 @@ CONFIG(debug, debug|release) { DEBUG_EXT = } -PYTHONQT_LIB_NAME=trikPythonQt-Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} +message("TRY READ DESTDIR: $$DESTDIR") !isEmpty(DESTDIR) { LIBS += -L$$DESTDIR QMAKE_RPATHDIR += $$DESTDIR } -LIBS += -ltrikPythonQt-Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} \ No newline at end of file +LIBS += -ltrikPythonQt-Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} From 2481862ee63f5858fe4d18add4e25d177264fa63 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Fri, 14 Nov 2025 18:05:14 +0300 Subject: [PATCH 4/7] Improve script --- examples/CPPPyWrapperExample/CPPPyWrapperExample.pro | 2 -- examples/PyCPPWrapperExample/PyCPPWrapperExample.pro | 2 -- examples/PyCustomMetaTypeExample/PyCustomMetaTypeExample.pro | 2 -- examples/PyDecoratorsExample/PyDecoratorsExample.pro | 2 -- examples/PyGettingStarted/PyGettingStarted.pro | 2 -- examples/PyGuiExample/PyGuiExample.pro | 2 -- examples/PyLauncher/PyLauncher.pro | 2 -- examples/PyScriptingConsole/PyScriptingConsole.pro | 2 -- 8 files changed, 16 deletions(-) diff --git a/examples/CPPPyWrapperExample/CPPPyWrapperExample.pro b/examples/CPPPyWrapperExample/CPPPyWrapperExample.pro index 164349955..ea53718b0 100644 --- a/examples/CPPPyWrapperExample/CPPPyWrapperExample.pro +++ b/examples/CPPPyWrapperExample/CPPPyWrapperExample.pro @@ -4,8 +4,6 @@ TEMPLATE = app mac:CONFIG -= app_bundle -DESTDIR = ../../lib - include ( ../../build/common.prf ) include ( ../../build/PythonQt.prf ) diff --git a/examples/PyCPPWrapperExample/PyCPPWrapperExample.pro b/examples/PyCPPWrapperExample/PyCPPWrapperExample.pro index 7ada73196..72261be1e 100644 --- a/examples/PyCPPWrapperExample/PyCPPWrapperExample.pro +++ b/examples/PyCPPWrapperExample/PyCPPWrapperExample.pro @@ -7,8 +7,6 @@ TARGET = PyCPPWrapperExample TEMPLATE = app -DESTDIR = ../../lib - include ( ../../build/common.prf ) include ( ../../build/PythonQt.prf ) diff --git a/examples/PyCustomMetaTypeExample/PyCustomMetaTypeExample.pro b/examples/PyCustomMetaTypeExample/PyCustomMetaTypeExample.pro index 952449f5a..4f061358c 100644 --- a/examples/PyCustomMetaTypeExample/PyCustomMetaTypeExample.pro +++ b/examples/PyCustomMetaTypeExample/PyCustomMetaTypeExample.pro @@ -7,8 +7,6 @@ TARGET = PyCustomMetaTypeExample TEMPLATE = app -DESTDIR = ../../lib - include ( ../../build/common.prf ) include ( ../../build/PythonQt.prf ) diff --git a/examples/PyDecoratorsExample/PyDecoratorsExample.pro b/examples/PyDecoratorsExample/PyDecoratorsExample.pro index 06bb8de4d..a92948f7b 100644 --- a/examples/PyDecoratorsExample/PyDecoratorsExample.pro +++ b/examples/PyDecoratorsExample/PyDecoratorsExample.pro @@ -7,8 +7,6 @@ TARGET = PyDecoratorsExample TEMPLATE = app -DESTDIR = ../../lib - include ( ../../build/common.prf ) include ( ../../build/PythonQt.prf ) diff --git a/examples/PyGettingStarted/PyGettingStarted.pro b/examples/PyGettingStarted/PyGettingStarted.pro index bf1d4d050..b255fe1bb 100644 --- a/examples/PyGettingStarted/PyGettingStarted.pro +++ b/examples/PyGettingStarted/PyGettingStarted.pro @@ -7,8 +7,6 @@ TARGET = PyGettingStarted TEMPLATE = app -DESTDIR = ../../lib - CONFIG += console include ( ../../build/common.prf ) diff --git a/examples/PyGuiExample/PyGuiExample.pro b/examples/PyGuiExample/PyGuiExample.pro index bd200da05..f8199b302 100644 --- a/examples/PyGuiExample/PyGuiExample.pro +++ b/examples/PyGuiExample/PyGuiExample.pro @@ -9,8 +9,6 @@ TEMPLATE = app mac:CONFIG -= app_bundle -DESTDIR = ../../lib - QT += widgets include ( ../../build/common.prf ) diff --git a/examples/PyLauncher/PyLauncher.pro b/examples/PyLauncher/PyLauncher.pro index e8b9686b1..ebd5c25a7 100644 --- a/examples/PyLauncher/PyLauncher.pro +++ b/examples/PyLauncher/PyLauncher.pro @@ -9,8 +9,6 @@ TEMPLATE = app mac:CONFIG -= app_bundle -DESTDIR = ../../lib - QT += widgets include ( ../../build/common.prf ) diff --git a/examples/PyScriptingConsole/PyScriptingConsole.pro b/examples/PyScriptingConsole/PyScriptingConsole.pro index b2b7b5115..015f6c619 100644 --- a/examples/PyScriptingConsole/PyScriptingConsole.pro +++ b/examples/PyScriptingConsole/PyScriptingConsole.pro @@ -7,8 +7,6 @@ TARGET = PyScriptingConsole TEMPLATE = app -DESTDIR = ../../lib - mac:CONFIG-= app_bundle include ( ../../build/common.prf ) From c7f83ee6336cbbb7dd134c7d2c535517d2d00dc6 Mon Sep 17 00:00:00 2001 From: MinyazevR <89993880+MinyazevR@users.noreply.github.com> Date: Fri, 14 Nov 2025 18:29:17 +0300 Subject: [PATCH 5/7] Remove empty line --- build/common.prf | 1 - 1 file changed, 1 deletion(-) diff --git a/build/common.prf b/build/common.prf index ac3bed1e6..adb11819f 100644 --- a/build/common.prf +++ b/build/common.prf @@ -22,7 +22,6 @@ isEmpty(DESTDIR) { !isEmpty(GLOBAL_DESTDIR): DESTDIR = $$GLOBAL_DESTDIR } - # Allow override (e.g., qmake PYTHONQT_GENERATED_PATH=/abs/path) isEmpty(PYTHONQT_GENERATED_PATH) { PYTHONQT_GENERATED_PATH = $$PWD/../generated_cpp From c7b20a4b1a0d32ccdde430795f2fee7a8a91c977 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Fri, 14 Nov 2025 18:25:14 +0300 Subject: [PATCH 6/7] Add CI for building PythonQt and generator on altlinux --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a05ce0fab..a9f064a0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,6 +128,45 @@ jobs: path: generated_cpp if-no-files-found: error + altlinux: + runs-on: ubuntu-latest + container: altlinux/base:latest + steps: + - name: Install Qt + run: | + apt-get update && apt-get install -y \ + gcc-c++ \ + python3-dev \ + libpython3 \ + qt5-base-devel \ + qt5-tools-devel \ + qt5-declarative-devel \ + qt5-svg-devel \ + qt5-multimedia-devel \ + qt5-xmlpatterns-devel \ + qt5-multimedia-devel \ + qt5-quick1-devel \ + qt5-script-devel \ + qt5-3d-devel \ + make + apt-get clean + + - name: Checkout PythonQt + uses: actions/checkout@v3 + + - name: Build PythonQt + run: | + export QT_SELECT=qt5 + echo ======= SYSTEM INFO ======== + uname -a; gcc --version | grep "gcc"; python3 --version; qmake-qt5 --version + echo ============================ + export PYTHON_VERSION_SHORT=`python3 --version | cut -d " " -f 2 | cut -d "." -f1,2` + qmake-qt5 -r PythonQt.pro CONFIG+=release \ + "PYTHON_VERSION=${PYTHON_VERSION_SHORT}" PYTHON_DIR="/usr" + make -j $(nproc) && \ + PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ + make check + oldschool: strategy: fail-fast: false From 1a21795afac8683bca0aa6da81c1cb7be7a3226d Mon Sep 17 00:00:00 2001 From: MinyazevR <89993880+MinyazevR@users.noreply.github.com> Date: Fri, 14 Nov 2025 18:39:23 +0300 Subject: [PATCH 7/7] Add -platform minimal for AltLinux build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9f064a0d..fd1cc4e7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,7 @@ jobs: "PYTHON_VERSION=${PYTHON_VERSION_SHORT}" PYTHON_DIR="/usr" make -j $(nproc) && \ PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ - make check + make check TESTARGS="-platform minimal" oldschool: strategy: