Windows MinGW build:

- Upgraded MSYS2
- Upgraded OpenSSL-1.1.1p
- Added build of WebUI
This commit is contained in:
thunder2 2022-06-22 01:38:47 +02:00
parent 52dffddf64
commit f4f799ec58
20 changed files with 124 additions and 30 deletions

View File

@ -1,7 +1,7 @@
ZLIB_VERSION=1.2.11
BZIP2_VERSION=1.0.8
MINIUPNPC_VERSION=2.2.3
OPENSSL_VERSION=1.1.1m
OPENSSL_VERSION=1.1.1p
SPEEX_VERSION=1.2.0
SPEEXDSP_VERSION=1.2.0
LIBXML2_VERSION=2.9.12

View File

@ -13,7 +13,7 @@ call "%~dp0build-libs\build-libs.bat"
if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL%
%cecho% info "Build %SourceName%"
call "%~dp0build\build.bat" release autologin jsonapi plugins nativedialogs service
call "%~dp0build\build.bat" release autologin webui plugins nativedialogs service
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
%cecho% info "Pack %SourceName%"

View File

@ -40,6 +40,7 @@ set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%GCCArchitecture%"
set NSIS_PARAM=%NSIS_PARAM% /DDATE="%RsDate%"
if exist "%EnvTorPath%\Tor\tor.exe" set NSIS_PARAM=%NSIS_PARAM% /DTORDIR="%EnvTorPath%\Tor"
if exist "%RsWebuiBuildPath%" set NSIS_PARAM=%NSIS_PARAM% /DWEBUIDIR="%RsWebuiBuildPath%"
:: Get compiled version
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion

View File

@ -52,6 +52,7 @@ title Build - %SourceName%-%RsBuildConfig% [qmake]
set RS_QMAKE_CONFIG=%RsBuildConfig%
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_autologin
if "%ParamJsonApi%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_jsonapi
if "%ParamWebui%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_webui
if "%ParamPlugins%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% retroshare_plugins
if "%ParamUseNativeDialogs%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_use_native_dialogs
if "%ParamService%" NEQ "1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% no_retroshare_service
@ -70,6 +71,14 @@ title Build - %SourceName%-%RsBuildConfig% [make]
mingw32-make -j %CoreCount%
if errorlevel 1 goto error
:: Webui
if "%ParamWebui%"=="1" (
call :build-webui
if errorlevel 1 goto error
) else (
if exist "%RsWebuiBuildPath%" call "%ToolsPath%\remove-dir.bat" "%RsWebuiBuildPath%"
)
echo.
echo === Changelog
echo.
@ -89,3 +98,37 @@ exit /B %ERRORLEVEL%
echo Failed to initialize environment.
endlocal
exit /B 1
:build-webui
echo.
echo === webui
echo.
title Build webui
if not exist "%RsWebuiPath%" (
echo Checking out webui source into %RsWebuiPath%
git clone https://github.com/RetroShare/RSNewWebUI.git "%RsWebuiPath%"
if errorlevel 1 exit /B 1
) else (
echo Webui source found at %RsWebuiPath%
pushd "%RsWebuiPath%"
git pull
popd
if errorlevel 1 exit /B 1
)
pushd "%RsWebuiPath%\webui-src\make-src"
call build.bat
popd
if errorlevel 1 exit /B 1
if not exist "%RsWebuiPath%\webui" (
%cecho% error "Webui is enabled, but no webui data found at %RsWebuiPath%\webui"
exit /B 1
)
if exist "%RsWebuiBuildPath%" call "%ToolsPath%\remove-dir.bat" "%RsWebuiBuildPath%"
move "%RsWebuiPath%\webui" "%RsWebuiBuildPath%"
if errorlevel 1 exit /B 1
exit /B 0

View File

