Build webui

This commit is contained in:
hunbernd 2020-05-23 22:05:44 +02:00
parent 81a7d5a365
commit a11dc09790
7 changed files with 73 additions and 3 deletions

View File

@ -0,0 +1,37 @@
@echo off
setlocal
:: Initialize environment
call "%~dp0..\env.bat"
if errorlevel 1 goto error_env
call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
call "%EnvPath%\env-msys2.bat"
if errorlevel 1 goto error_env
:: Initialize base environment
call "%~dp0env-base.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
:: Initialize environment
call "%~dp0env.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
call "%~dp0..\tools\webui.bat"
:error
title %COMSPEC%
if errorlevel 1 echo.& echo Webui generation failed& echo.
exit /B %ERRORLEVEL%
:error_env
echo Failed to initialize environment.
endlocal
exit /B 1

View File

@ -18,7 +18,7 @@ if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
:: Install needed things
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-libmicrohttpd mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson"
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson"
:: Plugins
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"
@ -71,6 +71,11 @@ title Build - %SourceName%-%RsBuildConfig% [make]
%EnvMSYS2Cmd% "make -j %NUMBER_OF_PROCESSORS%"
:: Webui
if "%ParamWebui%"=="1" (
call "%~dp0..\tools\webui.bat"
)
:error
popd

View File

@ -6,6 +6,7 @@ set ParamDebug=0
set ParamAutologin=0
set ParamPlugins=0
set ParamTor=0
set ParamWebui=0
set RS_QMAKE_CONFIG=
:parameter_loop
@ -25,6 +26,8 @@ if "%~1" NEQ "" (
set ParamPlugins=1
) else if "%%~a"=="tor" (
set ParamTor=1
) else if "%%~a"=="webui" (
set ParamWebui=1
) else if "%%~a"=="CONFIG+" (
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% %1
) else (
@ -75,6 +78,9 @@ if "%ParamTor%"=="1" (
set RsType=
)
if "%ParamWebui%"=="1" (
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui"
)
exit /B 0
@ -89,6 +95,7 @@ echo.
echo Optional parameter (need clean when changed)
echo autologin Build with autologin
echo plugins Build plugins
echo webui Enable JsonAPI and pack webui files
echo.
echo Parameter for pack
echo tor Pack tor version

View File

@ -20,6 +20,7 @@ set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsArchitecture%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsArchitecture%-%RsBuildConfig%
set RsPackPath=%DeployPath%
set RsArchiveAdd=
set RsWebuiPath=%RootPath%\%SourceName%-webui
if not exist "%~dp0env-mod.bat" goto no_mod
call "%~dp0env-mod.bat"

View File

@ -0,0 +1,20 @@
setlocal
echo.
echo === webui
echo.
title Build webui
if not exist "%RsWebuiPath%" (
echo Checking out webui source into %RsWebuiPath%
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S git"
git clone https://github.com/RetroShare/RSNewWebUI.git "%RsWebuiPath%"
) else (
echo Webui source found at %RsWebuiPath%
)
pushd "%RsWebuiPath%\webui-src\make-src"
%EnvMSYS2Cmd% "sh build.sh"
popd
endlocal

View File

@ -870,7 +870,7 @@ rs_jsonapi {
genrestbedheader.name = Generating restbed header.
genrestbedheader.input = genrestbedlib.output
genrestbedheader.output = $${RESTBED_HEADER_FILE}
genrestbedheader.CONFIG += target_predeps combine no_link
genrestbedheader.CONFIG += target_predeps no_link
genrestbedheader.variable_out = HEADERS
genrestbedheader.commands = cd $${RESTBED_BUILD_PATH} && $(MAKE) install
QMAKE_EXTRA_COMPILERS += genrestbedheader

View File

@ -1157,7 +1157,7 @@ void RshareSettings::setWebinterfaceEnabled(bool enabled)
QString RshareSettings::getWebinterfaceFilesDirectory()
{
#ifdef WINDOWS_SYS
return valueFromGroup("Webinterface","directory","data/webui/").toString();
return valueFromGroup("Webinterface","directory","./webui/").toString();
#else
return valueFromGroup("Webinterface","directory","/usr/share/retroshare/webui/").toString();
#endif