Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 TESTARGS="-platform minimal"

oldschool:
strategy:
fail-fast: false
Expand Down
Binary file added .github/workflows/trikset.yml
Binary file not shown.
10 changes: 6 additions & 4 deletions build/PythonQt.prf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ CONFIG(debug, debug|release) {
DEBUG_EXT =
}

PYTHONQT_LIB_NAME=PythonQt-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT}
message("TRY READ DESTDIR: $$DESTDIR")
!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}
6 changes: 2 additions & 4 deletions build/PythonQt_QtAll.prf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}
LIBS += -ltrikPythonQt_QtAll-Qt$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT}
28 changes: 23 additions & 5 deletions build/common.prf
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,33 @@ CONFIG(debug, debug|release) {
TARGET = $${TARGET}_d
}

!include(../../../global.pri)

isEmpty(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
}

# Fallbacks to checked-in wrappers
!exists($$PYTHONQT_GENERATED_PATH) {
# Exact version directory (e.g., generated_cpp_515 or generated_cpp_69)
PYTHONQT_GENERATED_PATH_VERSIONED = $$PWD/../generated_cpp_$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION}
exists($$PYTHONQT_GENERATED_PATH_VERSIONED) {
PYTHONQT_GENERATED_PATH = $$PYTHONQT_GENERATED_PATH_VERSIONED
# If no files are generated, try the checked-in wrappers:
PYTHONQT_GENERATED_PATH = $$PWD/../generated_cpp_$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}

!exists($$PYTHONQT_GENERATED_PATH) {
PYTHONQT_GENERATED_PATH = $$PWD/../generated_cpp_$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}
}
}

!exists($$PYTHONQT_GENERATED_PATH) {
error("No generated wrapper sources for Qt $${QT_VERSION}.\n" \
"Looked in:\n" \
" - $$PWD/../generated_cpp\n" \
" - $$PWD/../generated_cpp_$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION} (e.g., generated_cpp_515)\n" \
" - $$PWD/../generated_cpp_$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION} (e.g., generated_cpp_5.15)\n" \
"Generate them first:\n" \
" qmake CONFIG+=generator_only && make\n" \
" cd generator && ./pythonqt_generator\n" \
Expand All @@ -49,8 +57,18 @@ isEmpty(PYTHONQT_GENERATED_PATH) {
}

VERSION = 3.2.0
greaterThan(QT_MAJOR_VERSION, 5) | greaterThan(QT_MINOR_VERSION, 9): CONFIG += c++17 c++11
win32: CONFIG += skip_target_version_ext
gcc|win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-deprecated-declarations -Wuninitialized -Winit-self -pedantic
win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-unused-command-line-argument
#Do not issue warning to system includes
gcc:!isEmpty(QT_INSTALL_HEADERS): QMAKE_CXXFLAGS += -isystem $$[QT_INSTALL_HEADERS]


QMAKE_CXXFLAGS -= -Werror -Werror=pedantic -pedantic-errors -Werror=cast-qual
clang:QMAKE_CXXFLAGS += -Wno-error

# GCC 14+ on Linux emits QtPrivate::IsFloatType_v<_Float16> with
# multiple-ODR symbols across TUs when targeting GNU17+ with Qt 6.7.
greaterThan(QT_MAJOR_VERSION, 5):gcc:!win32-clang-msvc: QMAKE_LFLAGS += -Wl,--allow-multiple-definition
greaterThan(QT_MAJOR_VERSION, 5):gcc:!win32-clang-msvc: QMAKE_LFLAGS_SHLIB += -Wl,--allow-multiple-definition
7 changes: 3 additions & 4 deletions build/python.prf
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ contains(PKGCONFIG, "python.*"){
isEmpty(PYTHON_PATH):PYTHON_PATH=$(PYTHON_PATH)
isEmpty(PYTHON_PATH)|!exists("$$PYTHON_PATH\\include") | !exists("$$PYTHON_PATH\\libs\\") {
error("PYTHON_PATH must be set to correct folder with \\libs and \\include subfolders ")
}

INCLUDEPATH += $$shell_path($${PYTHON_PATH}/include)
}
INCLUDEPATH += $${PYTHON_PATH}/include

LIBS += $$shell_path(-L$${PYTHON_PATH}/libs)
LIBS += -L$${PYTHON_PATH}/libs
LIBS += -lpython$${PYTHON_VERSION_MAJOR}$${PYTHON_VERSION_MINOR}$${DEBUG_EXT}

# Hack for "CONFIG+=testcase" and 'make check' to add python's dll to PATH
Expand Down
8 changes: 3 additions & 5 deletions examples/CPPPyWrapperExample/CPPPyWrapperExample.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ TEMPLATE = app

mac:CONFIG -= app_bundle

DESTDIR = ../../lib

include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )
include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )

