2017-02-18 19:23:50 +00:00
|
|
|
@echo off
|
|
|
|
|
2017-09-28 10:03:39 +00:00
|
|
|
IF "%BUILD_DIR%"=="" SET BUILD_DIR=C:\TBuild
|
2017-04-19 12:57:45 +00:00
|
|
|
SET LIB_DIR=%BUILD_DIR%\Libraries
|
|
|
|
SET SRC_DIR=%BUILD_DIR%\tdesktop
|
2017-02-18 19:23:50 +00:00
|
|
|
SET QT_VERSION=5_6_2
|
|
|
|
|
|
|
|
call:configureBuild
|
|
|
|
call:getDependencies
|
|
|
|
call:setupGYP
|
|
|
|
cd %SRC_DIR%
|
|
|
|
|
|
|
|
echo Finished!
|
|
|
|
|
|
|
|
GOTO:EOF
|
|
|
|
|
|
|
|
:: FUNCTIONS
|
|
|
|
:logInfo
|
|
|
|
echo [INFO] %~1
|
|
|
|
GOTO:EOF
|
|
|
|
|
2017-09-04 19:46:57 +00:00
|
|
|
:logError
|
|
|
|
echo [ERROR] %~1
|
|
|
|
GOTO:EOF
|
|
|
|
|
2017-02-18 19:23:50 +00:00
|
|
|
:getDependencies
|
|
|
|
call:logInfo "Clone dependencies repository"
|
2017-04-18 09:47:19 +00:00
|
|
|
git clone -q --depth 1 --branch=master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR%
|
2017-02-18 19:23:50 +00:00
|
|
|
cd %LIB_DIR%
|
2018-12-05 08:29:13 +00:00
|
|
|
git clone https://github.com/ericniebler/range-v3
|
2017-09-04 19:46:57 +00:00
|
|
|
if exist prepare.bat (
|
|
|
|
call prepare.bat
|
|
|
|
) else (
|
|
|
|
call:logError "Error cloning dependencies, trying again"
|
|
|
|
rmdir %LIB_DIR% /S /Q
|
|
|
|
call:getDependencies
|
|
|
|
)
|
2017-02-18 19:23:50 +00:00
|
|
|
GOTO:EOF
|
|
|
|
|
|
|
|
:setupGYP
|
|
|
|
call:logInfo "Setup GYP/Ninja and generate VS solution"
|
|
|
|
cd %LIB_DIR%
|
|
|
|
git clone https://chromium.googlesource.com/external/gyp
|
2017-05-05 09:25:06 +00:00
|
|
|
cd gyp
|
|
|
|
git checkout a478c1ab51
|
2017-09-28 10:03:39 +00:00
|
|
|
SET PATH=%PATH%;%BUILD_DIR%\Libraries\gyp;%BUILD_DIR%\Libraries\ninja;
|
2017-03-10 11:22:23 +00:00
|
|
|
cd %SRC_DIR%
|
|
|
|
git submodule init
|
|
|
|
git submodule update
|
2017-02-18 19:23:50 +00:00
|
|
|
cd %SRC_DIR%\Telegram
|
2018-11-04 10:29:30 +00:00
|
|
|
call gyp\refresh.bat --api-id 17349 --api-hash 344583e45741c457fe1862106095a5eb
|
2017-02-18 19:23:50 +00:00
|
|
|
GOTO:EOF
|
|
|
|
|
|
|
|
:configureBuild
|
|
|
|
call:logInfo "Configuring build"
|
|
|
|
call:logInfo "Build version: %BUILD_VERSION%"
|
2017-02-19 08:29:08 +00:00
|
|
|
set TDESKTOP_BUILD_DEFINES=
|
2017-02-18 19:23:50 +00:00
|
|
|
|
|
|
|
echo %BUILD_VERSION% | findstr /C:"disable_register_custom_scheme">nul && (
|
2017-02-19 08:29:08 +00:00
|
|
|
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
2017-02-18 19:23:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
echo %BUILD_VERSION% | findstr /C:"disable_crash_reports">nul && (
|
2017-02-19 08:29:08 +00:00
|
|
|
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_CRASH_REPORTS
|
2017-02-18 19:23:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
echo %BUILD_VERSION% | findstr /C:"disable_network_proxy">nul && (
|
2017-02-19 08:29:08 +00:00
|
|
|
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_NETWORK_PROXY
|
2017-02-18 19:23:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
echo %BUILD_VERSION% | findstr /C:"disable_desktop_file_generation">nul && (
|
2017-02-19 08:29:08 +00:00
|
|
|
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
|
2017-02-18 19:23:50 +00:00
|
|
|
)
|
|
|
|
|
2017-08-07 11:57:34 +00:00
|
|
|
echo %BUILD_VERSION% | findstr /C:"disable_gtk_integration">nul && (
|
|
|
|
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_GTK_INTEGRATION
|
|
|
|
)
|
|
|
|
|
2017-02-19 08:29:08 +00:00
|
|
|
if not "%TDESKTOP_BUILD_DEFINES%" == "" (
|
|
|
|
set "TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES:~1%"
|
2017-02-18 19:23:50 +00:00
|
|
|
)
|
|
|
|
|
2017-02-19 08:29:08 +00:00
|
|
|
call:logInfo "Build Defines: %TDESKTOP_BUILD_DEFINES%"
|
2017-02-18 19:23:50 +00:00
|
|
|
GOTO:EOF
|