Skip to content

Commit

Permalink
Fixes to get a Qt6 installer build
Browse files Browse the repository at this point in the history
  • Loading branch information
acolwell committed Mar 12, 2024
1 parent 9a1e54c commit 102296a
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 144 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
${GITHUB_WORKSPACE}/.github/workflows/install_natron_pacman_repo.sh ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}/natron_pacman_repo
pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
pacman -Rs mingw-w64-x86_64-qt5-base mingw-w64-x86_64-pyside2 mingw-w64-x86_64-shiboken2
pacman -S --needed --noconfirm mingw-w64-x86_64-qt6-base mingw-w64-x86_64-pyside6 mingw-w64-x86_64-shiboken6
- name: Build
id: build
run: |
Expand All @@ -42,7 +45,7 @@ jobs:
cd tools/jenkins
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=5 DISABLE_BREAKPAD=1 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 ./launchBuildMain.sh
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=6 DISABLE_BREAKPAD=1 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 ./launchBuildMain.sh
ARCHIVE_DIR=${NATRON_BUILD_WORKSPACE_UNIX}/builds_archive/natron/1
INSTALLER_ZIP_UNIX=$(ls ${ARCHIVE_DIR}/Natron*Windows-x86_64.zip)
Expand All @@ -66,7 +69,7 @@ jobs:
- name: Uninstall Natron dependencies
run: |
pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
pacman -Rs mingw-w64-x86_64-qt6-base mingw-w64-x86_64-pyside6 mingw-w64-x86_64-shiboken6
- name: Verify plugin loading
run: |
INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }}
Expand Down Expand Up @@ -106,6 +109,8 @@ jobs:
${GITHUB_WORKSPACE}/.github/workflows/install_natron_pacman_repo.sh ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}/natron_pacman_repo
pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
pacman -Rs mingw-w64-x86_64-qt5-base mingw-w64-x86_64-pyside2 mingw-w64-x86_64-shiboken2
pacman -S --needed --noconfirm mingw-w64-x86_64-qt6-base mingw-w64-x86_64-pyside6 mingw-w64-x86_64-shiboken6
- name: Build
id: build
run: |
Expand All @@ -114,7 +119,7 @@ jobs:
cd tools/jenkins
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=5 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 ./launchBuildMain.sh
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=6 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 ./launchBuildMain.sh
ARCHIVE_DIR=${NATRON_BUILD_WORKSPACE_UNIX}/builds_archive/natron/1
INSTALLER_ZIP_UNIX=$(ls ${ARCHIVE_DIR}/Natron*-breakpad.zip)
Expand Down Expand Up @@ -148,6 +153,7 @@ jobs:
- name: Uninstall Natron dependencies
run: |
pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
pacman -Rs mingw-w64-x86_64-qt6-base mingw-w64-x86_64-pyside6 mingw-w64-x86_64-shiboken6
- name: Verify plugin loading
run: |
Expand Down
1 change: 1 addition & 0 deletions App/App.pro
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ CONFIG += static-gui static-engine static-host-support static-breakpadclient sta

QT += gui core opengl network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets concurrent
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat openglwidgets

!noexpat: CONFIG += expat

Expand Down
105 changes: 5 additions & 100 deletions Engine/Engine.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CONFIG += moc
CONFIG += boost boost-serialization-lib qt cairo python shiboken pyside
QT += core network
greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat

ENGINE_WRAPPER_DIR = Qt$${QT_MAJOR_VERSION}/NatronEngine

Expand Down Expand Up @@ -433,54 +434,10 @@ HEADERS += \
$${ENGINE_WRAPPER_DIR}/natronengine_python.h \

ENGINE_GENERATED_SOURCES = \
animatedparam_wrapper \
app_wrapper \
appsettings_wrapper \
beziercurve_wrapper \
booleanparam_wrapper \
boolnodecreationproperty_wrapper \
buttonparam_wrapper \
choiceparam_wrapper \
colorparam_wrapper \
colortuple_wrapper \
double2dparam_wrapper \
double2dtuple_wrapper \
double3dparam_wrapper \
double3dtuple_wrapper \
doubleparam_wrapper \
effect_wrapper \
exprutils_wrapper \
fileparam_wrapper \
floatnodecreationproperty_wrapper \
group_wrapper \
groupparam_wrapper \
imagelayer_wrapper \
int2dparam_wrapper \
int2dtuple_wrapper \
int3dparam_wrapper \
int3dtuple_wrapper \
intnodecreationproperty_wrapper \
intparam_wrapper \
itembase_wrapper \
layer_wrapper \
natron_enum_wrapper \
nodecreationproperty_wrapper \
outputfileparam_wrapper \
pageparam_wrapper \
param_wrapper \
parametricparam_wrapper \
pathparam_wrapper \
pycoreapplication_wrapper \
rectd_wrapper \
recti_wrapper \
roto_wrapper \
separatorparam_wrapper \
stringnodecreationproperty_wrapper \
stringparam_wrapper \
stringparambase_wrapper \
track_wrapper \
tracker_wrapper \
userparamholder_wrapper \
natron_python_wrapper \
natron_rectd_wrapper \
natron_recti_wrapper \
natron_wrapper \

for(name, ENGINE_GENERATED_SOURCES) {
SOURCES += $${ENGINE_WRAPPER_DIR}/$${name}.cpp
Expand All @@ -491,58 +448,6 @@ for(name, ENGINE_GENERATED_SOURCES) {
OTHER_FILES += \
typesystem_engine.xml

# GENERATED_SOURCES = \
# NatronEngine/animatedparam_wrapper.cpp \
# NatronEngine/app_wrapper.cpp \
# NatronEngine/beziercurve_wrapper.cpp \
# NatronEngine/booleanparam_wrapper.cpp \
# NatronEngine/buttonparam_wrapper.cpp \
# NatronEngine/choiceparam_wrapper.cpp \
# NatronEngine/colorparam_wrapper.cpp \
# NatronEngine/colortuple_wrapper.cpp \
# NatronEngine/double2dparam_wrapper.cpp \
# NatronEngine/double2dtuple_wrapper.cpp \
# NatronEngine/double3dparam_wrapper.cpp \
# NatronEngine/double3dtuple_wrapper.cpp \
# NatronEngine/doubleparam_wrapper.cpp \
# NatronEngine/effect_wrapper.cpp \
# NatronEngine/fileparam_wrapper.cpp \
# NatronEngine/group_wrapper.cpp \
# NatronEngine/groupparam_wrapper.cpp \
# NatronEngine/int2dparam_wrapper.cpp \
# NatronEngine/int2dtuple_wrapper.cpp \
# NatronEngine/int3dparam_wrapper.cpp \
# NatronEngine/int3dtuple_wrapper.cpp \
# NatronEngine/intparam_wrapper.cpp \
# NatronEngine/itembase_wrapper.cpp \
# NatronEngine/layer_wrapper.cpp \
# NatronEngine/natron_wrapper.cpp \
# NatronEngine/natronengine_module_wrapper.cpp \
# NatronEngine/outputfileparam_wrapper.cpp \
# NatronEngine/pageparam_wrapper.cpp \
# NatronEngine/param_wrapper.cpp \
# NatronEngine/parametricparam_wrapper.cpp \
# NatronEngine/pathparam_wrapper.cpp \
# NatronEngine/roto_wrapper.cpp \
# NatronEngine/stringparam_wrapper.cpp \
# NatronEngine/stringparambase_wrapper.cpp

# defineReplace(shibokenWorkaround) {
# SOURCES += $$GENERATED_SOURCES
# return("%_wrapper.cpp")
# }

# isEmpty(SHIBOKEN) {
# SHIBOKEN = shiboken
# }

# SHIBOKEN_FILE = . # Need to give some bogus input
# SHIBOKEN.input = SHIBOKEN_FILE
# SHIBOKEN.output_function = shibokenWorkaround
# SHIBOKEN.commands = $$SHIBOKEN --include-paths=..:$$system(pkg-config --variable=includedir pyside) --typesystem-paths=$$system(pkg-config --variable=typesystemdir pyside) Pyside_Engine_Python.h typesystem_engine.xml
# SHIBOKEN.CONFIG = no_link # don't add the .cpp target file to OBJECTS
# SHIBOKEN.clean = dummy # don't remove the %_wrapper.cpp file by "make clean"

# QMAKE_EXTRA_COMPILERS += SHIBOKEN
macx {

Expand Down
12 changes: 5 additions & 7 deletions Gui/Gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ QT += gui core network

greaterThan(QT_MAJOR_VERSION, 4) {
QT += concurrent widgets

greaterThan(QT_MAJOR_VERSION, 5) {
QT += core5compat openglwidgets
}
} else {
QT += opengl
}
Expand Down Expand Up @@ -386,13 +390,7 @@ HEADERS += \
../libs/OpenFX_extensions/ofxhParametricParam.h \
$${GUI_WRAPPER_DIR}/natrongui_python.h \

GUI_GENERATED_SOURCES = \
guiapp_wrapper \
pyguiapplication_wrapper \
pymodaldialog_wrapper \
pypanel_wrapper \
pytabwidget_wrapper \
pyviewer_wrapper
GUI_GENERATED_SOURCES =

for(name, GUI_GENERATED_SOURCES) {
SOURCES += $${GUI_WRAPPER_DIR}/$${name}.cpp
Expand Down
1 change: 1 addition & 0 deletions Renderer/Renderer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
QT += core network
QT -= gui
greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat

TARGET = NatronRenderer
CONFIG += console
Expand Down
1 change: 1 addition & 0 deletions Tests/Tests.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CONFIG += boost boost-serialization-lib opengl qt cairo python shiboken pyside
CONFIG += static-gui static-engine static-host-support static-breakpadclient static-libmv static-openmvg static-ceres static-libtess
QT += gui core opengl network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets concurrent
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat openglwidgets

CONFIG += openmvg-flags glad-flags

Expand Down
56 changes: 39 additions & 17 deletions global.pri
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with Natron. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>
# ***** END LICENSE BLOCK *****

CONFIG += c++11 c++14
CONFIG += c++11 c++17

# libs may modify the config (eg openmp), so it must be included before
include(libs.pri)
Expand Down Expand Up @@ -309,10 +309,10 @@ macx-clang-libc++ {
QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
QMAKE_OBJECTIVE_CXXFLAGS += -stdlib=libc++ -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
c++11 {
c++14 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++14
c++17 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++17
}
!c++14 {
!c++17 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++11
}
}
Expand All @@ -323,10 +323,10 @@ macx-clang {
QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
QMAKE_OBJECTIVE_CXXFLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
c++11 {
c++14 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++14
c++17 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++17
}
!c++14 {
!c++17 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++11
}
}
Expand Down Expand Up @@ -418,6 +418,16 @@ win32-g++ {

expat: PKGCONFIG += expat
cairo: PKGCONFIG += cairo fontconfig
equals(QT_MAJOR_VERSION, 6) {
shiboken: INCLUDEPATH += $$system(pkg-config --variable=includedir shiboken6)
PYSIDE_INCLUDEDIR = $$system(pkg-config --variable=includedir pyside6)
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtCore
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtGui
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtWidgets
shiboken: PKGCONFIG += shiboken6
pyside: PKGCONFIG += pyside6
}
equals(QT_MAJOR_VERSION, 5) {
shiboken: INCLUDEPATH += $$system(pkg-config --variable=includedir shiboken2)
PYSIDE_INCLUDEDIR = $$system(pkg-config --variable=includedir pyside2)
Expand Down Expand Up @@ -472,7 +482,19 @@ unix {
INCLUDEPATH *= $$PYTHON_INCLUDEPATH
}

equals(QT_MAJOR_VERSION, 5) {
equals(QT_MAJOR_VERSION, 6) {
system(pkg-config --exists pyside6) {
shiboken: PKGCONFIG += shiboken6
pyside: PKGCONFIG += pyside6
# add QtCore to includes
PYSIDE_INCLUDEDIR = $$system(pkg-config --variable=includedir pyside6)
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtCore
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtGui
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtWidgets
}
}

equals(QT_MAJOR_VERSION, 5) {
system(pkg-config --exists pyside2) {
shiboken: PKGCONFIG += shiboken2
pyside: PKGCONFIG += pyside2
Expand Down Expand Up @@ -528,13 +550,13 @@ unix {
symbols_hidden_by_default.value = YES
QMAKE_MAC_XCODE_SETTINGS += symbols_hidden_by_default
c++11 {
c++14 {
QMAKE_CXXFLAGS += -std=c++14
enable_cxx14.name = CLANG_CXX_LANGUAGE_STANDARD
enable_cxx14.value = c++14
QMAKE_MAC_XCODE_SETTINGS += enable_cxx14
c++17 {
QMAKE_CXXFLAGS += -std=c++17
enable_cxx17.name = CLANG_CXX_LANGUAGE_STANDARD
enable_cxx17.value = c++17
QMAKE_MAC_XCODE_SETTINGS += enable_cxx17
}
!c++14 {
!c++17 {
QMAKE_CXXFLAGS += -std=c++11
enable_cxx11.name = CLANG_CXX_LANGUAGE_STANDARD
enable_cxx11.value = c++0x
Expand All @@ -547,10 +569,10 @@ unix {
QMAKE_CXXFLAGS += -ftemplate-depth-1024
QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-extensions
c++11 {
c++14 {
QMAKE_CXXFLAGS += -std=c++14
c++17 {
QMAKE_CXXFLAGS += -std=c++17
}
!c++14 {
!c++17 {
QMAKE_CXXFLAGS += -std=c++11
}
}
Expand Down
17 changes: 10 additions & 7 deletions tools/jenkins/build-Windows-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ cp "$INC_PATH/config/"*.png "$INSTALLER_PATH/config/"

# make sure we have mt and qtifw

if ! which mt.exe; then
MT_EXE=mt.exe
if ! which ${MT_EXE}; then
# Add Windows SDK to path so that mt.exe is available.
WIN_SDK_MAJOR_VERSION=10
WIN_SDK_BASE_PATH="/c/Program Files (x86)/Windows Kits/${WIN_SDK_MAJOR_VERSION}/bin"
WIN_SDK_VERSION=$(ls "${WIN_SDK_BASE_PATH}" | grep "${WIN_SDK_MAJOR_VERSION}." | sort -n | tail -1)
PATH="${WIN_SDK_BASE_PATH}/${WIN_SDK_VERSION}/x64/":${PATH}
MT_EXE=$(find "${WIN_SDK_BASE_PATH}" -name mt.exe | grep x64 | sort -n | tail -1)

if ! which mt.exe; then
if ! which "${MT_EXE}"; then
echo "Failed to find mt.exe"
exit 1
fi
Expand Down Expand Up @@ -222,7 +222,7 @@ function installPlugin() {
done
echo "</assembly>" >> "$PLUGIN_MANIFEST"
for location in "$PKG_PATH/data" "${TMP_PORTABLE_DIR}"; do
(cd "$location/Plugins/OFX/Natron/${OFX_BINARY}.ofx.bundle/Contents/Win${BITS}"; mt -nologo -manifest "$PLUGIN_MANIFEST" -outputresource:"${OFX_BINARY}.ofx;2")
(cd "$location/Plugins/OFX/Natron/${OFX_BINARY}.ofx.bundle/Contents/Win${BITS}"; "${MT_EXE}" -nologo -manifest "$PLUGIN_MANIFEST" -outputresource:"${OFX_BINARY}.ofx;2")
done

fi
Expand Down Expand Up @@ -410,7 +410,10 @@ mkdir -p "${TMP_PORTABLE_DIR}/Plugins"
cp -a "$SDK_HOME/lib/python${PYVER}" "${TMP_PORTABLE_DIR}/lib/"


if [[ ${QT_VERSION_MAJOR} -ge 5 ]]; then
if [[ ${QT_VERSION_MAJOR} -ge 6 ]]; then
PYSIDE_PLUGIN_PATH="${TMP_PORTABLE_DIR}/Plugins/PySide6"
mv "${TMP_PORTABLE_DIR}/lib/python${PYVER}/site-packages/PySide6" "${TMP_PORTABLE_DIR}/lib/python${PYVER}/site-packages/shiboken6" "${TMP_PORTABLE_DIR}/Plugins"
elif [[ ${QT_VERSION_MAJOR} -eq 5 ]]; then
PYSIDE_PLUGIN_PATH="${TMP_PORTABLE_DIR}/Plugins/PySide2"
mv "${TMP_PORTABLE_DIR}/lib/python${PYVER}/site-packages/PySide2" "${TMP_PORTABLE_DIR}/lib/python${PYVER}/site-packages/shiboken2" "${TMP_PORTABLE_DIR}/Plugins"
else
Expand Down Expand Up @@ -450,7 +453,7 @@ fi

# python zip
if [ "${USE_QT5:-}" != 1 ]; then
rm -rf "$PYDIR"/site-packages/shiboken2* "$PYDIR"/site-packages/PySide2 || true
rm -rf "$PYDIR"/site-packages/shiboken2* "$PYDIR"/site-packages/PySide2 "$PYDIR"/site-packages/shiboken6* "$PYDIR"/site-packages/PySide6 || true
fi

export PY_BIN="$SDK_HOME/bin/python.exe"
Expand Down
Loading

0 comments on commit 102296a

Please sign in to comment.