@ -4,6 +4,7 @@ set ParamDebug=0
set ParamAutologin=0
set ParamPlugins=0
set ParamJsonApi=0
set ParamWebui=0
set ParamService=0
set ParamFriendServer=0
set ParamEmbeddedFriendServer=0
@ -26,6 +27,9 @@ if "%~1" NEQ "" (
set ParamAutologin=1
) else if "%%~a"=="jsonapi" (
set ParamJsonApi=1
) else if "%%~a"=="webui" (
set ParamJsonApi=1
set ParamWebui=1
) else if "%%~a"=="service" (
set ParamService=1
) else if "%%~a"=="friendserver" (
@ -101,6 +105,8 @@ set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildConfig%
set RsPackPath=%DeployPath%
set RsArchiveAdd=
set RsWebuiPath=%RootPath%\%SourceName%-webui
set RsWebuiBuildPath=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%-%RsBuildConfig%\webui
if not exist "%~dp0env-mod.bat" goto no_mod
call "%~dp0env-mod.bat"
@ -120,6 +126,7 @@ if "%Module%"=="build" (
echo Optional parameter ^(need clean when changed^)
echo autologin Build with autologin
echo jsonapi Build with jsonapi
echo webui Build with jsonapi and webui
echo service Build service
echo friendserver Build Friend Server
echo embedded-friendserver Build with embedded Friend Server

View File

@ -181,10 +181,10 @@ copy "%SourcePath%\libbitdht\src\bitdht\bdboot.txt" "%RsDeployPath%" %Quite%
echo copy changelog.txt
copy "%RsBuildPath%\changelog.txt" "%RsDeployPath%" %Quite%
if exist "%SourcePath%\libresapi\src\webui" (
if exist "%RsWebuiBuildPath%" (
echo copy webui
mkdir "%RsDeployPath%\webui"
xcopy /S "%SourcePath%\libresapi\src\webui" "%RsDeployPath%\webui" %Quite%
xcopy /S "%RsWebuiBuildPath%" "%RsDeployPath%\webui" %Quite%
)
if "%ParamTor%"=="1" (

View File

@ -5,7 +5,6 @@
call "%~dp0env.bat"
if errorlevel 1 goto error_env
rem openssl x86 doesn't compile with mingw64 x64
:: Get gcc versions
call "%ToolsPath%\get-gcc-version.bat" GCCVersion GCCArchitecture
if "%GCCVersion%"=="" %cecho% error "Cannot get gcc version." & exit /B 1
@ -27,7 +26,7 @@ set EnvMSYS2Path=%EnvRootPath%\msys2
call "%~dp0tools\prepare-msys2.bat" %1
if errorlevel 1 exit /B %ERRORLEVEL%
set EnvMSYS2SH=%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\sh.exe
set EnvMSYS2SH=%EnvMSYS2Path%\msys64\usr\bin\sh.exe
if not exist "%EnvMSYS2SH%" if errorlevel 1 goto error_env
set EnvMSYS2Cmd="%EnvMSYS2SH%" -lc

View File

@ -16,7 +16,15 @@ if "%~1"=="clean" (
goto exit
)
if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
set MSYS2Version=20220503
set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe
set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install%
set CMakeInstall=cmake-3.19.0-win32-x86.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
set CMakeUnpackPath=%EnvMSYS2Path%\msys64
if exist "%CMakeUnpackPath%\usr\bin\pacman.exe" (
if "%~1"=="reinstall" (
choice /M "Found existing MSYS2 version. Do you want to proceed?"
if !ERRORLEVEL!==2 goto exit
@ -25,18 +33,10 @@ if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
)
)
if "%MSYS2Architecture%"=="i686" set MSYS2Version=20210705
if "%MSYS2Architecture%"=="x86_64" set MSYS2Version=20210725
set MSYS2Install=msys2-base-%MSYS2Architecture%-%MSYS2Version%.tar.xz
set MSYS2Url=https://repo.msys2.org/distrib/%MSYS2Architecture%/%MSYS2Install%
set CMakeInstall=cmake-3.19.0-win32-x86.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
set CMakeUnpackPath=%EnvMSYS2Path%\msys%MSYS2Base%
if exist "%EnvMSYS2Path%\msys%MSYS2Base%" (
if exist "%CMakeUnpackPath%" (
%cecho% info "Remove previous MSYS2 version"
call "%ToolsPath%\remove-dir.bat" "%EnvMSYS2Path%\msys%MSYS2Base%"
call "%ToolsPath%\remove-dir.bat" "%CMakeUnpackPath%"
)
%cecho% info "Download installation files"
@ -47,7 +47,7 @@ if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\download-file.
if not exist "%EnvDownloadPath%\%CMakeInstall%" %cecho% error "Cannot download CMake" & goto error
%cecho% info "Unpack MSYS2"
"%EnvSevenZipExe%" x -so "%EnvDownloadPath%\%MSYS2Install%" | "%EnvSevenZipExe%" x -y -si -ttar -o"%EnvMSYS2Path%"
"%EnvDownloadPath%\%MSYS2Install%" -y -o"%EnvMSYS2Path%"
%cecho% info "Unpack CMake"
"%EnvSevenZipExe%" x -o"%CMakeUnpackPath%" "%EnvDownloadPath%\%CMakeInstall%"
@ -59,19 +59,19 @@ if "%CMakeVersion%"=="" %cecho% error "CMake version not found." & goto :exit
%cecho% info "Found CMake version %CMakeVersion%"
set FoundProfile=
for /f "tokens=3" %%F in ('find /c /i "%CMakeVersion%" "%EnvMSYS2Path%\msys%MSYS2Base%\etc\profile"') do set FoundProfile=%%F
for /f "tokens=3" %%F in ('find /c /i "%CMakeVersion%" "%CMakeUnpackPath%\etc\profile"') do set FoundProfile=%%F
if "%FoundProfile%"=="0" (
echo export PATH="${PATH}:/%CMakeVersion%/bin">>"%EnvMSYS2Path%\msys%MSYS2Base%\etc\profile"
echo export PATH="${PATH}:/%CMakeVersion%/bin">>"%CMakeUnpackPath%\etc\profile"
)
set MSYS2SH=%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\sh
set MSYS2SH=%CMakeUnpackPath%\usr\bin\sh
%cecho% info "Initialize MSYS2"
"%MSYS2SH%" -lc "yes | pacman --noconfirm -Syuu msys2-keyring"
"%MSYS2SH%" -lc "pacman --noconfirm -Su"
call "%EnvMSYS2Path%\msys%MSYS2Base%\autorebase.bat"
call "%CMakeUnpackPath%\autorebase.bat"
:exit
endlocal

View File

@ -2,18 +2,13 @@
setlocal
if exist "%~dp0msys2\msys32" call :update 32
if exist "%~dp0msys2\msys64" call :update 64
if not exist "%~dp0msys2\msys64" goto :EOF
goto :EOF
set MSYS2SH=%~dp0msys2\msys64\usr\bin\sh
:update
set MSYS2SH=%~dp0msys2\msys%~1\usr\bin\sh
echo Update MSYS2 %~1
echo Update MSYS2
"%MSYS2SH%" -lc "yes | pacman --noconfirm -Syuu msys2-keyring"
"%MSYS2SH%" -lc "pacman --noconfirm -Su"
:exit
endlocal
goto :EOF

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Instal·la ${APPNAME} i els components necessaris."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Installiert ${APPNAME} und die benötigten Komponenten."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installiert Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installiert WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installiert Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Instala ${APPNAME} y los componentes requeridos."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Installe ${APPNAME} et les composants requis."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Instaluje ${APPNAME} oraz wymagane komponenty."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Установка ${APPNAME} и необходимых компонентов."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "${APPNAME} ve gerekli bileşenleri kurar."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -22,6 +22,20 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_WebUI</name>
<message>
<source>WebUI</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_WebUI_Desc</name>
<message>
<source>Installs WebUI.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_Service</name>
<message>

View File

@ -2,6 +2,8 @@
!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"

View File

@ -71,6 +71,14 @@ ${!defineifexist} TOR_EXISTS "${TORDIR}\tor.exe"
!endif
!endif
# WebUI
!ifdef WEBUIDIR
${!defineifexist} WEBUI_EXISTS "${WEBUIDIR}\index.html"
!ifndef WEBUI_EXISTS
!error "WebUI files not found"
!endif
!endif
# Friend Server
!ifdef TOR_EXISTS
# Add Friend Server with Tor only
@ -314,6 +322,14 @@ SectionEnd
SectionEnd
!endif
# WebUI
!ifdef WEBUI_EXISTS
Section /o $(Section_WebUI) Section_WebUI
SetOutPath "$INSTDIR\webui"
File /r "${WEBUIDIR}\*"
SectionEnd
!endif
# Plugins
${!defineifexist} PLUGIN_FEEDREADER_EXISTS "${RELEASEDIR}\plugins\FeedReader\lib\FeedReader.dll"
${!defineifexist} PLUGIN_VOIP_EXISTS "${RELEASEDIR}\plugins\VOIP\lib\VOIP.dll"
@ -447,6 +463,7 @@ SectionEnd
; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Tor} $(Section_Tor_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_WebUI} $(Section_WebUI_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Service} $(Section_Service_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_FriendServer} $(Section_FriendServer_Desc)
!insertmacro MUI_FUNCTION_DESCRIPTION_END