diff --git a/build_scripts/Windows/build-retrotor.bat b/build_scripts/Windows/build-retrotor.bat new file mode 100644 index 000000000..cbf21e1c0 --- /dev/null +++ b/build_scripts/Windows/build-retrotor.bat @@ -0,0 +1,27 @@ +@echo off + +setlocal + +:: Initialize environment +call "%~dp0env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env + +%cecho% info "Build libraries" +call "%~dp0build-libs\build-libs.bat" auto-copy +if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL% + +%cecho% info "Build %SourceName%" +call "%~dp0build\build.bat" retrotor +if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL% + +%cecho% info "Pack %SourceName%" +call "%~dp0build\pack.bat" retrotor +if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL% + +exit /B 0 + +:error_env +echo Failed to initialize environment. +exit /B 1 diff --git a/build_scripts/Windows/build.bat b/build_scripts/Windows/build.bat index 48b6be7bb..22052a3e1 100644 --- a/build_scripts/Windows/build.bat +++ b/build_scripts/Windows/build.bat @@ -13,11 +13,11 @@ call "%~dp0build-libs\build-libs.bat" auto-copy if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL% %cecho% info "Build %SourceName%" -call "%~dp0build\build.bat" +call "%~dp0build\build.bat" standard if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL% %cecho% info "Pack %SourceName%" -call "%~dp0build\pack.bat" +call "%~dp0build\pack.bat" standard if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL% %cecho% info "Build installer" diff --git a/build_scripts/Windows/build/build-installer.bat b/build_scripts/Windows/build/build-installer.bat index 9d3aa837e..40c408c62 100644 --- a/build_scripts/Windows/build/build-installer.bat +++ b/build_scripts/Windows/build/build-installer.bat @@ -21,7 +21,7 @@ set /P LibsGCCVersion=<"%RootPath%\libs\gcc-version" if "%LibsGCCVersion%" NEQ "%GCCVersion%" echo Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%).& exit /B 1 :: Initialize environment -call "%~dp0env.bat" +call "%~dp0env.bat" standard if errorlevel 1 goto error_env :: Build defines for script diff --git a/build_scripts/Windows/build/build.bat b/build_scripts/Windows/build/build.bat index d4f2ab7ba..68e00235b 100644 --- a/build_scripts/Windows/build/build.bat +++ b/build_scripts/Windows/build/build.bat @@ -21,7 +21,7 @@ set /P LibsGCCVersion=<"%RootPath%\libs\gcc-version" if "%LibsGCCVersion%" NEQ "%GCCVersion%" echo Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%).& exit /B 1 :: Initialize environment -call "%~dp0env.bat" +call "%~dp0env.bat" %* if errorlevel 1 goto error_env :: Check git executable @@ -36,7 +36,7 @@ echo. echo === Version echo. -title Build - %SourceName%-%RsBuildConfig% [Version] +title Build - %SourceName%%RsType%-%RsBuildConfig% [Version] pushd "%SourcePath%\retroshare-gui\src\gui\images" :: Touch resource file @@ -50,16 +50,19 @@ echo. echo === qmake echo. -title Build - %SourceName%-%RsBuildConfig% [qmake] +title Build - %SourceName%%RsType%-%RsBuildConfig% [qmake] -qmake "%SourcePath%\RetroShare.pro" -r "CONFIG+=%RsBuildConfig% version_detail_bash_script rs_autologin retroshare_plugins" +set RS_QMAKE_CONFIG=%RsBuildConfig% version_detail_bash_script rs_autologin retroshare_plugins +if "%RsRetroTor%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% retrotor + +qmake "%SourcePath%\RetroShare.pro" -r "CONFIG+=%RS_QMAKE_CONFIG%" if errorlevel 1 goto error echo. echo === make echo. -title Build - %SourceName%-%RsBuildConfig% [make] +title Build - %SourceName%%RsType%-%RsBuildConfig% [make] if exist "%EnvJomExe%" ( "%EnvJomExe%" diff --git a/build_scripts/Windows/build/clean.bat b/build_scripts/Windows/build/clean.bat index 0797e7681..d8b725535 100644 --- a/build_scripts/Windows/build/clean.bat +++ b/build_scripts/Windows/build/clean.bat @@ -7,7 +7,7 @@ call "%~dp0..\env.bat" if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -call "%~dp0env.bat" +call "%~dp0env.bat" %* if errorlevel 1 goto error_env if not exist "%RsBuildPath%" exit /B 0 diff --git a/build_scripts/Windows/build/env.bat b/build_scripts/Windows/build/env.bat index cf25d543b..094b1b686 100644 --- a/build_scripts/Windows/build/env.bat +++ b/build_scripts/Windows/build/env.bat @@ -1,3 +1,18 @@ +if "%~1"=="standard" ( + set RsRetroTor= + set RsType= +) else ( + if "%~1"=="retrotor" ( + set RsRetroTor=1 + set RsType=-tor + ) else ( + echo. + echo Usage: standard^|retrotor + echo. + exit /B 1 + ) +) + set BuildPath=%EnvRootPath%\builds set DeployPath=%EnvRootPath%\deploy @@ -19,8 +34,8 @@ call "%ToolsPath%\get-qt-version.bat" QtVersion if "%QtVersion%"=="" echo Cannot get Qt version.& exit /B 1 set RsBuildConfig=release -set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsBuildConfig% -set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%RsBuildConfig% +set RsBuildPath=%BuildPath%\Qt-%QtVersion%%RsType%-%RsBuildConfig% +set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsBuildConfig% set RsPackPath=%DeployPath% set RsArchiveAdd= diff --git a/build_scripts/Windows/build/git-log.bat b/build_scripts/Windows/build/git-log.bat index 8a36c7537..5923397f1 100644 --- a/build_scripts/Windows/build/git-log.bat +++ b/build_scripts/Windows/build/git-log.bat @@ -1,19 +1,19 @@ :: Usage: -:: call git-log.bat [no-ask] +:: call git-log.bat standard|retrotor [no-ask] @echo off setlocal set NoAsk= -if "%~1"=="no-ask" set NoAsk=1 +if "%~2"=="no-ask" set NoAsk=1 :: Initialize environment call "%~dp0..\env.bat" if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -call "%~dp0env.bat" +call "%~dp0env.bat" %1 if errorlevel 1 goto error_env :: Check git executable @@ -58,7 +58,7 @@ for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2% :: Get last revision -set RsLastRefFile=%BuildPath%\Qt-%QtVersion%-%RsBuildConfig%-LastRef.txt +set RsLastRefFile=%BuildPath%\Qt-%QtVersion%%RsType%-%RsBuildConfig%-LastRef.txt set RsLastRef= if exist "%RsLastRefFile%" set /P RsLastRef=<"%RsLastRefFile%" @@ -86,9 +86,9 @@ if %errorlevel%==2 exit /B 1 :no_confirm if "%RsBuildConfig%" NEQ "release" ( - set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%-%RsBuildConfig%.txt + set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsType%%RsArchiveAdd%-%RsBuildConfig%.txt ) else ( - set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%.txt + set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsType%%RsArchiveAdd%.txt ) title %SourceName%-%RsBuildConfig% [git log] diff --git a/build_scripts/Windows/build/pack.bat b/build_scripts/Windows/build/pack.bat index 49dff68b3..215b3c402 100644 --- a/build_scripts/Windows/build/pack.bat +++ b/build_scripts/Windows/build/pack.bat @@ -23,7 +23,7 @@ set /P LibsGCCVersion=<"%RootPath%\libs\gcc-version" if "%LibsGCCVersion%" NEQ "%GCCVersion%" echo Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%).& exit /B 1 :: Initialize environment -call "%~dp0env.bat" +call "%~dp0env.bat" %* if errorlevel 1 goto error_env :: Remove deploy path @@ -65,6 +65,17 @@ set RsDate= for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2% +if "%RsRetroTor%"=="1" ( + :: Check Retrotor + if not exist "%EnvDownloadPath%\tor\Tor\tor.exe" ( + echo Tor binary not found. Please download Tor Expert Bundle from + echo https://www.torproject.org/download/download.html.en + echo and unpack to + echo %EnvDownloadPath%\tor + goto error + ) +) + set QtMainVersion=%QtVersion:~0,1% rem Qt 4 = QtSvg4.dll @@ -75,9 +86,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%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%-%RsBuildConfig%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z ) else ( - set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsType%%RsArchiveAdd%.7z ) if exist "%Archive%" del /Q "%Archive%" @@ -85,7 +96,7 @@ if exist "%Archive%" del /Q "%Archive%" :: Create deploy path mkdir "%RsDeployPath%" -title Pack - %SourceName%-%RsBuildConfig% [copy files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files] set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc set Extensions= @@ -172,8 +183,13 @@ if exist "%SourcePath%\libresapi\src\webui" ( xcopy /S "%SourcePath%\libresapi\src\webui" "%RsDeployPath%\webui" %Quite% ) +if "%RsRetroTor%"=="1" ( + echo copy tor + echo n | copy /-y "%EnvDownloadPath%\tor\Tor\*.*" "%RsDeployPath%" %Quite% +) + rem pack files -title Pack - %SourceName%-%RsBuildConfig% [pack files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files] "%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*"