mirror of
https://github.com/vale981/tdesktop
synced 2025-03-04 17:21:40 -05:00
Travis build fixed.
Caching libxkbcommon, Qt, breakpad, GYP, libva, ffmpeg, openal-soft.
This commit is contained in:
parent
79a90956f7
commit
1a67b31ee9
5 changed files with 538 additions and 264 deletions
742
.travis/build.sh
742
.travis/build.sh
|
@ -9,316 +9,566 @@ UPSTREAM="$REPO/upstream"
|
|||
EXTERNAL="$REPO/external"
|
||||
CACHE="$HOME/travisCacheDir"
|
||||
|
||||
QT_PATH="$BUILD/qt"
|
||||
BREAKPAD_PATH="$EXTERNAL/breakpad"
|
||||
|
||||
[[ ! $MAKE_ARGS ]] && MAKE_ARGS="--quiet -j4"
|
||||
QT_VERSION=5.6.0
|
||||
|
||||
XKB_PATH="$BUILD/libxkbcommon"
|
||||
XKB_CACHE_VERSION="2"
|
||||
|
||||
QT_PATH="$BUILD/qt"
|
||||
QT_CACHE_VERSION="2"
|
||||
QT_PATCH="$UPSTREAM/Telegram/Patches/qtbase_${QT_VERSION//\./_}.diff"
|
||||
|
||||
BREAKPAD_PATH="$BUILD/breakpad"
|
||||
BREAKPAD_CACHE_VERSION="2"
|
||||
|
||||
GYP_PATH="$BUILD/gyp"
|
||||
GYP_CACHE_VERSION="2"
|
||||
GYP_PATCH="$UPSTREAM/Telegram/Patches/gyp.diff"
|
||||
|
||||
VA_PATH="$BUILD/libva"
|
||||
VA_CACHE_VERSION="2"
|
||||
|
||||
FFMPEG_PATH="$BUILD/ffmpeg"
|
||||
FFMPEG_CACHE_VERSION="2"
|
||||
|
||||
OPENAL_PATH="$BUILD/openal-soft"
|
||||
OPENAL_CACHE_VERSION="2"
|
||||
|
||||
GYP_DEFINES=""
|
||||
|
||||
[[ ! $MAKE_ARGS ]] && MAKE_ARGS="--silent -j4"
|
||||
|
||||
run() {
|
||||
# Move files to subdir
|
||||
cd ..
|
||||
mv tdesktop tdesktop2
|
||||
mkdir tdesktop
|
||||
mv tdesktop2 "$UPSTREAM"
|
||||
# Move files to subdir
|
||||
cd ..
|
||||
mv tdesktop tdesktop2
|
||||
mkdir tdesktop
|
||||
mv tdesktop2 "$UPSTREAM"
|
||||
|
||||
mkdir "$BUILD"
|
||||
mkdir "$BUILD"
|
||||
|
||||
downloadLibs
|
||||
build
|
||||
check
|
||||
}
|
||||
|
||||
# install
|
||||
downloadLibs() {
|
||||
travisStartFold "Download libraries"
|
||||
|
||||
cd "$REPO"
|
||||
mkdir external && cd external
|
||||
|
||||
git clone https://chromium.googlesource.com/linux-syscall-support
|
||||
git clone https://git.ffmpeg.org/ffmpeg.git
|
||||
git clone https://github.com/xkbcommon/libxkbcommon.git
|
||||
git clone https://github.com/kcat/openal-soft.git
|
||||
build
|
||||
check
|
||||
}
|
||||
|
||||
build() {
|
||||
travisStartFold "Build libraries"
|
||||
mkdir -p "$EXTERNAL"
|
||||
|
||||
# libxkbcommon
|
||||
cd "$EXTERNAL/libxkbcommon"
|
||||
./autogen.sh \
|
||||
--prefix='/usr/local'
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
# libxkbcommon
|
||||
getXkbCommon
|
||||
|
||||
# ffmpeg
|
||||
cd "$EXTERNAL/ffmpeg"
|
||||
./configure \
|
||||
--prefix='/usr/local' \
|
||||
--disable-debug \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-everything \
|
||||
--enable-gpl \
|
||||
--enable-version3 \
|
||||
--enable-libopus \
|
||||
--enable-decoder=aac \
|
||||
--enable-decoder=aac_latm \
|
||||
--enable-decoder=aasc \
|
||||
--enable-decoder=flac \
|
||||
--enable-decoder=gif \
|
||||
--enable-decoder=h264 \
|
||||
--enable-decoder=h264_vdpau \
|
||||
--enable-decoder=mp1 \
|
||||
--enable-decoder=mp1float \
|
||||
--enable-decoder=mp2 \
|
||||
--enable-decoder=mp2float \
|
||||
--enable-decoder=mp3 \
|
||||
--enable-decoder=mp3adu \
|
||||
--enable-decoder=mp3adufloat \
|
||||
--enable-decoder=mp3float \
|
||||
--enable-decoder=mp3on4 \
|
||||
--enable-decoder=mp3on4float \
|
||||
--enable-decoder=mpeg4 \
|
||||
--enable-decoder=mpeg4_vdpau \
|
||||
--enable-decoder=msmpeg4v2 \
|
||||
--enable-decoder=msmpeg4v3 \
|
||||
--enable-decoder=opus \
|
||||
--enable-decoder=vorbis \
|
||||
--enable-decoder=wavpack \
|
||||
--enable-decoder=wmalossless \
|
||||
--enable-decoder=wmapro \
|
||||
--enable-decoder=wmav1 \
|
||||
--enable-decoder=wmav2 \
|
||||
--enable-decoder=wmavoice \
|
||||
--enable-encoder=libopus \
|
||||
--enable-hwaccel=h264_vaapi \
|
||||
--enable-hwaccel=h264_vdpau \
|
||||
--enable-hwaccel=mpeg4_vaapi \
|
||||
--enable-hwaccel=mpeg4_vdpau \
|
||||
--enable-parser=aac \
|
||||
--enable-parser=aac_latm \
|
||||
--enable-parser=flac \
|
||||
--enable-parser=h264 \
|
||||
--enable-parser=mpeg4video \
|
||||
--enable-parser=mpegaudio \
|
||||
--enable-parser=opus \
|
||||
--enable-parser=vorbis \
|
||||
--enable-demuxer=aac \
|
||||
--enable-demuxer=flac \
|
||||
--enable-demuxer=gif \
|
||||
--enable-demuxer=h264 \
|
||||
--enable-demuxer=mov \
|
||||
--enable-demuxer=mp3 \
|
||||
--enable-demuxer=ogg \
|
||||
--enable-demuxer=wav \
|
||||
--enable-muxer=ogg \
|
||||
--enable-muxer=opus
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
# libva
|
||||
getVa
|
||||
|
||||
# openal_soft
|
||||
cd "$EXTERNAL/openal-soft/build"
|
||||
cmake \
|
||||
-D CMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D LIBTYPE=STATIC \
|
||||
..
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
# ffmpeg
|
||||
getFFmpeg
|
||||
|
||||
# Qt
|
||||
getCustomQt
|
||||
# openal_soft
|
||||
getOpenAL
|
||||
|
||||
# Breakpad
|
||||
getBreakpad
|
||||
# Patched Qt
|
||||
getCustomQt
|
||||
|
||||
travisStartFold "Patch tdesktop"
|
||||
# Breakpad
|
||||
getBreakpad
|
||||
|
||||
# Patch tdesktop
|
||||
sed -i 's/CUSTOM_API_ID//g' "$UPSTREAM/Telegram/Telegram.pro"
|
||||
sed -i 's,LIBS += /usr/local/lib/libxkbcommon.a,,g' "$UPSTREAM/Telegram/Telegram.pro"
|
||||
sed -i 's,#xkbcommon,xkbcommon,g' "$UPSTREAM/Telegram/Telegram.pro"
|
||||
sed -i "s,\..*/Libraries/breakpad/,$BREAKPAD_PATH/,g" "$UPSTREAM/Telegram/Telegram.pro"
|
||||
# Patched GYP (supports cmake precompiled headers)
|
||||
getGYP
|
||||
|
||||
local options=""
|
||||
# Configure the build
|
||||
if [[ $BUILD_VERSION == *"disable_autoupdate"* ]]; then
|
||||
GYP_DEFINES += ",TDESKTOP_DISABLE_AUTOUPDATE"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_autoupdate"* ]]; then
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_AUTOUPDATE"
|
||||
fi
|
||||
if [[ $BUILD_VERSION == *"disable_register_custom_scheme"* ]]; then
|
||||
GYP_DEFINES += ",TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_register_custom_scheme"* ]]; then
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
|
||||
fi
|
||||
if [[ $BUILD_VERSION == *"disable_crash_reports"* ]]; then
|
||||
GYP_DEFINES += ",TDESKTOP_DISABLE_CRASH_REPORTS"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_crash_reports"* ]]; then
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_CRASH_REPORTS"
|
||||
fi
|
||||
if [[ $BUILD_VERSION == *"disable_network_proxy"* ]]; then
|
||||
GYP_DEFINES += ",TDESKTOP_DISABLE_NETWORK_PROXY"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_network_proxy"* ]]; then
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_NETWORK_PROXY"
|
||||
fi
|
||||
if [[ $BUILD_VERSION == *"disable_desktop_file_generation"* ]]; then
|
||||
GYP_DEFINES += ",TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_desktop_file_generation"* ]]; then
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION"
|
||||
fi
|
||||
if [[ $BUILD_VERSION == *"disable_unity_integration"* ]]; then
|
||||
GYP_DEFINES += ",TDESKTOP_DISABLE_UNITY_INTEGRATION"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_unity_integration"* ]]; then
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_UNITY_INTEGRATION"
|
||||
fi
|
||||
info_msg "Build defines: ${GYP_DEFINES}"
|
||||
|
||||
info_msg "Build options: ${options}"
|
||||
buildTelegram
|
||||
|
||||
echo -e "${options}" >> "$UPSTREAM/Telegram/Telegram.pro"
|
||||
travisEndFold
|
||||
}
|
||||
|
||||
travisStartFold "Build tdesktop"
|
||||
getXkbCommon() {
|
||||
travisStartFold "Getting xkbcommon"
|
||||
|
||||
buildTelegram
|
||||
|
||||
travisEndFold
|
||||
local XKB_CACHE="$CACHE/libxkbcommon"
|
||||
local XKB_CACHE_FILE="$XKB_CACHE/.cache.txt"
|
||||
local XKB_CACHE_KEY="${XKB_CACHE_VERSION}"
|
||||
local XKB_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$XKB_CACHE" ]; then
|
||||
mkdir -p "$XKB_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$XKB_CACHE" "$XKB_PATH"
|
||||
|
||||
if [ -f "$XKB_CACHE_FILE" ]; then
|
||||
local XKB_CACHE_KEY_FOUND=`tail -n 1 $XKB_CACHE_FILE`
|
||||
if [ "$XKB_CACHE_KEY" == "$XKB_CACHE_KEY_FOUND" ]; then
|
||||
XKB_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$XKB_CACHE_KEY_FOUND' does not match '$XKB_CACHE_KEY', rebuilding libxkbcommon"
|
||||
fi
|
||||
fi
|
||||
if [ "$XKB_CACHE_OUTDATED" == "1" ]; then
|
||||
buildXkbCommon
|
||||
sudo echo $XKB_CACHE_KEY > "$XKB_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached libxkbcommon"
|
||||
fi
|
||||
}
|
||||
|
||||
buildXkbCommon() {
|
||||
info_msg "Downloading and building libxkbcommon"
|
||||
|
||||
if [ -d "$EXTERNAL/libxkbcommon" ]; then
|
||||
rm -rf "$EXTERNAL/libxkbcommon"
|
||||
fi
|
||||
cd $XKB_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://github.com/xkbcommon/libxkbcommon.git
|
||||
|
||||
cd "$EXTERNAL/libxkbcommon"
|
||||
./autogen.sh --prefix=$XKB_PATH
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getVa() {
|
||||
travisStartFold "Getting libva"
|
||||
|
||||
local VA_CACHE="$CACHE/libva"
|
||||
local VA_CACHE_FILE="$VA_CACHE/.cache.txt"
|
||||
local VA_CACHE_KEY="${VA_CACHE_VERSION}"
|
||||
local VA_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$VA_CACHE" ]; then
|
||||
mkdir -p "$VA_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$VA_CACHE" "$VA_PATH"
|
||||
|
||||
if [ -f "$VA_CACHE_FILE" ]; then
|
||||
local VA_CACHE_KEY_FOUND=`tail -n 1 $VA_CACHE_FILE`
|
||||
if [ "$VA_CACHE_KEY" == "$VA_CACHE_KEY_FOUND" ]; then
|
||||
VA_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$VA_CACHE_KEY_FOUND' does not match '$VA_CACHE_KEY', rebuilding libva"
|
||||
fi
|
||||
fi
|
||||
if [ "$VA_CACHE_OUTDATED" == "1" ]; then
|
||||
buildVa
|
||||
sudo echo $VA_CACHE_KEY > "$VA_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached libva"
|
||||
fi
|
||||
}
|
||||
|
||||
buildVa() {
|
||||
info_msg "Downloading and building libva"
|
||||
|
||||
if [ -d "$EXTERNAL/libva" ]; then
|
||||
rm -rf "$EXTERNAL/libva"
|
||||
fi
|
||||
cd $VA_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone git://anongit.freedesktop.org/git/libva
|
||||
|
||||
cd "$EXTERNAL/libva"
|
||||
./autogen.sh --prefix=$VA_PATH --enable-static
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getFFmpeg() {
|
||||
travisStartFold "Getting ffmpeg"
|
||||
|
||||
local FFMPEG_CACHE="$CACHE/ffmpeg"
|
||||
local FFMPEG_CACHE_FILE="$FFMPEG_CACHE/.cache.txt"
|
||||
local FFMPEG_CACHE_KEY="${FFMPEG_CACHE_VERSION}"
|
||||
local FFMPEG_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$FFMPEG_CACHE" ]; then
|
||||
mkdir -p "$FFMPEG_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$FFMPEG_CACHE" "$FFMPEG_PATH"
|
||||
|
||||
if [ -f "$FFMPEG_CACHE_FILE" ]; then
|
||||
local FFMPEG_CACHE_KEY_FOUND=`tail -n 1 $FFMPEG_CACHE_FILE`
|
||||
if [ "$FFMPEG_CACHE_KEY" == "$FFMPEG_CACHE_KEY_FOUND" ]; then
|
||||
FFMPEG_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$FFMPEG_CACHE_KEY_FOUND' does not match '$FFMPEG_CACHE_KEY', rebuilding ffmpeg"
|
||||
fi
|
||||
fi
|
||||
if [ "$FFMPEG_CACHE_OUTDATED" == "1" ]; then
|
||||
buildFFmpeg
|
||||
sudo echo $FFMPEG_CACHE_KEY > "$FFMPEG_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached ffmpeg"
|
||||
fi
|
||||
}
|
||||
|
||||
buildFFmpeg() {
|
||||
info_msg "Downloading and building ffmpeg"
|
||||
|
||||
if [ -d "$EXTERNAL/ffmpeg" ]; then
|
||||
rm -rf "$EXTERNAL/ffmpeg"
|
||||
fi
|
||||
cd $FFMPEG_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://git.ffmpeg.org/ffmpeg.git
|
||||
|
||||
cd "$EXTERNAL/ffmpeg"
|
||||
./configure \
|
||||
--prefix=$FFMPEG_PATH \
|
||||
--disable-debug \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-everything \
|
||||
--enable-gpl \
|
||||
--enable-version3 \
|
||||
--enable-libopus \
|
||||
--enable-decoder=aac \
|
||||
--enable-decoder=aac_latm \
|
||||
--enable-decoder=aasc \
|
||||
--enable-decoder=flac \
|
||||
--enable-decoder=gif \
|
||||
--enable-decoder=h264 \
|
||||
--enable-decoder=h264_vdpau \
|
||||
--enable-decoder=mp1 \
|
||||
--enable-decoder=mp1float \
|
||||
--enable-decoder=mp2 \
|
||||
--enable-decoder=mp2float \
|
||||
--enable-decoder=mp3 \
|
||||
--enable-decoder=mp3adu \
|
||||
--enable-decoder=mp3adufloat \
|
||||
--enable-decoder=mp3float \
|
||||
--enable-decoder=mp3on4 \
|
||||
--enable-decoder=mp3on4float \
|
||||
--enable-decoder=mpeg4 \
|
||||
--enable-decoder=mpeg4_vdpau \
|
||||
--enable-decoder=msmpeg4v2 \
|
||||
--enable-decoder=msmpeg4v3 \
|
||||
--enable-decoder=opus \
|
||||
--enable-decoder=vorbis \
|
||||
--enable-decoder=wavpack \
|
||||
--enable-decoder=wmalossless \
|
||||
--enable-decoder=wmapro \
|
||||
--enable-decoder=wmav1 \
|
||||
--enable-decoder=wmav2 \
|
||||
--enable-decoder=wmavoice \
|
||||
--enable-encoder=libopus \
|
||||
--enable-hwaccel=h264_vaapi \
|
||||
--enable-hwaccel=h264_vdpau \
|
||||
--enable-hwaccel=mpeg4_vaapi \
|
||||
--enable-hwaccel=mpeg4_vdpau \
|
||||
--enable-parser=aac \
|
||||
--enable-parser=aac_latm \
|
||||
--enable-parser=flac \
|
||||
--enable-parser=h264 \
|
||||
--enable-parser=mpeg4video \
|
||||
--enable-parser=mpegaudio \
|
||||
--enable-parser=opus \
|
||||
--enable-parser=vorbis \
|
||||
--enable-demuxer=aac \
|
||||
--enable-demuxer=flac \
|
||||
--enable-demuxer=gif \
|
||||
--enable-demuxer=h264 \
|
||||
--enable-demuxer=mov \
|
||||
--enable-demuxer=mp3 \
|
||||
--enable-demuxer=ogg \
|
||||
--enable-demuxer=wav \
|
||||
--enable-muxer=ogg \
|
||||
--enable-muxer=opus
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getOpenAL() {
|
||||
travisStartFold "Getting openal-soft"
|
||||
|
||||
local OPENAL_CACHE="$CACHE/openal-soft"
|
||||
local OPENAL_CACHE_FILE="$OPENAL_CACHE/.cache.txt"
|
||||
local OPENAL_CACHE_KEY="${OPENAL_CACHE_VERSION}"
|
||||
local OPENAL_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$OPENAL_CACHE" ]; then
|
||||
mkdir -p "$OPENAL_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$OPENAL_CACHE" "$OPENAL_PATH"
|
||||
|
||||
if [ -f "$OPENAL_CACHE_FILE" ]; then
|
||||
local OPENAL_CACHE_KEY_FOUND=`tail -n 1 $OPENAL_CACHE_FILE`
|
||||
if [ "$OPENAL_CACHE_KEY" == "$OPENAL_CACHE_KEY_FOUND" ]; then
|
||||
OPENAL_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$OPENAL_CACHE_KEY_FOUND' does not match '$OPENAL_CACHE_KEY', rebuilding openal-soft"
|
||||
fi
|
||||
fi
|
||||
if [ "$OPENAL_CACHE_OUTDATED" == "1" ]; then
|
||||
buildOpenAL
|
||||
sudo echo $OPENAL_CACHE_KEY > "$OPENAL_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached openal-soft"
|
||||
fi
|
||||
}
|
||||
|
||||
buildOpenAL() {
|
||||
info_msg "Downloading and building openal-soft"
|
||||
|
||||
if [ -d "$EXTERNAL/openal-soft" ]; then
|
||||
rm -rf "$EXTERNAL/openal-soft"
|
||||
fi
|
||||
cd $OPENAL_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://github.com/kcat/openal-soft.git
|
||||
|
||||
cd "$EXTERNAL/openal-soft/build"
|
||||
cmake \
|
||||
-D CMAKE_INSTALL_PREFIX=$OPENAL_PATH \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D LIBTYPE=STATIC \
|
||||
..
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getBreakpad() {
|
||||
travisStartFold "Getting breakpad"
|
||||
travisStartFold "Getting breakpad"
|
||||
|
||||
local BREAKPAD_CACHE="$CACHE/breakpad"
|
||||
local BREAKPAD_CACHE_FILE="$BREAKPAD_CACHE/.cache.txt"
|
||||
|
||||
if [ ! -d "$BREAKPAD_CACHE" ]; then
|
||||
mkdir -p "$BREAKPAD_CACHE"
|
||||
fi
|
||||
local BREAKPAD_CACHE="$CACHE/breakpad"
|
||||
local BREAKPAD_CACHE_FILE="$BREAKPAD_CACHE/.cache.txt"
|
||||
local BREAKPAD_CACHE_KEY="${BREAKPAD_CACHE_VERSION}"
|
||||
local BREAKPAD_CACHE_OUTDATED="1"
|
||||
|
||||
ln -sf "$BREAKPAD_CACHE" "$BREAKPAD_PATH"
|
||||
if [ ! -d "$BREAKPAD_CACHE" ]; then
|
||||
mkdir -p "$BREAKPAD_CACHE"
|
||||
fi
|
||||
|
||||
if [ -f "$BREAKPAD_CACHE_FILE" ]; then
|
||||
info_msg "Using cached breakpad"
|
||||
makeBreakpadLink
|
||||
ln -sf "$BREAKPAD_CACHE" "$BREAKPAD_PATH"
|
||||
|
||||
if [ -f "$BREAKPAD_CACHE_FILE" ]; then
|
||||
local BREAKPAD_CACHE_KEY_FOUND=`tail -n 1 $BREAKPAD_CACHE_FILE`
|
||||
if [ "$BREAKPAD_CACHE_KEY" == "$BREAKPAD_CACHE_KEY_FOUND" ]; then
|
||||
BREAKPAD_CACHE_OUTDATED="0"
|
||||
else
|
||||
buildBreakpad
|
||||
sudo touch "$BREAKPAD_CACHE_FILE"
|
||||
info_msg "Cache key '$BREAKPAD_CACHE_KEY_FOUND' does not match '$BREAKPAD_CACHE_KEY', rebuilding breakpad"
|
||||
fi
|
||||
fi
|
||||
if [ "$BREAKPAD_CACHE_OUTDATED" == "1" ]; then
|
||||
buildBreakpad
|
||||
sudo echo $BREAKPAD_CACHE_KEY > "$BREAKPAD_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached breakpad"
|
||||
fi
|
||||
}
|
||||
|
||||
buildBreakpad() {
|
||||
info_msg "Downloading and building breakpad"
|
||||
info_msg "Downloading and building breakpad"
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://chromium.googlesource.com/breakpad/breakpad
|
||||
if [ -d "$EXTERNAL/breakpad" ]; then
|
||||
rm -rf "$EXTERNAL/breakpad"
|
||||
fi
|
||||
cd $BREAKPAD_PATH
|
||||
rm -rf *
|
||||
|
||||
makeBreakpadLink
|
||||
cd "$BREAKPAD_PATH"
|
||||
./configure
|
||||
make $MAKE_ARGS
|
||||
}
|
||||
cd "$EXTERNAL"
|
||||
git clone https://chromium.googlesource.com/breakpad/breakpad
|
||||
|
||||
makeBreakpadLink() {
|
||||
local LSS_PATH="$BREAKPAD_PATH/src/third_party/lss"
|
||||
ln -s -f "$EXTERNAL/linux-syscall-support" "$LSS_PATH"
|
||||
|
||||
local LSS_GIT_PATH="$LSS_PATH/.git"
|
||||
|
||||
if [ -d "$LSS_GIT_PATH" ]; then # Remove git dir to prevent cache changes
|
||||
rm -rf "$LSS_GIT_PATH"
|
||||
fi
|
||||
cd "$EXTERNAL/breakpad/src/third_party"
|
||||
git clone https://chromium.googlesource.com/linux-syscall-support lss
|
||||
|
||||
cd "$EXTERNAL/breakpad"
|
||||
./configure --prefix=$BREAKPAD_PATH
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getCustomQt() {
|
||||
travisStartFold "Getting patched QT"
|
||||
travisStartFold "Getting patched Qt"
|
||||
|
||||
local QT_CACHE="$CACHE/qtPatched"
|
||||
local QT_CACHE_FILE="$QT_CACHE/.cache.txt"
|
||||
local QT_CACHE="$CACHE/qtPatched"
|
||||
local QT_CACHE_FILE="$QT_CACHE/.cache.txt"
|
||||
local QT_PATCH_CHECKSUM=`sha1sum $QT_PATCH`
|
||||
local QT_CACHE_KEY="${QT_VERSION}_${QT_CACHE_VERSION}_${QT_PATCH_CHECKSUM:0:32}"
|
||||
local QT_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$QT_CACHE" ]; then
|
||||
mkdir -p "$QT_CACHE"
|
||||
fi
|
||||
if [ ! -d "$QT_CACHE" ]; then
|
||||
mkdir -p "$QT_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$QT_CACHE" "$QT_PATH"
|
||||
ln -sf "$QT_CACHE" "$QT_PATH"
|
||||
|
||||
if [ -f "$QT_CACHE_FILE" ]; then
|
||||
info_msg "Using cached patched qt"
|
||||
if [ -f "$QT_CACHE_FILE" ]; then
|
||||
local QT_CACHE_KEY_FOUND=`tail -n 1 $QT_CACHE_FILE`
|
||||
if [ "$QT_CACHE_KEY" == "$QT_CACHE_KEY_FOUND" ]; then
|
||||
QT_CACHE_OUTDATED="0"
|
||||
else
|
||||
buildCustomQt
|
||||
sudo touch "$QT_CACHE_FILE"
|
||||
info_msg "Cache key '$QT_CACHE_KEY_FOUND' does not match '$QT_CACHE_KEY', rebuilding patched Qt"
|
||||
fi
|
||||
fi
|
||||
if [ "$QT_CACHE_OUTDATED" == "1" ]; then
|
||||
buildCustomQt
|
||||
sudo echo $QT_CACHE_KEY > "$QT_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached patched Qt"
|
||||
fi
|
||||
|
||||
export PATH="$QT_PATH/bin:$PATH"
|
||||
export PATH="$QT_PATH/bin:$PATH"
|
||||
}
|
||||
|
||||
buildCustomQt() {
|
||||
info_msg "Downloading and building patched qt"
|
||||
info_msg "Downloading and building patched qt"
|
||||
|
||||
cd "$EXTERNAL"
|
||||
echo -e "Clone Qt ${QT_VERSION}\n"
|
||||
git clone git://code.qt.io/qt/qt5.git qt${QT_VERSION}
|
||||
cd qt${QT_VERSION}
|
||||
git checkout "$(echo ${QT_VERSION} | sed -e s/\..$//)"
|
||||
perl init-repository --module-subset=qtbase,qtimageformats
|
||||
git checkout v${QT_VERSION}
|
||||
cd qtbase && git checkout v${QT_VERSION} && cd ..
|
||||
cd qtimageformats && git checkout v${QT_VERSION} && cd ..
|
||||
cd ..
|
||||
if [ -d "$EXTERNAL/qt${QT_VERSION}" ]; then
|
||||
rm -rf "$EXTERNAL/qt${QT_VERSION}"
|
||||
fi
|
||||
cd $QT_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL/qt${QT_VERSION}/qtbase"
|
||||
git apply "$UPSTREAM/Telegram/Patches/qtbase_${QT_VERSION//\./_}.diff"
|
||||
cd ..
|
||||
./configure -prefix "$QT_PATH" -release -opensource -confirm-license -qt-zlib \
|
||||
-qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
|
||||
-qt-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests \
|
||||
-dbus-runtime -openssl-linked -no-gstreamer -no-mtdev # <- Not sure about these
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
cd "$EXTERNAL"
|
||||
git clone git://code.qt.io/qt/qt5.git qt${QT_VERSION}
|
||||
|
||||
cd "$EXTERNAL/qt${QT_VERSION}"
|
||||
git checkout "$(echo ${QT_VERSION} | sed -e s/\..$//)"
|
||||
perl init-repository --module-subset=qtbase,qtimageformats
|
||||
git checkout v${QT_VERSION}
|
||||
cd qtbase && git checkout v${QT_VERSION} && cd ..
|
||||
cd qtimageformats && git checkout v${QT_VERSION} && cd ..
|
||||
|
||||
cd "$EXTERNAL/qt${QT_VERSION}/qtbase"
|
||||
git apply "$QT_PATCH"
|
||||
cd ..
|
||||
|
||||
./configure -prefix $QT_PATH -release -opensource -confirm-license -qt-zlib \
|
||||
-qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
|
||||
-qt-xkbcommon-x11 -no-opengl -no-gtkstyle -static \
|
||||
-nomake examples -nomake tests \
|
||||
-dbus-runtime -no-gstreamer -no-mtdev # <- Not sure about these
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
}
|
||||
|
||||
getGYP() {
|
||||
travisStartFold "Getting patched GYP"
|
||||
|
||||
local GYP_CACHE="$CACHE/gyp"
|
||||
local GYP_CACHE_FILE="$GYP_CACHE/.cache.txt"
|
||||
local GYP_PATCH_CHECKSUM=`sha1sum $GYP_PATCH`
|
||||
local GYP_CACHE_KEY="${GYP_CACHE_VERSION}_${GYP_PATCH_CHECKSUM:0:32}"
|
||||
local GYP_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$GYP_CACHE" ]; then
|
||||
mkdir -p "$GYP_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$GYP_CACHE" "$GYP_PATH"
|
||||
|
||||
if [ -f "$GYP_CACHE_FILE" ]; then
|
||||
local GYP_CACHE_KEY_FOUND=`tail -n 1 $GYP_CACHE_FILE`
|
||||
if [ "$GYP_CACHE_KEY" == "$GYP_CACHE_KEY_FOUND" ]; then
|
||||
GYP_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$GYP_CACHE_KEY_FOUND' does not match '$GYP_CACHE_KEY', rebuilding patched GYP"
|
||||
fi
|
||||
fi
|
||||
if [ "$GYP_CACHE_OUTDATED" == "1" ]; then
|
||||
buildGYP
|
||||
sudo echo $GYP_CACHE_KEY > "$GYP_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached patched GYP"
|
||||
fi
|
||||
}
|
||||
|
||||
buildGYP() {
|
||||
info_msg "Downloading and building patched GYP"
|
||||
|
||||
if [ -d "$EXTERNAL/gyp" ]; then
|
||||
rm -rf "$EXTERNAL/gyp"
|
||||
fi
|
||||
cd $GYP_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://chromium.googlesource.com/external/gyp
|
||||
|
||||
cd "$EXTERNAL/gyp"
|
||||
git checkout 702ac58e4772
|
||||
git apply "$GYP_PATCH"
|
||||
cp -r * "$GYP_PATH/"
|
||||
}
|
||||
|
||||
buildTelegram() {
|
||||
info_msg "Build codegen_style"
|
||||
# Build codegen_style
|
||||
mkdir -p "$UPSTREAM/Linux/obj/codegen_style/Debug"
|
||||
cd "$UPSTREAM/Linux/obj/codegen_style/Debug"
|
||||
qmake QT_TDESKTOP_PATH="${QT_PATH}" QT_TDESKTOP_VERSION=${QT_VERSION} CONFIG+=debug "../../../../Telegram/build/qmake/codegen_style/codegen_style.pro"
|
||||
make $MAKE_ARGS
|
||||
travisStartFold "Build tdesktop"
|
||||
|
||||
info_msg "Build codegen_numbers"
|
||||
# Build codegen_numbers
|
||||
mkdir -p "$UPSTREAM/Linux/obj/codegen_numbers/Debug"
|
||||
cd "$UPSTREAM/Linux/obj/codegen_numbers/Debug"
|
||||
qmake QT_TDESKTOP_PATH="${QT_PATH}" QT_TDESKTOP_VERSION=${QT_VERSION} CONFIG+=debug "../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro"
|
||||
make $MAKE_ARGS
|
||||
cd "$UPSTREAM/Telegram/gyp"
|
||||
"$GYP_PATH/gyp" \
|
||||
-Dtravis_defines=${GYP_DEFINES:1} \
|
||||
-Dlinux_path_xkbcommon=$XKB_PATH \
|
||||
-Dlinux_path_va=$VA_PATH \
|
||||
-Dlinux_path_ffmpeg=$FFMPEG_PATH \
|
||||
-Dlinux_path_openal=$OPENAL_PATH \
|
||||
-Dlinux_path_qt=$QT_PATH \
|
||||
-Dlinux_path_breakpad=$BREAKPAD_PATH \
|
||||
-Dlinux_path_libexif_lib=/usr/local/lib \
|
||||
-Dlinux_lib_ssl=-lssl \
|
||||
-Dlinux_lib_crypto=-lcrypto\ -licuuc\ -licutu\ -licui18n \
|
||||
--depth=. --generator-output=../.. --format=cmake -Goutput_dir=out \
|
||||
Telegram.gyp
|
||||
cd "$UPSTREAM/out/Debug"
|
||||
|
||||
info_msg "Build MetaLang"
|
||||
# Build MetaLang
|
||||
mkdir -p "$UPSTREAM/Linux/DebugIntermediateLang"
|
||||
cd "$UPSTREAM/Linux/DebugIntermediateLang"
|
||||
qmake QT_TDESKTOP_PATH="${QT_PATH}" QT_TDESKTOP_VERSION=${QT_VERSION} CONFIG+=debug "../../Telegram/MetaLang.pro"
|
||||
make $MAKE_ARGS
|
||||
|
||||
info_msg "Build Telegram Desktop"
|
||||
# Build Telegram Desktop
|
||||
mkdir -p "$UPSTREAM/Linux/DebugIntermediate"
|
||||
cd "$UPSTREAM/Linux/DebugIntermediate"
|
||||
|
||||
./../codegen/Debug/codegen_style "-I./../../Telegram/Resources" "-I./../../Telegram/SourceFiles" "-o./GeneratedFiles/styles" all_files.style --rebuild
|
||||
./../codegen/Debug/codegen_numbers "-o./GeneratedFiles" "./../../Telegram/Resources/numbers.txt"
|
||||
./../DebugLang/MetaLang -lang_in ./../../Telegram/Resources/langs/lang.strings -lang_out ./GeneratedFiles/lang_auto
|
||||
qmake QT_TDESKTOP_PATH="${QT_PATH}" QT_TDESKTOP_VERSION=${QT_VERSION} CONFIG+=debug "../../Telegram/Telegram.pro"
|
||||
make $MAKE_ARGS
|
||||
export ASM="gcc"
|
||||
cmake .
|
||||
make $MAKE_ARGS
|
||||
}
|
||||
|
||||
check() {
|
||||
local filePath="$UPSTREAM/Linux/Debug/Telegram"
|
||||
if test -f "$filePath"; then
|
||||
success_msg "Build successful done! :)"
|
||||
local filePath="$UPSTREAM/out/Debug/Telegram"
|
||||
if test -f "$filePath"; then
|
||||
success_msg "Build successful done! :)"
|
||||
|
||||
local size;
|
||||
size=$(stat -c %s "$filePath")
|
||||
success_msg "File size of ${filePath}: ${size} Bytes"
|
||||
else
|
||||
error_msg "Build error, output file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
local size;
|
||||
size=$(stat -c %s "$filePath")
|
||||
success_msg "File size of ${filePath}: ${size} Bytes"
|
||||
else
|
||||
error_msg "Build error, output file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
source ./.travis/common.sh
|
||||
|
|
|
@ -24,7 +24,10 @@
|
|||
'targets': [{
|
||||
'target_name': 'Telegram',
|
||||
'variables': {
|
||||
'libs_loc': '../../../Libraries',
|
||||
'variables': {
|
||||
'libs_loc': '../../../Libraries',
|
||||
},
|
||||
'libs_loc': '<(libs_loc)',
|
||||
'src_loc': '../SourceFiles',
|
||||
'res_loc': '../Resources',
|
||||
'minizip_loc': '../ThirdParty/minizip',
|
||||
|
@ -50,6 +53,8 @@
|
|||
'ko',
|
||||
'pt-BR',
|
||||
],
|
||||
'travis_defines%': '',
|
||||
'linux_path_breakpad%': '<(libs_loc)/breakpad',
|
||||
},
|
||||
'includes': [
|
||||
'common_executable.gypi',
|
||||
|
@ -71,12 +76,13 @@
|
|||
|
||||
'defines': [
|
||||
'AL_LIBTYPE_STATIC',
|
||||
'<!@(python -c "for s in \'<(travis_defines)\'.split(\',\'): print(s)")',
|
||||
],
|
||||
|
||||
'include_dirs': [
|
||||
'<(src_loc)',
|
||||
'<(SHARED_INTERMEDIATE_DIR)',
|
||||
'<(libs_loc)/breakpad/src',
|
||||
'<(linux_path_breakpad)/include/breakpad',
|
||||
'<(libs_loc)/lzma/C',
|
||||
'<(libs_loc)/libexif-0.6.20',
|
||||
'<(libs_loc)/zlib-1.2.8',
|
||||
|
|
|
@ -22,6 +22,15 @@
|
|||
'variables': {
|
||||
'variables': {
|
||||
'variables': {
|
||||
'variables': {
|
||||
'conditions': [
|
||||
[ 'build_macold', {
|
||||
'qt_version%': '5.3.2',
|
||||
}, {
|
||||
'qt_version%': '5.6.0',
|
||||
}]
|
||||
],
|
||||
},
|
||||
'qt_libs': [
|
||||
'qwebp',
|
||||
'Qt5PrintSupport',
|
||||
|
@ -31,13 +40,8 @@
|
|||
'Qt5Gui',
|
||||
'qtharfbuzzng',
|
||||
],
|
||||
'conditions': [
|
||||
[ 'build_macold', {
|
||||
'qt_version%': '5.3.2',
|
||||
}, {
|
||||
'qt_version%': '5.6.0',
|
||||
}]
|
||||
],
|
||||
'qt_version%': '<(qt_version)',
|
||||
'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)',
|
||||
},
|
||||
'qt_version%': '<(qt_version)',
|
||||
'conditions': [
|
||||
|
@ -78,7 +82,7 @@
|
|||
],
|
||||
}],
|
||||
[ 'build_linux', {
|
||||
'qt_loc_unix': '/usr/local/tdesktop/Qt-<(qt_version)',
|
||||
'qt_loc_unix': '<(linux_path_qt)',
|
||||
'qt_lib_prefix': 'lib',
|
||||
'qt_lib_debug_postfix': '.a',
|
||||
'qt_lib_release_postfix': '.a',
|
||||
|
@ -94,6 +98,7 @@
|
|||
'qtpcre',
|
||||
'Xi',
|
||||
'Xext',
|
||||
'Xfixes',
|
||||
'SM',
|
||||
'ICE',
|
||||
'fontconfig',
|
||||
|
@ -127,6 +132,10 @@
|
|||
'qt_loc': '<(qt_loc_unix)',
|
||||
}],
|
||||
],
|
||||
|
||||
'linux_path_xkbcommon%': '/usr/local',
|
||||
'linux_lib_ssl%': '/usr/local/ssl/lib/libssl.a',
|
||||
'linux_lib_crypto%': '/usr/local/ssl/lib/libcrypto.a',
|
||||
},
|
||||
|
||||
'configurations': {
|
||||
|
@ -202,10 +211,10 @@
|
|||
'<(qt_loc)/plugins/platforminputcontexts',
|
||||
],
|
||||
'libraries': [
|
||||
'/usr/local/lib/libxkbcommon.a',
|
||||
'<(linux_path_xkbcommon)/lib/libxkbcommon.a',
|
||||
'<@(qt_libs_release)',
|
||||
'/usr/local/ssl/lib/libssl.a',
|
||||
'/usr/local/ssl/lib/libcrypto.a',
|
||||
'<(linux_lib_ssl)',
|
||||
'<(linux_lib_crypto)',
|
||||
'xcb',
|
||||
'X11',
|
||||
'X11-xcb',
|
||||
|
|
|
@ -27,15 +27,23 @@
|
|||
# QApplication() -> createPlatformIntegration -> QXcbIntegrationPlugin::create
|
||||
#'xkbcommon',
|
||||
],
|
||||
'linux_path_ffmpeg%': '/usr/local',
|
||||
'linux_path_openal%': '/usr/local',
|
||||
'linux_path_libexif_lib%': '<(libs_loc)/libexif-0.6.20/libexif/.libs',
|
||||
'linux_path_va%': '/usr/local',
|
||||
},
|
||||
'include_dirs': [
|
||||
'/usr/local/include',
|
||||
'<(libs_loc)/openssl-xcode/include'
|
||||
'<(linux_path_ffmpeg)/include',
|
||||
'<(linux_path_openal)/include',
|
||||
],
|
||||
'library_dirs': [
|
||||
'/usr/local/lib',
|
||||
'<(libs_loc)/libexif-0.6.20/libexif/.libs',
|
||||
'<(libs_loc)/breakpad/src/client/linux',
|
||||
'<(linux_path_ffmpeg)/lib',
|
||||
'<(linux_path_openal)/lib',
|
||||
'<(linux_path_breakpad)/lib',
|
||||
'<(linux_path_libexif_lib)',
|
||||
'<(linux_path_va)/lib',
|
||||
],
|
||||
'libraries': [
|
||||
'breakpad_client',
|
||||
|
@ -53,6 +61,7 @@
|
|||
'libva-x11.a',
|
||||
'libva-drm.a',
|
||||
'libva.a',
|
||||
'libdrm.a',
|
||||
'libz.a',
|
||||
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
|
||||
],
|
||||
|
|
|
@ -159,9 +159,9 @@ In Terminal go to **/home/user/TBuild/Libraries** and run
|
|||
git clone https://chromium.googlesource.com/breakpad/breakpad
|
||||
git clone https://chromium.googlesource.com/linux-syscall-support breakpad/src/third_party/lss
|
||||
cd breakpad
|
||||
./configure
|
||||
./configure --prefix=$PWD
|
||||
make
|
||||
sudo make install
|
||||
make install
|
||||
|
||||
####GYP and CMake
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue