From f93d7d57e0830b13e418d3c033003656832544d8 Mon Sep 17 00:00:00 2001 From: liuliuzo Date: Sat, 1 Aug 2026 08:45:25 +0000 Subject: [PATCH] Add MinGW Windows packaging support --- 3rdparty/3rdparty.pri | 23 ++++++++++++++++--- 3rdparty/pyotherside.pri | 14 +++++++++--- build/windows/installer/installer.nsi | 27 +++++++++++++++-------- build/windows/installer/resources/qt.conf | 4 +++- 4 files changed, 52 insertions(+), 16 deletions(-) diff --git a/3rdparty/3rdparty.pri b/3rdparty/3rdparty.pri index cf64b8628..c474e1d2c 100644 --- a/3rdparty/3rdparty.pri +++ b/3rdparty/3rdparty.pri @@ -56,9 +56,26 @@ HEADERS += $$SIMDJSONDIR/simdjson.h SOURCES += $$SIMDJSONDIR/simdjson.cpp -win32* { - ZLIBDIR = $$PWD/zlib-msvc14-x64.1.2.11.7795/build/native - INCLUDEPATH += $$ZLIBDIR/include +win32-g++ { + !defined(WINDOWS_MINGW_BUILD_ROOT, var) { + error("WINDOWS_MINGW_BUILD_ROOT must point to the directory containing the MinGW dependency builds") + } + !defined(MINGW_ROOT, var) { + error("MINGW_ROOT must point to the MinGW toolchain root") + } + + INCLUDEPATH += $$MINGW_ROOT/x86_64-w64-mingw32/include + INCLUDEPATH += $$WINDOWS_MINGW_BUILD_ROOT/snappy-release + LIBS += $$MINGW_ROOT/x86_64-w64-mingw32/lib/libz.a + LIBS += $$WINDOWS_MINGW_BUILD_ROOT/lz4-release/liblz4.a + LIBS += $$WINDOWS_MINGW_BUILD_ROOT/zstd-release/lib/libzstd.a + LIBS += $$WINDOWS_MINGW_BUILD_ROOT/snappy-release/libsnappy.a + LIBS += $$WINDOWS_MINGW_BUILD_ROOT/brotli-release/libbrotlidec-static.a + LIBS += $$WINDOWS_MINGW_BUILD_ROOT/brotli-release/libbrotlienc-static.a + LIBS += $$WINDOWS_MINGW_BUILD_ROOT/brotli-release/libbrotlicommon-static.a +} else:win32* { + ZLIBDIR = $$PWD/zlib-msvc14-x64.1.2.11.7795/build/native + INCLUDEPATH += $$ZLIBDIR/include LIBS += $$ZLIBDIR/lib_release/zlibstatic.lib $$LZ4DIR/build/cmake/Release/lz4.lib LIBS += $$ZSTDDIR/build/cmake/lib/Release/zstd_static.lib LIBS += $$SNAPPYDIR/Release/snappy.lib diff --git a/3rdparty/pyotherside.pri b/3rdparty/pyotherside.pri index 6e784f70c..000389526 100644 --- a/3rdparty/pyotherside.pri +++ b/3rdparty/pyotherside.pri @@ -5,8 +5,13 @@ PY_WIN_VERSION="38" PY_LIB_SUFFIX="3.9" win32* { - QMAKE_LIBS += -LC:\Python$${PY_WIN_VERSION}-x64\libs -lpython$${PY_WIN_VERSION} - INCLUDEPATH += C:\Python$${PY_WIN_VERSION}-x64\include\ + defined(PYTHON_ROOT, var) { + QMAKE_LIBS += -L$$PYTHON_ROOT/libs -lpython$${PY_WIN_VERSION} + INCLUDEPATH += $$PYTHON_ROOT/include + } else { + QMAKE_LIBS += -LC:\Python$${PY_WIN_VERSION}-x64\libs -lpython$${PY_WIN_VERSION} + INCLUDEPATH += C:\Python$${PY_WIN_VERSION}-x64\include\ + } } else { unix:macx { exists($$PWD/python-3) { @@ -41,9 +46,12 @@ win32* { } } +RESP_APP_VERSION = $$VERSION include(pyotherside/pyotherside.pri) +PYOTHERSIDE_EMBEDDED_VERSION = $$VERSION +VERSION = $$RESP_APP_VERSION -DEFINES += PYOTHERSIDE_VERSION=\\\"$${VERSION}\\\" +DEFINES += PYOTHERSIDE_VERSION=\\\"$$PYOTHERSIDE_EMBEDDED_VERSION\\\" DEPENDPATH += $$PWD/pyotherside/src INCLUDEPATH += $$PWD/pyotherside/src diff --git a/build/windows/installer/installer.nsi b/build/windows/installer/installer.nsi index 272d075a2..c5c594e5f 100644 --- a/build/windows/installer/installer.nsi +++ b/build/windows/installer/installer.nsi @@ -11,11 +11,14 @@ SetCompress auto SetCompressor /SOLID /FINAL lzma ManifestDPIAware true -# General Symbol Definitions -!define REGKEY "SOFTWARE\$(Name)" -!define COMPANY "Igor Malinovskiy" -!define URL resp.app -!define APP_EXE "resp.exe" +# General Symbol Definitions +!define REGKEY "SOFTWARE\RESP.app" +!define COMPANY "Igor Malinovskiy" +!define URL resp.app +!define APP_EXE "resp.exe" +!ifndef SOURCE_DIR + !define SOURCE_DIR "resources" +!endif # MUI Symbol Definitions !define MUI_ICON "..\..\..\src\resources\images\logo.ico" @@ -48,7 +51,11 @@ Var StartMenuGroup !insertmacro MUI_LANGUAGE English # Installer attributes -OutFile resp-${VERSION}.exe +!ifdef OUTPUT_FILE + OutFile "${OUTPUT_FILE}" +!else + OutFile resp-${VERSION}.exe +!endif InstallDir $PROGRAMFILES64\RESP_app CRCCheck on XPStyle on @@ -84,9 +91,11 @@ Section -Main SEC0000 not_installed: SetOutPath $INSTDIR - File /r resources\* - WriteRegStr HKLM "${REGKEY}\Components" Main 1 - !insertmacro InstallVCredist + File /r "${SOURCE_DIR}\*" + WriteRegStr HKLM "${REGKEY}\Components" Main 1 + !ifndef SKIP_VCREDIST + !insertmacro InstallVCredist + !endif BringToFront SectionEnd diff --git a/build/windows/installer/resources/qt.conf b/build/windows/installer/resources/qt.conf index 5ecbd7d99..30ce20836 100644 --- a/build/windows/installer/resources/qt.conf +++ b/build/windows/installer/resources/qt.conf @@ -1,3 +1,5 @@ [Paths] -Prefix=.. +Prefix=. +Plugins=plugins +Qml2Imports=qml