Fix travis and appveyor builds.

This commit is contained in:
John Preston 2017-11-29 20:15:33 +04:00
parent cc1df6a068
commit 6994201d50
4 changed files with 60 additions and 5 deletions

View File

@ -27,7 +27,7 @@ GOTO:EOF
call:logInfo "Clone dependencies repository"
git clone -q --depth 1 --branch=master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR%
cd %LIB_DIR%
git clone https://github.com/Microsoft/Range-V3-VS2015 range-v3
if exist prepare.bat (
call prepare.bat
) else (

View File

@ -33,8 +33,8 @@ addons:
- dpatch
- equivs
- fakeroot
- g++-6
- gcc-6
- g++-7
- gcc-7
- git
- gnome-common
- gobject-introspection
@ -58,8 +58,8 @@ addons:
- yasm
before_install:
- export CXX="g++-6" CC="gcc-6"
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
- export CXX="g++-7" CC="gcc-7"
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
- sudo update-alternatives --config gcc
- g++ --version

View File

@ -27,6 +27,9 @@ GYP_PATH="$BUILD/gyp"
GYP_CACHE_VERSION="3"
GYP_PATCH="$UPSTREAM/Telegram/Patches/gyp.diff"
RANGE_PATH="$BUILD/range-v3"
RANGE_CACHE_VERSION="3"
VA_PATH="$BUILD/libva"
VA_CACHE_VERSION="3"
@ -85,6 +88,9 @@ build() {
# Patched GYP (supports cmake precompiled headers)
getGYP
# Range v3
getRange
# Guideline Support Library
getGSL
@ -178,6 +184,52 @@ buildXkbCommon() {
sudo ldconfig
}
getRange() {
travisStartFold "Getting range-v3"
local RANGE_CACHE="$CACHE/range-v3"
local RANGE_CACHE_FILE="$RANGE_CACHE/.cache.txt"
local RANGE_CACHE_KEY="${RANGE_CACHE_VERSION}"
local RANGE_CACHE_OUTDATED="1"
if [ ! -d "$RANGE_CACHE" ]; then
mkdir -p "$RANGE_CACHE"
fi
ln -sf "$RANGE_CACHE" "$RANGE_PATH"
if [ -f "$RANGE_CACHE_FILE" ]; then
local RANGE_CACHE_KEY_FOUND=`tail -n 1 $RANGE_CACHE_FILE`
if [ "$RANGE_CACHE_KEY" == "$RANGE_CACHE_KEY_FOUND" ]; then
RANGE_CACHE_OUTDATED="0"
else
info_msg "Cache key '$RANGE_CACHE_KEY_FOUND' does not match '$RANGE_CACHE_KEY', getting range-v3"
fi
fi
if [ "$RANGE_CACHE_OUTDATED" == "1" ]; then
buildRange
sudo echo $RANGE_CACHE_KEY > "$RANGE_CACHE_FILE"
else
info_msg "Using cached range-v3"
fi
}
buildRange() {
info_msg "Downloading range-v3"
if [ -d "$EXTERNAL/range-v3" ]; then
rm -rf "$EXTERNAL/range-v3"
fi
cd $RANGE_PATH
rm -rf *
cd "$EXTERNAL"
git clone --depth=1 https://github.com/ericniebler/range-v3
cd "$EXTERNAL/range-v3"
cp -r * "$RANGE_PATH/"
}
getVa() {
travisStartFold "Getting libva"
@ -628,6 +680,7 @@ buildTelegram() {
-Dlinux_path_vdpau=$VDPAU_PATH \
-Dlinux_path_ffmpeg=$FFMPEG_PATH \
-Dlinux_path_openal=$OPENAL_PATH \
-Dlinux_path_range=$RANGE_PATH \
-Dlinux_path_qt=$QT_PATH \
-Dlinux_path_breakpad=$BREAKPAD_PATH \
-Dlinux_path_libexif_lib=/usr/local/lib \

View File

@ -34,6 +34,7 @@
'linux_path_vdpau%': '/usr/local',
'linux_path_breakpad%': '/usr/local',
'linux_path_opus_include%': '<(libs_loc)/opus/include',
'linux_path_range%': '/usr/local',
},
'include_dirs': [
'/usr/local/include',
@ -41,6 +42,7 @@
'<(linux_path_openal)/include',
'<(linux_path_breakpad)/include/breakpad',
'<(linux_path_opus_include)',
'<(linux_path_range)/include',
],
'library_dirs': [
'/usr/local/lib',