QT += widgets

SOURCES += \
CPPPyWrapperExample.cpp
CPPPyWrapperExample.cpp

RESOURCES += CPPPyWrapperExample.qrc
6 changes: 2 additions & 4 deletions examples/PyCPPWrapperExample/PyCPPWrapperExample.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
TARGET = PyCPPWrapperExample
TEMPLATE = app

DESTDIR = ../../lib

include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )
include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )

QT += widgets

Expand Down
8 changes: 3 additions & 5 deletions examples/PyCustomMetaTypeExample/PyCustomMetaTypeExample.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
TARGET = PyCustomMetaTypeExample
TEMPLATE = app

DESTDIR = ../../lib

include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )

include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )

QT += widgets

HEADERS += \
Expand Down
8 changes: 3 additions & 5 deletions examples/PyDecoratorsExample/PyDecoratorsExample.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
TARGET = PyDecoratorsExample
TEMPLATE = app

DESTDIR = ../../lib

include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )

include ( ../../build/common.prf )
include ( ../../build/PythonQt.prf )

QT += widgets

HEADERS += \
Expand Down
2 changes: 0 additions & 2 deletions examples/PyGettingStarted/PyGettingStarted.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
TARGET = PyGettingStarted
TEMPLATE = app

DESTDIR = ../../lib

CONFIG += console

include ( ../../build/common.prf )
Expand Down
2 changes: 0 additions & 2 deletions examples/PyGuiExample/PyGuiExample.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ TEMPLATE = app

mac:CONFIG -= app_bundle

DESTDIR = ../../lib

QT += widgets

include ( ../../build/common.prf )
Expand Down
2 changes: 0 additions & 2 deletions examples/PyLauncher/PyLauncher.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ TEMPLATE = app

mac:CONFIG -= app_bundle

DESTDIR = ../../lib

QT += widgets

include ( ../../build/common.prf )
Expand Down
2 changes: 0 additions & 2 deletions examples/PyScriptingConsole/PyScriptingConsole.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
TARGET = PyScriptingConsole
TEMPLATE = app

DESTDIR = ../../lib

mac:CONFIG-= app_bundle

include ( ../../build/common.prf )
Expand Down
12 changes: 5 additions & 7 deletions extensions/PythonQt_QtAll/PythonQt_QtAll.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
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 {
Expand All @@ -51,7 +49,7 @@ DEFINES += PYTHONQT_QTALL_EXPORTS

HEADERS += \
$$PWD/PythonQt_QtAll.h

SOURCES += \
$$PWD/PythonQt_QtAll.cpp

Expand Down
1 change: 1 addition & 0 deletions generated_cpp.5.10
1 change: 1 addition & 0 deletions generated_cpp_5.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
HEADERS += \
$$PWD/com_trolltech_qt_core0.h \
$$PWD/com_trolltech_qt_core1.h \
$$PWD/com_trolltech_qt_core2.h \
$$PWD/com_trolltech_qt_core3.h \
$$PWD/com_trolltech_qt_core4.h \

SOURCES += \
$$PWD/com_trolltech_qt_core0.cpp \
$$PWD/com_trolltech_qt_core1.cpp \
$$PWD/com_trolltech_qt_core2.cpp \
$$PWD/com_trolltech_qt_core3.cpp \
$$PWD/com_trolltech_qt_core4.cpp \
$$PWD/com_trolltech_qt_core_init.cpp
Loading
Loading