From 1aec263bb91ebfed636cefe867be8fa435be65a0 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 14 Jul 2025 14:42:34 +0200 Subject: [PATCH 1/4] MSYS2: Removed parameter "clang" from build. Use "clang32" or "clang64" instead. --- build_scripts/Windows-msys2/build/build.bat | 5 ++--- build_scripts/Windows-msys2/build/env-base.bat | 15 +++------------ build_scripts/Windows-msys2/build/env.bat | 4 ++-- build_scripts/Windows-msys2/readme.md | 1 - 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/build_scripts/Windows-msys2/build/build.bat b/build_scripts/Windows-msys2/build/build.bat index e72ab3d1d..fc5632293 100644 --- a/build_scripts/Windows-msys2/build/build.bat +++ b/build_scripts/Windows-msys2/build/build.bat @@ -28,7 +28,7 @@ if not "%ParamNoupdate%"=="1" ( if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg" :: Clang - if "%ParamClang%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang" + if "%ClangCompiler%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang" :: Indexing if "%ParamIndexing%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-libvorbis mingw-w64-%RsMSYS2Architecture%-flac mingw-w64-%RsMSYS2Architecture%-taglib" @@ -79,11 +79,10 @@ echo %RsBuildConfig% >> buildinfo.txt echo %RsArchitecture% >> buildinfo.txt echo Qt %QtVersion% >> buildinfo.txt echo %RsToolchain% >> buildinfo.txt -echo %RsCompiler% >> buildinfo.txt call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path -if "%ParamClang%"=="1" ( +if "%ClangCompiler%"=="1" ( %EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%" ) else ( %EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%" diff --git a/build_scripts/Windows-msys2/build/env-base.bat b/build_scripts/Windows-msys2/build/env-base.bat index 01a7a8f12..6e5c8480f 100644 --- a/build_scripts/Windows-msys2/build/env-base.bat +++ b/build_scripts/Windows-msys2/build/env-base.bat @@ -5,7 +5,7 @@ set ParamAutologin=0 set ParamPlugins=0 set ParamTor=0 set ParamWebui=0 -set ParamClang=0 +set ClangCompiler=0 set ParamIndexing=0 set ParamFriendserver=0 set ParamNoupdate=0 @@ -55,8 +55,6 @@ if "%~1" NEQ "" ( set ParamWebui=1 ) else if "%%~a"=="singlethread" ( set CoreCount=1 - ) else if "%%~a"=="clang" ( - set ParamClang=1 ) else if "%%~a"=="indexing" ( set ParamIndexing=1 ) else if "%%~a"=="friendserver" ( @@ -96,24 +94,18 @@ if "%RsToolchain%"=="mingw32" ( set RsArchitecture=x64 set RsMSYS2Architecture=clang-x86_64 set MSYSTEM=CLANG64 - set ParamClang=1 + set ClangCompiler=1 ) else if "%RsToolchain%"=="clang32" ( set RsArchitecture=x86 set RsMSYS2Architecture=clang-i686 set MSYSTEM=CLANG32 - set ParamClang=1 + set ClangCompiler=1 ) else if "%RsToolchain%"=="clangarm64" ( set RsArchitecture=arm64 set RsMSYS2Architecture=clang-aarch64 set MSYSTEM=CLANGARM64 ) -if "%ParamClang%"=="1" ( - set RsCompiler=Clang -) else ( - set RsCompiler=GCC -) - if "%ParamRelease%"=="1" ( if "%ParamDebug%"=="1" ( echo. @@ -162,7 +154,6 @@ echo autologin Build with autologin echo plugins Build plugins echo webui Enable JsonAPI and pack webui files echo singlethread Use only 1 thread for building -echo clang Use clang compiler instead of GCC echo indexing Build with deep channel and file indexing support echo friendserver Enable friendserver support echo noupdate Skip updating the libraries diff --git a/build_scripts/Windows-msys2/build/env.bat b/build_scripts/Windows-msys2/build/env.bat index ccba33db3..17108be91 100644 --- a/build_scripts/Windows-msys2/build/env.bat +++ b/build_scripts/Windows-msys2/build/env.bat @@ -14,8 +14,8 @@ if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1 set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain% -set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsCompiler%-%RsBuildConfig% -set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsCompiler%-%RsBuildConfig% +set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsBuildConfig% +set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsBuildConfig% set RsPackPath=%DeployPath% set RsArchiveAdd= set RsWebuiBuildPath=%RsBuildPath%\retroshare-webui\webui diff --git a/build_scripts/Windows-msys2/readme.md b/build_scripts/Windows-msys2/readme.md index 5582ec451..f5e214ee7 100644 --- a/build_scripts/Windows-msys2/readme.md +++ b/build_scripts/Windows-msys2/readme.md @@ -55,7 +55,6 @@ Run the scripts in this order: * "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *<sourcefolder>\retroshare.pri* * For fixing compile problems (optional) * singlethread: use only 1 thread for building, slow but useful if you don't find the error message in the console - * clang: use clang compiler instead of GCC * noupdate: skip the msys2 update step, sometimes some msys2 packages are broken, you can manually switch back to the older package, and this option will prevent updating to the broken version again Example: From 6c1eb35a471d5e00624559632d6eead622010a8e Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 14 Jul 2025 16:07:33 +0200 Subject: [PATCH 2/4] MSYS2: Added toolchain to filename of packed files and installer --- build_scripts/Windows-msys2/build/build-installer.bat | 1 + build_scripts/Windows-msys2/build/env.bat | 2 +- build_scripts/Windows-msys2/build/pack.bat | 4 ++-- build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi | 6 +++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build_scripts/Windows-msys2/build/build-installer.bat b/build_scripts/Windows-msys2/build/build-installer.bat index 192b2d025..da404f273 100644 --- a/build_scripts/Windows-msys2/build/build-installer.bat +++ b/build_scripts/Windows-msys2/build/build-installer.bat @@ -43,6 +43,7 @@ set NSIS_PARAM=%NSIS_PARAM% /DDEPLOYDIR="%RsDeployPath%" set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%" set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%" set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%RsArchitecture%" +set NSIS_PARAM=%NSIS_PARAM% /DTOOLCHAIN="%RsToolchain%" set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsVersion.Extra% set QtMainVersion=%QtVersion:~0,1% diff --git a/build_scripts/Windows-msys2/build/env.bat b/build_scripts/Windows-msys2/build/env.bat index 17108be91..38ceeaee3 100644 --- a/build_scripts/Windows-msys2/build/env.bat +++ b/build_scripts/Windows-msys2/build/env.bat @@ -15,7 +15,7 @@ if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1 set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain% set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsBuildConfig% -set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsBuildConfig% +set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%RsToolchain%%RsType%-%RsBuildConfig% set RsPackPath=%DeployPath% set RsArchiveAdd= set RsWebuiBuildPath=%RsBuildPath%\retroshare-webui\webui diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat index a898832f7..3fa48c615 100644 --- a/build_scripts/Windows-msys2/build/pack.bat +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -71,9 +71,9 @@ if "%QtMainVersion%"=="4" set QtMainVersion2=4 if "%QtMainVersion%"=="5" set QtMainVersion1=5 if "%RsBuildConfig%" NEQ "release" ( - set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z ) else ( - set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%.7z ) if exist "%Archive%" del /Q "%Archive%" diff --git a/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi b/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi index cd4a7867e..f37f33cf8 100644 --- a/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi +++ b/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi @@ -9,6 +9,7 @@ ;!define REVISION "" ;!define DEPLOYDIR "" ;!define ARCHITECTURE "" +;!define TOOLCHAIN "" # Optional defines ;!define OUTDIR "" @@ -21,6 +22,9 @@ !ifndef ARCHITECTURE !error "ARCHITECTURE is not defined" !endif +!ifndef TOOLCHAIN +!error "TOOLCHAIN is not defined" +!endif # Check optional defines !ifdef OUTDIR @@ -72,7 +76,7 @@ ${!defineifexist} TOR_EXISTS "${DEPLOYDIR}\tor.exe" # Main Install settings Name "${APPNAMEANDVERSION}" InstallDirRegKey HKLM "Software\${APPNAME}" "" -OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${ARCHITECTURE}${RSTYPE}${INSTALLERADD}-setup.exe" +OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${TOOLCHAIN}-msys2${RSTYPE}${INSTALLERADD}-setup.exe" BrandingText "${APPNAMEANDVERSION}" RequestExecutionlevel highest # Use compression From c850a30c1a70f48dc607cd5ce6a2a3e0fd1304ca Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 15 Jul 2025 00:44:23 +0200 Subject: [PATCH 3/4] Build libretroshare on Windows as shared library --- retroshare.pri | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare.pri b/retroshare.pri index 18207838d..98226c686 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -734,7 +734,10 @@ android-* { # To export all symbols for the plugins on Windows build we need to build # libretroshare as shared library. Fix linking error (ld.exe: Error: export # ordinal too large) due to too many exported symbols. -retroshare_plugins:win32:CONFIG *= libretroshare_shared +#retroshare_plugins:win32:CONFIG *= libretroshare_shared + +# Always build libretroshare on Windows as shared library to be compatible when building with and without plugins +win32:CONFIG *= libretroshare_shared win32-g++|win32-clang-g++ { !isEmpty(EXTERNAL_LIB_DIR) { From f3150e9d42cc4ee86ae14bd198359d7f3fedffcf Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sat, 5 Jul 2025 13:03:02 +0200 Subject: [PATCH 4/4] HomePage.cpp enable saveCert --- retroshare-gui/src/gui/HomePage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp index 914fde3e9..9b8213646 100644 --- a/retroshare-gui/src/gui/HomePage.cpp +++ b/retroshare-gui/src/gui/HomePage.cpp @@ -65,6 +65,9 @@ HomePage::HomePage(QWidget *parent) : QAction *RecAction = new QAction(QIcon(),tr("Recommend friends to each others"), this); connect(RecAction, SIGNAL(triggered()), this, SLOT(recommendFriends())); + QAction *SaveAction = new QAction(QIcon(),tr("Save to File"), this); + connect(SaveAction, SIGNAL(triggered()), this, SLOT(saveCert())); + QAction *SendAction = new QAction(QIcon(),tr("Send via Email"), this); connect(SendAction, SIGNAL(triggered()), this, SLOT(runEmailClient())); @@ -75,6 +78,7 @@ HomePage::HomePage(QWidget *parent) : menu->addAction(CopyIdAction); menu->addSeparator(); + menu->addAction(SaveAction); menu->addAction(SendAction); menu->addAction(WebMailAction); menu->addAction(RecAction);