diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 000000000..ae0bd47ca --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,501 @@ +name: Linux. + +on: + push: + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' + +jobs: + + linux: + name: Ubuntu 14.04 + runs-on: ubuntu-latest + container: ubuntu:trusty + + strategy: + matrix: + defines: + - "" + + env: + GIT: "https://github.com" + QT: "5_12_5" + QT_PREFIX: "/usr/local/desktop-app/Qt-5.12.5" + OPENSSL_VER: "1_1_1" + OPENSSL_PREFIX: "/usr/local/desktop-app/openssl-1.1.1" + CMAKE_VER: "3.16.3" + UPLOAD_ARTIFACT: "false" + ONLY_CACHE: "false" + MANUAL_CACHING: "1" + DOC_PATH: "docs/building-cmake.md" + + steps: + - name: Get repository name. + run: echo ::set-env name=REPO_NAME::${GITHUB_REPOSITORY##*/} + + - name: Clone. + uses: actions/checkout@v1 + with: + submodules: recursive + + - name: First set up. + run: | + cd .. + mv $REPO_NAME temp + mkdir $REPO_NAME + mv temp $REPO_NAME/$REPO_NAME + cd $REPO_NAME + + sudo apt-get update + sudo apt-get install software-properties-common -y && \ + sudo apt-get install git libexif-dev liblzma-dev libz-dev libssl-dev \ + libappindicator-dev libicu-dev libdee-dev libdrm-dev dh-autoreconf \ + autoconf automake build-essential libass-dev libfreetype6-dev \ + libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev \ + libvorbis-dev libenchant-dev libxcb1-dev libxcb-image0-dev libxcb-shm0-dev \ + libxcb-xfixes0-dev libxcb-keysyms1-dev libxcb-icccm4-dev libatspi2.0-dev \ + libxcb-render-util0-dev libxcb-util0-dev libxcb-xkb-dev libxrender-dev \ + libasound-dev libpulse-dev libxcb-sync0-dev libxcb-randr0-dev bison \ + libx11-xcb-dev libffi-dev libncurses5-dev pkg-config texi2html yasm \ + zlib1g-dev xutils-dev python-xcbgen chrpath gperf wget -y --force-yes && \ + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ + sudo apt-get update && \ + sudo apt-get install gcc-8 g++-8 -y && \ + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 && \ + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60 && \ + sudo update-alternatives --config gcc && \ + sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test -y + + gcc --version + + gcc --version > CACHE_KEY.txt + echo $MANUAL_CACHING >> CACHE_KEY.txt + md5cache=$(md5sum CACHE_KEY.txt | cut -c -32) + echo ::set-env name=CACHE_KEY::$md5cache + + mkdir -p Libraries + cd Libraries + echo ::set-env name=LibrariesPath::`pwd` + + - name: Range-v3. + run: | + echo "Find necessary branch from doc." + cloneRange=$(grep -A 1 "range-v3" $REPO_NAME/$DOC_PATH | sed -n 1p) + cd $LibrariesPath + echo $cloneRange + eval $cloneRange + + - name: Patches. + run: | + echo "Find necessary commit from doc." + checkoutCommit=$(grep -A 1 "cd patches" $REPO_NAME/$DOC_PATH | sed -n 2p) + cd $LibrariesPath + git clone $GIT/desktop-app/patches.git + cd patches + eval $checkoutCommit + + - name: CMake. + run: | + cd $LibrariesPath + + file=cmake-$CMAKE_VER-Linux-x86_64.sh + wget $GIT/Kitware/CMake/releases/download/v$CMAKE_VER/$file + sudo mkdir /opt/cmake + sudo sh $file --prefix=/opt/cmake --skip-license + sudo ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake + + cmake --version + + - name: Zlib. + run: | + cd $LibrariesPath + + git clone $GIT/madler/zlib.git + cd zlib + ./configure + make -j$(nproc) + sudo make install + + - name: Opus cache. + id: cache-opus + uses: actions/cache@v1 + with: + path: ${{ env.LibrariesPath }}/opus + key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }} + - name: Opus. + if: steps.cache-opus.outputs.cache-hit != 'true' + run: | + cd $LibrariesPath + + git clone $GIT/xiph/opus + cd opus + git checkout v1.3 + ./autogen.sh + ./configure + make -j$(nproc) + - name: Opus install. + run: | + cd $LibrariesPath/opus + sudo make install + + - name: Libva. + run: | + cd $LibrariesPath + + git clone $GIT/01org/libva.git + cd libva + ./autogen.sh --enable-static + make -j$(nproc) + sudo make install + + - name: Libvdpau. + run: | + cd $LibrariesPath + + git clone git://anongit.freedesktop.org/vdpau/libvdpau + cd libvdpau + git checkout libvdpau-1.2 + ./autogen.sh --enable-static + make -j$(nproc) + sudo make install + + - name: FFmpeg cache. + id: cache-ffmpeg + uses: actions/cache@v1 + with: + path: ${{ env.LibrariesPath }}/ffmpeg-cache + key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }} + - name: FFmpeg build. + if: steps.cache-ffmpeg.outputs.cache-hit != 'true' + run: | + cd $LibrariesPath + + git clone --branch release/3.4 $GIT/FFmpeg/FFmpeg ffmpeg + cd ffmpeg + ./configure --prefix=$LibrariesPath/ffmpeg-cache \ + --enable-protocol=file --enable-libopus \ + --disable-programs \ + --disable-doc \ + --disable-network \ + --disable-everything \ + --enable-hwaccel=h264_vaapi \ + --enable-hwaccel=h264_vdpau \ + --enable-hwaccel=mpeg4_vaapi \ + --enable-hwaccel=mpeg4_vdpau \ + --enable-decoder=aac \ + --enable-decoder=aac_at \ + --enable-decoder=aac_fixed \ + --enable-decoder=aac_latm \ + --enable-decoder=aasc \ + --enable-decoder=alac \ + --enable-decoder=alac_at \ + --enable-decoder=flac \ + --enable-decoder=gif \ + --enable-decoder=h264 \ + --enable-decoder=h264_vdpau \ + --enable-decoder=hevc \ + --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=pcm_alaw \ + --enable-decoder=pcm_alaw_at \ + --enable-decoder=pcm_f32be \ + --enable-decoder=pcm_f32le \ + --enable-decoder=pcm_f64be \ + --enable-decoder=pcm_f64le \ + --enable-decoder=pcm_lxf \ + --enable-decoder=pcm_mulaw \ + --enable-decoder=pcm_mulaw_at \ + --enable-decoder=pcm_s16be \ + --enable-decoder=pcm_s16be_planar \ + --enable-decoder=pcm_s16le \ + --enable-decoder=pcm_s16le_planar \ + --enable-decoder=pcm_s24be \ + --enable-decoder=pcm_s24daud \ + --enable-decoder=pcm_s24le \ + --enable-decoder=pcm_s24le_planar \ + --enable-decoder=pcm_s32be \ + --enable-decoder=pcm_s32le \ + --enable-decoder=pcm_s32le_planar \ + --enable-decoder=pcm_s64be \ + --enable-decoder=pcm_s64le \ + --enable-decoder=pcm_s8 \ + --enable-decoder=pcm_s8_planar \ + --enable-decoder=pcm_u16be \ + --enable-decoder=pcm_u16le \ + --enable-decoder=pcm_u24be \ + --enable-decoder=pcm_u24le \ + --enable-decoder=pcm_u32be \ + --enable-decoder=pcm_u32le \ + --enable-decoder=pcm_u8 \ + --enable-decoder=pcm_zork \ + --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-parser=aac \ + --enable-parser=aac_latm \ + --enable-parser=flac \ + --enable-parser=h264 \ + --enable-parser=hevc \ + --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=hevc \ + --enable-demuxer=m4v \ + --enable-demuxer=mov \ + --enable-demuxer=mp3 \ + --enable-demuxer=ogg \ + --enable-demuxer=wav \ + --enable-muxer=ogg \ + --enable-muxer=opus + + make -j$(nproc) + sudo make install + - name: FFmpeg install. + run: | + cd $LibrariesPath + #List of files from cmake/external/ffmpeg/CMakeLists.txt. + copyLib() { + mkdir -p ffmpeg/$1 + yes | cp -i ffmpeg-cache/lib/$1.a ffmpeg/$1/$1.a + } + copyLib libavformat + copyLib libavcodec + copyLib libswresample + copyLib libswscale + copyLib libavutil + + sudo cp -R ffmpeg-cache/. /usr/local/ + + - name: PortAudio. + run: | + cd $LibrariesPath + + git clone https://git.assembla.com/portaudio.git + cd portaudio + git checkout 396fe4b669 + ./configure + make -j$(nproc) + sudo make install + + - name: OpenAL Soft. + run: | + cd $LibrariesPath + + git clone $GIT/kcat/openal-soft.git + cd openal-soft + git checkout openal-soft-1.19.1 + cd build + cmake -D LIBTYPE:STRING=STATIC .. + make -j$(nproc) + sudo make install + + - name: OpenSSL cache. + id: cache-openssl + uses: actions/cache@v1 + with: + path: ${{ env.LibrariesPath }}/openssl-cache + key: ${{ runner.OS }}-${{ env.OPENSSL_VER }}-${{ env.CACHE_KEY }} + - name: OpenSSL build. + if: steps.cache-openssl.outputs.cache-hit != 'true' + run: | + cd $LibrariesPath + + git clone $GIT/openssl/openssl openssl_$OPENSSL_VER + cd openssl_$OPENSSL_VER + git checkout OpenSSL_1_1_1-stable + ./config --prefix=$LibrariesPath/openssl-cache + make -j$(nproc) + sudo make install + - name: OpenSSL install. + run: | + cd $LibrariesPath + sudo mkdir -p $OPENSSL_PREFIX + sudo cp -R openssl-cache/. $OPENSSL_PREFIX/ + + - name: Libxkbcommon. + run: | + cd $LibrariesPath + + git clone $GIT/xkbcommon/libxkbcommon.git + cd libxkbcommon + git checkout xkbcommon-0.8.4 + ./autogen.sh + make -j$(nproc) + sudo make install + + - name: Qt 5.12.5 cache. + id: cache-qt + uses: actions/cache@v1 + with: + path: ${{ env.LibrariesPath }}/qt-cache + key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_12_5.diff') }} + - name: Qt 5.12.5 build. + if: steps.cache-qt.outputs.cache-hit != 'true' + run: | + cd $LibrariesPath + + git clone git://code.qt.io/qt/qt5.git qt_$QT + cd qt_$QT + perl init-repository --module-subset=qtbase,qtimageformats + git checkout v5.12.5 + git submodule update qtbase + git submodule update qtimageformats + cd qtbase + git apply ../../patches/qtbase_$QT.diff + cd src/plugins/platforminputcontexts + git clone $GIT/desktop-app/fcitx.git + git clone $GIT/desktop-app/hime.git + git clone $GIT/desktop-app/nimf.git + cd ../../../.. + + ./configure -prefix "$LibrariesPath/qt-cache" \ + -release \ + -force-debug-info \ + -opensource \ + -confirm-license \ + -qt-zlib \ + -qt-libpng \ + -qt-libjpeg \ + -qt-harfbuzz \ + -qt-pcre \ + -qt-xcb \ + -system-freetype \ + -fontconfig \ + -no-opengl \ + -no-gtk \ + -static \ + -openssl-linked \ + -I "$OPENSSL_PREFIX/include" OPENSSL_LIBS="$OPENSSL_PREFIX/lib/libssl.a $OPENSSL_PREFIX/lib/libcrypto.a -ldl -lpthread" \ + -nomake examples \ + -nomake tests + + make -j$(nproc) + sudo make install + - name: Qt 5.12.5 install. + run: | + cd $LibrariesPath + sudo mkdir -p $QT_PREFIX + sudo cp -R qt-cache/. $QT_PREFIX/ + + - name: Breakpad cache. + id: cache-breakpad + uses: actions/cache@v1 + with: + path: ${{ env.LibrariesPath }}/breakpad-cache + key: ${{ runner.OS }}-breakpad-${{ env.CACHE_KEY }} + - name: Breakpad clone. + run: | + cd $LibrariesPath + + git clone https://chromium.googlesource.com/breakpad/breakpad + cd breakpad + git checkout bc8fb886 + git clone https://chromium.googlesource.com/linux-syscall-support src/third_party/lss + cd src/third_party/lss + git checkout a91633d1 + - name: Breakpad build. + if: steps.cache-breakpad.outputs.cache-hit != 'true' + run: | + cd $LibrariesPath + + BreakpadCache=$LibrariesPath/breakpad-cache + + git clone https://chromium.googlesource.com/external/gyp + cd gyp + git checkout 9f2a7bb1 + git apply ../patches/gyp.diff + cd .. + + cd breakpad + ./configure --prefix=$BreakpadCache + make -j$(nproc) + sudo make install + cd src + rm -r testing + git clone $GIT/google/googletest testing + cd tools + sed -i 's/minidump_upload.m/minidump_upload.cc/' linux/tools_linux.gypi + ../../../gyp/gyp --depth=. --generator-output=.. -Goutput_dir=../out tools.gyp --format=cmake + cd ../../out/Default + cmake . + make -j$(nproc) dump_syms + + mv dump_syms $BreakpadCache/ + - name: Breakpad install. + run: | + cd $LibrariesPath + sudo cp -R breakpad-cache/. /usr/local/ + mkdir -p breakpad/out/Default/ + cp breakpad-cache/dump_syms breakpad/out/Default/dump_syms + + - name: Telegram Desktop build. + if: env.ONLY_CACHE == 'false' + run: | + cd $REPO_NAME/Telegram + + DEFINE="" + if [ -n "${{ matrix.defines }}" ]; then + DEFINE="-D ${{ matrix.defines }}=ON" + echo Define from matrix: $DEFINE + fi + + ./configure.sh -D TDESKTOP_API_TEST=ON -D DESKTOP_APP_USE_PACKAGED=OFF $DEFINE + + cd ../out/Debug + make -j$(nproc) + strip -s bin/Telegram + + - name: Check. + if: env.ONLY_CACHE == 'false' + run: | + filePath="$REPO_NAME/out/Debug/bin/Telegram" + if test -f "$filePath"; then + echo "Build successfully done! :)" + + size=$(stat -c %s "$filePath") + echo "File size of ${filePath}: ${size} Bytes." + else + echo "Build error, output file does not exist." + exit 1 + fi + + - name: Move artifact. + if: env.UPLOAD_ARTIFACT == 'true' + run: | + cd $REPO_NAME/out/Debug/bin + mkdir artifact + mv Telegram artifact/ + - uses: actions/upload-artifact@master + if: env.UPLOAD_ARTIFACT == 'true' + name: Upload artifact. + with: + name: Telegram + path: ${{ env.REPO_NAME }}/out/Debug/bin/artifact/ diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 3550b814f..9aa29942c 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -32,7 +32,8 @@ jobs: QT_PREFIX: "/usr/local/desktop-app/Qt-5.12.5" LIBICONV_VER: "libiconv-1.15" UPLOAD_ARTIFACT: "false" - MANUAL_CACHING: "1" + ONLY_CACHE: "false" + MANUAL_CACHING: "2" DOC_PATH: "docs/building-xcode.md" steps: - name: Get repository name. @@ -117,8 +118,8 @@ jobs: run: | cd $LibrariesPath - git clone $GIT/openssl/openssl openssl_$OPENSSL_VER - cd openssl_$OPENSSL_VER + git clone $GIT/openssl/openssl openssl + cd openssl git checkout OpenSSL_"$OPENSSL_VER"-stable ./Configure \ --prefix=$PREFIX \ @@ -127,6 +128,15 @@ jobs: $MIN_MAC make build_libs -j$(nproc) + SSL_DIR=$LibrariesPath/openssl_${{ env.OPENSSL_VER }} + mkdir -p $SSL_DIR/include + copyLib() { + cp $1.a $SSL_DIR/$1.a + } + copyLib libssl + copyLib libcrypto + sudo cp -R include/. $SSL_DIR/include/ + - name: Opus cache. id: cache-opus uses: actions/cache@v1 @@ -174,7 +184,7 @@ jobs: id: cache-ffmpeg uses: actions/cache@v1 with: - path: ${{ env.LibrariesPath }}/ffmpeg + path: ${{ env.LibrariesPath }}/ffmpeg-cache key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }} - name: FFmpeg. if: steps.cache-ffmpeg.outputs.cache-hit != 'true' @@ -188,7 +198,7 @@ jobs: LDFLAGS=`freetype-config --libs` PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig - ./configure --prefix=/usr/local \ + ./configure --prefix=$LibrariesPath/ffmpeg-cache \ --extra-cflags="$MIN_MAC $UNGUARDED" \ --extra-cxxflags="$MIN_MAC $UNGUARDED" \ --extra-ldflags="$MIN_MAC" \ @@ -290,10 +300,23 @@ jobs: --enable-muxer=opus make -j$(nproc) + sudo make install - name: FFmpeg install. run: | - cd $LibrariesPath/ffmpeg - sudo make install + cd $LibrariesPath + #List of files from cmake/external/ffmpeg/CMakeLists.txt. + copyLib() { + mkdir -p ffmpeg/$1 + \cp -fR ffmpeg-cache/lib/$1.a ffmpeg/$1/$1.a + } + copyLib libavformat + copyLib libavcodec + copyLib libswresample + copyLib libswscale + copyLib libavutil + + sudo cp -R ffmpeg-cache/. /usr/local/ + sudo cp -R ffmpeg-cache/include/. ffmpeg/ - name: OpenAL Soft. run: | @@ -364,8 +387,8 @@ jobs: cd $LibrariesPath mv qt-cache Qt-5.12.5 sudo mkdir -p $QT_PREFIX - sudo mv -f Qt-5.12.5 /usr/local/desktop-app/ - - name: Build Qt 5.12.5. + sudo mv -f Qt-5.12.5 "$(dirname "$QT_PREFIX")"/ + - name: Qt 5.12.5 build. if: steps.cache-qt.outputs.cache-hit != 'true' run: | cd $LibrariesPath @@ -400,7 +423,8 @@ jobs: make clean cp -r $QT_PREFIX $LibrariesPath/qt-cache - - name: Build Telegram Desktop. + - name: Telegram Desktop build. + if: env.ONLY_CACHE == 'false' run: | cd $REPO_NAME/Telegram diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index 702a3651f..815b9b68c 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -27,7 +27,8 @@ jobs: QT: "5_12_5" OPENSSL_VER: "1_1_1" UPLOAD_ARTIFACT: "false" - MANUAL_CACHING: "1" + ONLY_CACHE: "false" + MANUAL_CACHING: "2" DOC_PATH: "docs/building-msvc.md" steps: - name: Get repository name. @@ -134,6 +135,7 @@ jobs: move ossl_static.pdb out32 rmdir /S /Q test + rmdir /S /Q .git - name: Zlib. shell: cmd @@ -226,6 +228,7 @@ jobs: path: ${{ env.LibrariesPath }}/opus key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }} - name: Opus. + if: steps.cache-opus.outputs.cache-hit != 'true' shell: cmd run: | %VC% @@ -242,7 +245,7 @@ jobs: uses: actions/cache@v1 with: path: ${{ env.LibrariesPath }}/ffmpeg - key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}-${{ hashFiles('**/build_ffmpeg_win.sh') }} + key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}-2-${{ hashFiles('**/build_ffmpeg_win.sh') }} - name: FFmpeg. if: steps.cache-ffmpeg.outputs.cache-hit != 'true' shell: cmd @@ -257,6 +260,8 @@ jobs: set MSYS2_PATH_TYPE=inherit call c:\tools\msys64\usr\bin\bash --login ../../%REPO_NAME%/Telegram/Patches/build_ffmpeg_win.sh + rmdir /S /Q .git + - name: Qt 5.12.5 cache. id: cache-qt uses: actions/cache@v1 @@ -298,7 +303,7 @@ jobs: -nomake examples ^ -nomake tests ^ -platform win32-msvc - - name: Build Qt 5.12.5. + - name: Qt 5.12.5 build. if: steps.cache-qt.outputs.cache-hit != 'true' shell: cmd run: | @@ -321,7 +326,8 @@ jobs: fi echo "::set-env name=TDESKTOP_BUILD_DEFINE::$DEFINE" - - name: Build Telegram Desktop. + - name: Telegram Desktop build. + if: env.ONLY_CACHE == 'false' shell: cmd run: | cd %REPO_NAME%\Telegram @@ -348,4 +354,4 @@ jobs: if: env.UPLOAD_ARTIFACT == 'true' with: name: Telegram - path: ${{ env.REPO_NAME }}\out\Debug\artifact\ \ No newline at end of file + path: ${{ env.REPO_NAME }}\out\Debug\artifact\ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d5b16eaea..000000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -sudo: required -dist: trusty - -language: cpp - -cache: - directories: - - $HOME/travisCacheDir - -env: - matrix: - - BUILD_VERSION="" - - BUILD_VERSION="disable_register_custom_scheme" - - BUILD_VERSION="disable_crash_reports" - - BUILD_VERSION="disable_network_proxy" - - BUILD_VERSION="disable_desktop_file_generation" - - BUILD_VERSION="disable_gtk_integration" - -matrix: - fast_finish: true - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - bison - - build-essential - - cmake - - devscripts - - dpatch - - equivs - - fakeroot - - g++-8 - - gcc-8 - - git - - gnome-common - - gobject-introspection - - gtk-doc-tools - - libappindicator-dev - - libasound2-dev - - libdbusmenu-glib-dev - - liblzma-dev - - libopus-dev - - libpulse-dev - - libenchant-dev - - libssl-dev - - libdee-dev - - libva-dev - - libvdpau-dev - - libxcb-xkb-dev - - libxkbcommon-dev - - libatspi2.0-dev - - lintian - - quilt - - valac - - xutils-dev - - yasm - -before_install: - - export CXX="g++-8" CC="gcc-8" - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-8 - - sudo update-alternatives --config gcc - - g++ --version - -script: - - .travis/build.sh diff --git a/.travis/build.sh b/.travis/build.sh deleted file mode 100755 index 7b9fd4df2..000000000 --- a/.travis/build.sh +++ /dev/null @@ -1,725 +0,0 @@ -#!/bin/bash - -set -e - -REPO="$PWD" - -BUILD="$REPO/build" -UPSTREAM="$REPO/upstream" -EXTERNAL="$REPO/external" -CACHE="$HOME/travisCacheDir" - -QT_WAS_BUILT="0" - -QT_VERSION=5.12.5 - -XKB_PATH="$BUILD/libxkbcommon" -XKB_CACHE_VERSION="3" - -QT_PATH="$BUILD/qt" -QT_CACHE_VERSION="5" -QT_PATCH="$EXTERNAL/patches/qtbase_${QT_VERSION//\./_}.diff" - -BREAKPAD_PATH="$BUILD/breakpad" -BREAKPAD_CACHE_VERSION="3" - -GYP_PATH="$BUILD/gyp" -GYP_CACHE_VERSION="3" -GYP_PATCH="$EXTERNAL/patches/gyp.diff" - -RANGE_PATH="$BUILD/range-v3" -RANGE_CACHE_VERSION="3" - -VA_PATH="$BUILD/libva" -VA_CACHE_VERSION="3" - -VDPAU_PATH="$BUILD/libvdpau" -VDPAU_CACHE_VERSION="3" - -FFMPEG_PATH="$BUILD/ffmpeg" -FFMPEG_CACHE_VERSION="3" - -OPENAL_PATH="$BUILD/openal-soft" -OPENAL_CACHE_VERSION="4" - -GYP_DEFINES="" - -[[ ! $MAKE_ARGS ]] && MAKE_ARGS="--silent -j4" - -run() { - # Move files to subdir - cd .. - mv tdesktop tdesktop2 - mkdir tdesktop - mv tdesktop2 "$UPSTREAM" - - mkdir "$BUILD" - - build - check -} - -build() { - mkdir -p "$EXTERNAL" - - BUILD_VERSION_DATA=$(echo $BUILD_VERSION | cut -d'-' -f 1) - - getPatches - - # libxkbcommon - getXkbCommon - - # libva - getVa - - # libvdpau - getVdpau - - # ffmpeg - getFFmpeg - - # openal_soft - getOpenAL - - # Patched Qt - getCustomQt - - # Breakpad - getBreakpad - - # Patched GYP (supports cmake precompiled headers) - getGYP - - # Range v3 - getRange - - # Guideline Support Library - getGSL - - if [ "$QT_WAS_BUILT" == "1" ]; then - error_msg "Qt was built, please restart the job :(" - exit 1 - fi - - # Configure the build - if [[ $BUILD_VERSION == *"disable_register_custom_scheme"* ]]; then - GYP_DEFINES+=",TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" - fi - - if [[ $BUILD_VERSION == *"disable_crash_reports"* ]]; then - GYP_DEFINES+=",DESKTOP_APP_DISABLE_CRASH_REPORTS" - fi - - if [[ $BUILD_VERSION == *"disable_network_proxy"* ]]; then - GYP_DEFINES+=",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_gtk_integration"* ]]; then - GYP_DEFINES+=",TDESKTOP_DISABLE_GTK_INTEGRATION" - fi - - info_msg "Build defines: ${GYP_DEFINES}" - - buildTelegram - - travisEndFold -} - -getPatches() { - cd "$EXTERNAL" - git clone --depth 1 https://github.com/desktop-app/patches -} - -getXkbCommon() { - travisStartFold "Getting xkbcommon" - - 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" - git checkout xkbcommon-0.8.4 - ./autogen.sh --prefix=$XKB_PATH - make $MAKE_ARGS - sudo make install - 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 --branch 0.10.0 https://github.com/ericniebler/range-v3 - - cd "$EXTERNAL/range-v3" - cp -r * "$RANGE_PATH/" -} - -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 https://github.com/01org/libva - - cd "$EXTERNAL/libva" - ./autogen.sh --prefix=$VA_PATH --enable-static - make $MAKE_ARGS - sudo make install - sudo ldconfig -} - -getVdpau() { - travisStartFold "Getting libvdpau" - - local VDPAU_CACHE="$CACHE/libvdpau" - local VDPAU_CACHE_FILE="$VDPAU_CACHE/.cache.txt" - local VDPAU_CACHE_KEY="${VDPAU_CACHE_VERSION}" - local VDPAU_CACHE_OUTDATED="1" - - if [ ! -d "$VDPAU_CACHE" ]; then - mkdir -p "$VDPAU_CACHE" - fi - - ln -sf "$VDPAU_CACHE" "$VDPAU_PATH" - - if [ -f "$VDPAU_CACHE_FILE" ]; then - local VDPAU_CACHE_KEY_FOUND=`tail -n 1 $VDPAU_CACHE_FILE` - if [ "$VDPAU_CACHE_KEY" == "$VDPAU_CACHE_KEY_FOUND" ]; then - VDPAU_CACHE_OUTDATED="0" - else - info_msg "Cache key '$VDPAU_CACHE_KEY_FOUND' does not match '$VDPAU_CACHE_KEY', rebuilding libvdpau" - fi - fi - if [ "$VDPAU_CACHE_OUTDATED" == "1" ]; then - buildVdpau - sudo echo $VDPAU_CACHE_KEY > "$VDPAU_CACHE_FILE" - else - info_msg "Using cached libvdpau" - fi -} - -buildVdpau() { - info_msg "Downloading and building libvdpau" - - if [ -d "$EXTERNAL/libvdpau" ]; then - rm -rf "$EXTERNAL/libvdpau" - fi - cd $VDPAU_PATH - rm -rf * - - cd "$EXTERNAL" - git clone git://anongit.freedesktop.org/vdpau/libvdpau - - cd "$EXTERNAL/libvdpau" - git checkout libvdpau-1.2 - ./autogen.sh --prefix=$VDPAU_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" - git checkout release/3.4 - - ./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 - sudo rm -rf * - - cd "$EXTERNAL" - git clone https://github.com/kcat/openal-soft.git - cd openal-soft - git checkout openal-soft-1.19.1 - - cd "$EXTERNAL/openal-soft/build" - cmake \ - -D CMAKE_INSTALL_PREFIX=$OPENAL_PATH \ - -D CMAKE_BUILD_TYPE=Release \ - -D LIBTYPE=STATIC \ - -D ALSOFT_EXAMPLES=OFF \ - -D ALSOFT_TESTS=OFF \ - -D ALSOFT_UTILS=OFF \ - .. - make $MAKE_ARGS - sudo make install - sudo ldconfig -} - -getBreakpad() { - travisStartFold "Getting breakpad" - - 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" - - if [ ! -d "$BREAKPAD_CACHE" ]; then - mkdir -p "$BREAKPAD_CACHE" - fi - - 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 - 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" - - if [ -d "$EXTERNAL/breakpad" ]; then - rm -rf "$EXTERNAL/breakpad" - fi - cd $BREAKPAD_PATH - rm -rf * - - cd "$EXTERNAL" - git clone https://chromium.googlesource.com/breakpad/breakpad - - 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" - - 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 - - ln -sf "$QT_CACHE" "$QT_PATH" - - 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 - 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" -} - -buildCustomQt() { - QT_WAS_BUILT="1" - info_msg "Downloading and building patched qt" - - if [ -d "$EXTERNAL/qt_${QT_VERSION}" ]; then - sudo rm -rf "$EXTERNAL/qt_${QT_VERSION}" - fi - cd $QT_PATH - sudo rm -rf * - - cd "$EXTERNAL" - git clone git://code.qt.io/qt/qt5.git qt${QT_VERSION} - - cd "$EXTERNAL/qt${QT_VERSION}" - perl init-repository --branch --module-subset=qtbase,qtimageformats - git checkout v${QT_VERSION} - git submodule update qtbase - git submodule update qtimageformats - - cd "$EXTERNAL/qt${QT_VERSION}/qtbase" - git apply "$QT_PATCH" - cd .. - - cd "$EXTERNAL/qt${QT_VERSION}/qtbase/src/plugins/platforminputcontexts" - git clone https://github.com/telegramdesktop/fcitx.git - git clone https://github.com/telegramdesktop/hime.git - git clone https://github.com/telegramdesktop/nimf.git - cd ../../../.. - - ./configure -prefix $QT_PATH -release -opensource -confirm-license -qt-zlib \ - -qt-libpng -qt-libjpeg -qt-harfbuzz -qt-pcre -qt-xcb \ - -system-freetype -fontconfig -no-opengl -no-gtk -static \ - -nomake examples -nomake tests -no-mirclient \ - -dbus-runtime -no-mtdev # <- Not sure about these - make $MAKE_ARGS - sudo make install -} - -getGSL() { - cd "$UPSTREAM" - git submodule init - git submodule update -} - -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 9f2a7bb1 - git apply "$GYP_PATCH" - cp -r * "$GYP_PATH/" -} - -buildTelegram() { - travisStartFold "Build tdesktop" - - cd "$UPSTREAM/Telegram/gyp" - "$GYP_PATH/gyp" \ - -Dapi_id=17349 \ - -Dapi_hash=344583e45741c457fe1862106095a5eb \ - -Dspecial_build_target= \ - -Dbuild_defines=${GYP_DEFINES:1} \ - -Dlinux_path_xkbcommon=$XKB_PATH \ - -Dlinux_path_va=$VA_PATH \ - -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 \ - -Dlinux_lib_ssl=-lssl \ - -Dlinux_lib_crypto=-lcrypto \ - -Dlinux_lib_icu=-licuuc\ -licutu\ -licui18n \ - --depth=. --generator-output=.. --format=cmake -Goutput_dir=../out \ - Telegram.gyp - cd "$UPSTREAM/out/Debug" - - export ASM="gcc" - cmake . - make $MAKE_ARGS -} - -check() { - local filePath="$UPSTREAM/out/Debug/Telegram" - if test -f "$filePath"; then - success_msg "Build successfully 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 -} - -source ./.travis/common.sh - -run diff --git a/.travis/common.sh b/.travis/common.sh deleted file mode 100755 index 6a79baba0..000000000 --- a/.travis/common.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# set colors -RCol='\e[0m' # Text Reset - -# Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds -Bla='\e[0;30m'; BBla='\e[1;30m'; UBla='\e[4;30m'; IBla='\e[0;90m'; BIBla='\e[1;90m'; On_Bla='\e[40m'; On_IBla='\e[0;100m'; -Red='\e[0;31m'; BRed='\e[1;31m'; URed='\e[4;31m'; IRed='\e[0;91m'; BIRed='\e[1;91m'; On_Red='\e[41m'; On_IRed='\e[0;101m'; -Gre='\e[0;32m'; BGre='\e[1;32m'; UGre='\e[4;32m'; IGre='\e[0;92m'; BIGre='\e[1;92m'; On_Gre='\e[42m'; On_IGre='\e[0;102m'; -Yel='\e[0;33m'; BYel='\e[1;33m'; UYel='\e[4;33m'; IYel='\e[0;93m'; BIYel='\e[1;93m'; On_Yel='\e[43m'; On_IYel='\e[0;103m'; -Blu='\e[0;34m'; BBlu='\e[1;34m'; UBlu='\e[4;34m'; IBlu='\e[0;94m'; BIBlu='\e[1;94m'; On_Blu='\e[44m'; On_IBlu='\e[0;104m'; -Pur='\e[0;35m'; BPur='\e[1;35m'; UPur='\e[4;35m'; IPur='\e[0;95m'; BIPur='\e[1;95m'; On_Pur='\e[45m'; On_IPur='\e[0;105m'; -Cya='\e[0;36m'; BCya='\e[1;36m'; UCya='\e[4;36m'; ICya='\e[0;96m'; BICya='\e[1;96m'; On_Cya='\e[46m'; On_ICya='\e[0;106m'; -Whi='\e[0;37m'; BWhi='\e[1;37m'; UWhi='\e[4;37m'; IWhi='\e[0;97m'; BIWhi='\e[1;97m'; On_Whi='\e[47m'; On_IWhi='\e[0;107m'; - -start_msg() { - echo -e "\n${Gre}$*${RCol}" -} - -info_msg() { - sameLineInfoMessage "\n$1" -} - -error_msg() { - echo -e "\n${BRed}$*${RCol}" -} - -success_msg() { - echo -e "\n${BGre}$*${RCol}" -} - -sameLineInfoMessage() { - echo -e "${Cya}$*${RCol}" -} - -TRAVIS_LAST_FOLD="" - -travisStartFold() { - local TITLE="$1" - local NAME=$(sanitizeName "$TITLE") - - if [ "$TRAVIS_LAST_FOLD" != "" ]; then - travisEndFold - fi - - echo "travis_fold:start:$NAME" - sameLineInfoMessage "$TITLE" - - TRAVIS_LAST_FOLD="$NAME" -} - -travisEndFold() { - if [ "$TRAVIS_LAST_FOLD" == "" ]; then - return - fi - - echo "travis_fold:end:$TRAVIS_LAST_FOLD" - TRAVIS_LAST_FOLD="" -} - -sanitizeName() { - local NAME="${1// /_}" - local NAME="${NAME,,}" - echo "$NAME" -}