diff options
author | João Valverde <j@v6e.pt> | 2023-06-09 10:59:50 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-06-09 13:58:24 +0000 |
commit | 0b27d3e584fe1322fcf6039f8276211d1e995cb6 (patch) | |
tree | 2ca21e25ce53ae5aca2dc24a72d1f15b29645469 /packaging/nsis | |
parent | 5e0c35df5145ca44721c299e7d9e2c6b75494c11 (diff) |
MinGW+NSIS: Remove the Fedora hard-coded cross-build sysroot
Introduce a MINGW_SYSROOT cache variable and --sysroot Python
script option so the installer can be built in other
distributions that do not use Fedora's layout.
Add a few other DLLs and use some shell globs, tested on an
Arch Linux host.
The dependency list should be generated dynamically but we're not
there yet.
Diffstat (limited to 'packaging/nsis')
-rw-r--r-- | packaging/nsis/CMakeLists.txt | 1 | ||||
-rw-r--r-- | packaging/nsis/InstallMinGW.cmake | 92 | ||||
-rw-r--r-- | packaging/nsis/mingw64-qt-mapping.txt | 48 | ||||
-rw-r--r-- | packaging/nsis/windeployqt-to-nsis.py | 9 |
4 files changed, 83 insertions, 67 deletions
diff --git a/packaging/nsis/CMakeLists.txt b/packaging/nsis/CMakeLists.txt index 61182b270e..4afd58b131 100644 --- a/packaging/nsis/CMakeLists.txt +++ b/packaging/nsis/CMakeLists.txt @@ -302,6 +302,7 @@ macro( ADD_NSIS_PACKAGE_TARGETS ) elseif(MINGW AND CMAKE_CROSSCOMPILING) add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh COMMAND ${Python3_EXECUTABLE} "${_nsis_source_dir}/windeployqt-to-nsis.py" + --sysroot "${MINGW_SYSROOT}" --mapping "${_nsis_source_dir}/mingw64-qt-mapping.txt" ${_nsis_binary_dir}/wireshark-qt-manifest.nsh #$<$<CONFIG:Debug>:-DebugConfig> diff --git a/packaging/nsis/InstallMinGW.cmake b/packaging/nsis/InstallMinGW.cmake index 9c6760346b..effec0bd25 100644 --- a/packaging/nsis/InstallMinGW.cmake +++ b/packaging/nsis/InstallMinGW.cmake @@ -1,47 +1,55 @@ -set(MINGW_BIN "/usr/x86_64-w64-mingw32/sys-root/mingw/bin") +set(MINGW_SYSROOT "/usr/x86_64-w64-mingw32/sys-root/mingw" CACHE FILEPATH "Path to MinGW system root bindir") +set(MINGW_BINDIR ${MINGW_SYSROOT}/bin) -if(MINGW AND NOT USE_MSYSTEM) +if(MINGW) # mingw-w64 dlls file(GLOB MINGW_DLLS - ${MINGW_BIN}/iconv.dll - ${MINGW_BIN}/icudata72.dll - ${MINGW_BIN}/icui18n72.dll - ${MINGW_BIN}/icuuc72.dll - ${MINGW_BIN}/libbrotlicommon.dll - ${MINGW_BIN}/libbrotlidec.dll - ${MINGW_BIN}/libbrotlienc.dll - ${MINGW_BIN}/libbz2-1.dll - ${MINGW_BIN}/libcares-2.dll - ${MINGW_BIN}/libcrypto-3-x64.dll - ${MINGW_BIN}/libexpat-1.dll - ${MINGW_BIN}/libffi-8.dll - ${MINGW_BIN}/libfontconfig-1.dll - ${MINGW_BIN}/libfreetype-6.dll - ${MINGW_BIN}/libgcc_s_seh-1.dll - ${MINGW_BIN}/libgcrypt-20.dll - ${MINGW_BIN}/libglib-2.0-0.dll - ${MINGW_BIN}/libgmodule-2.0-0.dll - ${MINGW_BIN}/libgmp-10.dll - ${MINGW_BIN}/libgnutls-30.dll - ${MINGW_BIN}/libgpg-error-0.dll - ${MINGW_BIN}/libharfbuzz-0.dll - ${MINGW_BIN}/libhogweed-6.dll - ${MINGW_BIN}/libintl-8.dll - ${MINGW_BIN}/liblzma-5.dll - ${MINGW_BIN}/libminizip-3.dll - ${MINGW_BIN}/libnettle-8.dll - ${MINGW_BIN}/libopus-0.dll - ${MINGW_BIN}/libp11-kit-0.dll - ${MINGW_BIN}/libpcre2-16-0.dll - ${MINGW_BIN}/libpcre2-8-0.dll - ${MINGW_BIN}/libpng16-16.dll - ${MINGW_BIN}/libspeexdsp-1.dll - ${MINGW_BIN}/libssp-0.dll - ${MINGW_BIN}/libstdc++-6.dll - ${MINGW_BIN}/libtasn1-6.dll - ${MINGW_BIN}/libwinpthread-1.dll - ${MINGW_BIN}/libxml2-2.dll - ${MINGW_BIN}/libzstd.dll - ${MINGW_BIN}/zlib1.dll + ${MINGW_BINDIR}/iconv.dll + ${MINGW_BINDIR}/icudata72.dll + ${MINGW_BINDIR}/icui18n72.dll + ${MINGW_BINDIR}/icuuc72.dll + ${MINGW_BINDIR}/libbrotlicommon.dll + ${MINGW_BINDIR}/libbrotlidec.dll + ${MINGW_BINDIR}/libbrotlienc.dll + ${MINGW_BINDIR}/libbz2-1.dll + ${MINGW_BINDIR}/libcares-*.dll + ${MINGW_BINDIR}/libcrypto-3-x64.dll + ${MINGW_BINDIR}/libexpat-1.dll + ${MINGW_BINDIR}/libffi-8.dll + ${MINGW_BINDIR}/libfontconfig-1.dll + ${MINGW_BINDIR}/libfreetype-6.dll + ${MINGW_BINDIR}/libgcc_s_seh-1.dll + ${MINGW_BINDIR}/libgcrypt-20.dll + ${MINGW_BINDIR}/libglib-2.0-0.dll + ${MINGW_BINDIR}/libgmodule-2.0-0.dll + ${MINGW_BINDIR}/libgmp-10.dll + ${MINGW_BINDIR}/libgnutls-30.dll + ${MINGW_BINDIR}/libgpg-error-0.dll + ${MINGW_BINDIR}/libgraphite2.dll + ${MINGW_BINDIR}/libharfbuzz-0.dll + ${MINGW_BINDIR}/libhogweed-6.dll + ${MINGW_BINDIR}/libiconv-*.dll + ${MINGW_BINDIR}/libidn2-*.dll + ${MINGW_BINDIR}/libintl-8.dll + ${MINGW_BINDIR}/liblz4.dll + ${MINGW_BINDIR}/liblzma-5.dll + ${MINGW_BINDIR}/libminizip-*.dll + ${MINGW_BINDIR}/libnettle-8.dll + ${MINGW_BINDIR}/libnghttp2-*.dll + ${MINGW_BINDIR}/libopus-0.dll + ${MINGW_BINDIR}/libp11-kit-0.dll + ${MINGW_BINDIR}/libpcre2-16-0.dll + ${MINGW_BINDIR}/libpcre2-8-0.dll + ${MINGW_BINDIR}/libpng16-16.dll + ${MINGW_BINDIR}/libsnappy.dll + ${MINGW_BINDIR}/libspeexdsp-1.dll + ${MINGW_BINDIR}/libssp-0.dll + ${MINGW_BINDIR}/libstdc++-6.dll + ${MINGW_BINDIR}/libtasn1-6.dll + ${MINGW_BINDIR}/libunistring-*.dll + ${MINGW_BINDIR}/libwinpthread-1.dll + ${MINGW_BINDIR}/libxml2-2.dll + ${MINGW_BINDIR}/libzstd.dll + ${MINGW_BINDIR}/zlib1.dll ) endif() diff --git a/packaging/nsis/mingw64-qt-mapping.txt b/packaging/nsis/mingw64-qt-mapping.txt index 7396783e01..40ca2ef643 100644 --- a/packaging/nsis/mingw64-qt-mapping.txt +++ b/packaging/nsis/mingw64-qt-mapping.txt @@ -4,27 +4,27 @@ # on a Windows machine and editing by hand. # -"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6Core.dll" "Qt6Core.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6Core5Compat.dll" "Qt6Core5Compat.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6Gui.dll" "Qt6Gui.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6Multimedia.dll" "Qt6Multimedia.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6Network.dll" "Qt6Network.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6PrintSupport.dll" "Qt6PrintSupport.dll" -#"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6Svg.dll" "Qt6Svg.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt6Widgets.dll" "Qt6Widgets.dll" -#"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/opengl32sw.dll" "opengl32sw.dll" -#"/usr/x86_64-w64-mingw32/sys-root/mingw/bin/D3Dcompiler_47.dll" "D3Dcompiler_47.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/generic/qtuiotouchplugin.dll" "generic/qtuiotouchplugin.dll" -#"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/iconengines/qsvgicon.dll" "iconengines/qsvgicon.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/imageformats/qgif.dll" "imageformats/qgif.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/imageformats/qico.dll" "imageformats/qico.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/imageformats/qjpeg.dll" "imageformats/qjpeg.dll" -#"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/imageformats/qsvg.dll" "imageformats/qsvg.dll" -#"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/multimedia/ffmpegmediaplugin.dll" "multimedia/ffmpegmediaplugin.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/multimedia/windowsmediaplugin.dll" "multimedia/windowsmediaplugin.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/networkinformation/qnetworklistmanager.dll" "networkinformation/qnetworklistmanager.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/platforms/qwindows.dll" "platforms/qwindows.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/styles/qwindowsvistastyle.dll" "styles/qwindowsvistastyle.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/tls/qcertonlybackend.dll" "tls/qcertonlybackend.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/tls/qopensslbackend.dll" "tls/qopensslbackend.dll" -"/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt6/plugins/tls/qschannelbackend.dll" "tls/qschannelbackend.dll" +"bin/Qt6Core.dll" "Qt6Core.dll" +"bin/Qt6Core5Compat.dll" "Qt6Core5Compat.dll" +"bin/Qt6Gui.dll" "Qt6Gui.dll" +"bin/Qt6Multimedia.dll" "Qt6Multimedia.dll" +"bin/Qt6Network.dll" "Qt6Network.dll" +"bin/Qt6PrintSupport.dll" "Qt6PrintSupport.dll" +#"bin/Qt6Svg.dll" "Qt6Svg.dll" +"bin/Qt6Widgets.dll" "Qt6Widgets.dll" +#"bin/opengl32sw.dll" "opengl32sw.dll" +#"bin/D3Dcompiler_47.dll" "D3Dcompiler_47.dll" +"lib/qt6/plugins/generic/qtuiotouchplugin.dll" "generic/qtuiotouchplugin.dll" +#"lib/qt6/plugins/iconengines/qsvgicon.dll" "iconengines/qsvgicon.dll" +"lib/qt6/plugins/imageformats/qgif.dll" "imageformats/qgif.dll" +"lib/qt6/plugins/imageformats/qico.dll" "imageformats/qico.dll" +"lib/qt6/plugins/imageformats/qjpeg.dll" "imageformats/qjpeg.dll" +#"lib/qt6/plugins/imageformats/qsvg.dll" "imageformats/qsvg.dll" +#"lib/qt6/plugins/multimedia/ffmpegmediaplugin.dll" "multimedia/ffmpegmediaplugin.dll" +"lib/qt6/plugins/multimedia/windowsmediaplugin.dll" "multimedia/windowsmediaplugin.dll" +"lib/qt6/plugins/networkinformation/qnetworklistmanager.dll" "networkinformation/qnetworklistmanager.dll" +"lib/qt6/plugins/platforms/qwindows.dll" "platforms/qwindows.dll" +"lib/qt6/plugins/styles/qwindowsvistastyle.dll" "styles/qwindowsvistastyle.dll" +"lib/qt6/plugins/tls/qcertonlybackend.dll" "tls/qcertonlybackend.dll" +"lib/qt6/plugins/tls/qopensslbackend.dll" "tls/qopensslbackend.dll" +"lib/qt6/plugins/tls/qschannelbackend.dll" "tls/qschannelbackend.dll" diff --git a/packaging/nsis/windeployqt-to-nsis.py b/packaging/nsis/windeployqt-to-nsis.py index 85e9037b00..2881f31521 100644 --- a/packaging/nsis/windeployqt-to-nsis.py +++ b/packaging/nsis/windeployqt-to-nsis.py @@ -24,10 +24,13 @@ parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('--mapping') group.add_argument('--executable') +parser.add_argument('--sysroot') parser.add_argument('outfile') args = parser.parse_args() if args.mapping: + if not args.sysroot: + sys.exit('Option --sysroot is required with option --mapping') qt_version = None with open(args.mapping, 'r', encoding='utf-8') as f: out = f.read() @@ -79,6 +82,10 @@ with open(args.outfile, 'w') as f: set_out_path = 'SetOutPath "$INSTDIR\{}"'.format(base_dir) print(set_out_path, file=f) current_dir = base_dir - file_path = 'File {}'.format(path) + + path = path.strip('"') + if args.sysroot: + path = os.path.join(args.sysroot, path) + file_path = 'File "{}"'.format(path) print(file_path, file=f) |