"Fossies" - the Fresh Open Source Software Archive

Member "tdesktop-2.6.1/.github/workflows/mac.yml" (24 Feb 2021, 18033 Bytes) of package /linux/misc/tdesktop-2.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "mac.yml": 2.5.1_vs_2.5.6.

    1 name: MacOS.
    2 
    3 on:
    4   push:
    5     paths-ignore:
    6       - 'docs/**'
    7       - '**.md'
    8       - '!docs/building-xcode.md'
    9       - 'changelog.txt'
   10       - 'LEGAL'
   11       - 'LICENSE'
   12       - '.github/**'
   13       - '!.github/workflows/mac.yml'
   14       - 'lib/xdg/**'
   15       - 'snap/**'
   16       - 'Telegram/build/**'
   17       - 'Telegram/Patches/**'
   18       - 'Telegram/Resources/uwp/**'
   19       - 'Telegram/Resources/winrc/**'
   20       - 'Telegram/SourceFiles/platform/win/**'
   21       - 'Telegram/SourceFiles/platform/linux/**'
   22       - 'Telegram/configure.bat'
   23   pull_request:
   24     paths-ignore:
   25       - 'docs/**'
   26       - '**.md'
   27       - '!docs/building-xcode.md'
   28       - 'changelog.txt'
   29       - 'LEGAL'
   30       - 'LICENSE'
   31       - '.github/**'
   32       - '!.github/workflows/mac.yml'
   33       - 'lib/xdg/**'
   34       - 'snap/**'
   35       - 'Telegram/build/**'
   36       - 'Telegram/Patches/**'
   37       - 'Telegram/Resources/uwp/**'
   38       - 'Telegram/Resources/winrc/**'
   39       - 'Telegram/SourceFiles/platform/win/**'
   40       - 'Telegram/SourceFiles/platform/linux/**'
   41       - 'Telegram/configure.bat'
   42 
   43 jobs:
   44 
   45   macos:
   46     name: MacOS
   47     runs-on: macos-latest
   48 
   49     strategy:
   50       matrix:
   51         defines:
   52           - ""
   53     env:
   54       MIN_MAC: "-mmacosx-version-min=10.12"
   55       UNGUARDED: "-Werror=unguarded-availability-new"
   56       GIT: "https://github.com"
   57       PREFIX: "/usr/local/macos"
   58       MACOSX_DEPLOYMENT_TARGET: "10.12"
   59       XZ: "xz-5.2.4"
   60       QT: "5_15_2"
   61       OPENSSL_VER: "1_1_1"
   62       QT_PREFIX: "/usr/local/desktop-app/Qt-5.15.2"
   63       LIBICONV_VER: "libiconv-1.16"
   64       UPLOAD_ARTIFACT: "false"
   65       ONLY_CACHE: "false"
   66       MANUAL_CACHING: "2"
   67       DOC_PATH: "docs/building-xcode.md"
   68       AUTO_CACHING: "1"
   69 
   70     steps:
   71       - name: Get repository name.
   72         run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
   73 
   74       - name: Clone.
   75         uses: actions/checkout@v2
   76         with:
   77           submodules: recursive
   78           path: ${{ env.REPO_NAME }}
   79 
   80       - name: First set up.
   81         run: |
   82           sudo chown -R `whoami`:admin /usr/local/share
   83           brew install automake fdk-aac lame libass libtool libvorbis libvpx \
   84           ninja opus sdl shtool texi2html theora x264 xvid yasm pkg-config
   85 
   86           sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
   87 
   88           xcodebuild -version > CACHE_KEY.txt
   89           echo $MIN_MAC >> CACHE_KEY.txt
   90           echo $PREFIX >> CACHE_KEY.txt
   91           echo $MANUAL_CACHING >> CACHE_KEY.txt
   92           echo "$GITHUB_WORKSPACE" >> CACHE_KEY.txt
   93           if [ "$AUTO_CACHING" == "1" ]; then
   94             thisFile=$REPO_NAME/.github/workflows/mac.yml
   95             echo `md5 -q $thisFile` >> CACHE_KEY.txt
   96           fi
   97           echo "CACHE_KEY=`md5 -q CACHE_KEY.txt`" >> $GITHUB_ENV
   98 
   99           echo "$PWD/Libraries/depot_tools" >> $GITHUB_PATH
  100 
  101           mkdir -p Libraries/macos
  102           cd Libraries/macos
  103           echo "LibrariesPath=`pwd`" >> $GITHUB_ENV
  104 
  105           curl -o tg_owt-version.json https://api.github.com/repos/desktop-app/tg_owt/git/refs/heads/master
  106 
  107       - name: Patches.
  108         run: |
  109           echo "Find necessary commit from doc."
  110           checkoutCommit=$(grep -A 1 "cd patches" $REPO_NAME/$DOC_PATH | sed -n 2p)
  111           cd $LibrariesPath
  112           git clone $GIT/desktop-app/patches.git
  113           cd Patches
  114           eval $checkoutCommit
  115 
  116       - name: XZ.
  117         run: |
  118           cd $LibrariesPath
  119 
  120           wget https://tukaani.org/xz/$XZ.tar.gz
  121           tar -xvzf $XZ.tar.gz
  122           cd $XZ
  123           CFLAGS="$MIN_MAC" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
  124           make -j$(nproc)
  125           sudo make install
  126 
  127       - name: Zlib.
  128         run: |
  129           cd $LibrariesPath
  130 
  131           git clone $GIT/desktop-app/zlib.git
  132           cd zlib
  133           CFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
  134           make -j$(nproc)
  135           sudo make install
  136 
  137       - name: MozJPEG.
  138         run: |
  139           cd $LibrariesPath
  140 
  141           git clone -b v4.0.1-rc2 $GIT/mozilla/mozjpeg.git
  142           cd mozjpeg
  143           cmake -B build . \
  144           -DCMAKE_BUILD_TYPE=Release \
  145           -DCMAKE_INSTALL_PREFIX=/usr/local/macos \
  146           -DWITH_JPEG8=ON \
  147           -DPNG_SUPPORTED=OFF
  148           cmake --build build -j$(nproc)
  149           sudo cmake --install build
  150 
  151       - name: OpenSSL cache.
  152         id: cache-openssl
  153         uses: actions/cache@v2
  154         with:
  155           path: ${{ env.LibrariesPath }}/openssl_${{ env.OPENSSL_VER }}
  156           key: ${{ runner.OS }}-${{ env.OPENSSL_VER }}-${{ env.CACHE_KEY }}
  157       - name: OpenSSL.
  158         if: steps.cache-openssl.outputs.cache-hit != 'true'
  159         run: |
  160           cd $LibrariesPath
  161 
  162           git clone $GIT/openssl/openssl openssl
  163           cd openssl
  164           git checkout OpenSSL_"$OPENSSL_VER"-stable
  165           ./Configure \
  166           --prefix=$PREFIX \
  167           no-tests \
  168           darwin64-x86_64-cc \
  169           -static \
  170           $MIN_MAC
  171           make build_libs -j$(nproc)
  172 
  173           SSL_DIR=$LibrariesPath/openssl_$OPENSSL_VER
  174           mkdir -p $SSL_DIR/include
  175           copyLib() {
  176             cp $1.a $SSL_DIR/$1.a
  177           }
  178           copyLib libssl
  179           copyLib libcrypto
  180           sudo cp -R include/. $SSL_DIR/include/
  181 
  182       - name: Opus cache.
  183         id: cache-opus
  184         uses: actions/cache@v2
  185         with:
  186           path: ${{ env.LibrariesPath }}/opus-cache
  187           key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }}
  188       - name: Opus.
  189         if: steps.cache-opus.outputs.cache-hit != 'true'
  190         run: |
  191           cd $LibrariesPath
  192 
  193           git clone $GIT/xiph/opus
  194           cd opus
  195           git checkout v1.3
  196           ./autogen.sh
  197           CFLAGS="$MIN_MAC $UNGUARDED" CPPFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
  198           make -j$(nproc)
  199           sudo make DESTDIR="$LibrariesPath/opus-cache" install
  200       - name: Opus install.
  201         run: |
  202           cd $LibrariesPath
  203           sudo cp -R opus-cache/. /
  204 
  205       - name: Libiconv cache.
  206         id: cache-libiconv
  207         uses: actions/cache@v2
  208         with:
  209           path: ${{ env.LibrariesPath }}/libiconv-cache
  210           key: ${{ runner.OS }}-${{ env.LIBICONV_VER }}-${{ env.CACHE_KEY }}
  211       - name: Libiconv.
  212         if: steps.cache-libiconv.outputs.cache-hit != 'true'
  213         run: |
  214           cd $LibrariesPath
  215 
  216           wget https://ftp.gnu.org/pub/gnu/libiconv/"$LIBICONV_VER".tar.gz
  217           tar -xvzf "$LIBICONV_VER".tar.gz
  218           cd $LIBICONV_VER
  219           CFLAGS="$MIN_MAC $UNGUARDED" CPPFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --enable-static --prefix=$PREFIX
  220           make -j$(nproc)
  221           sudo make DESTDIR="$LibrariesPath/libiconv-cache" install
  222       - name: Libiconv install.
  223         run: |
  224           cd $LibrariesPath
  225           sudo cp -R libiconv-cache/. /
  226 
  227       - name: FFmpeg cache.
  228         id: cache-ffmpeg
  229         uses: actions/cache@v2
  230         with:
  231           path: ${{ env.LibrariesPath }}/ffmpeg-cache
  232           key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}
  233       - name: FFmpeg.
  234         if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
  235         run: |
  236           cd $LibrariesPath
  237 
  238           git clone $GIT/FFmpeg/FFmpeg.git ffmpeg
  239           cd ffmpeg
  240           git checkout release/4.2
  241           CFLAGS=`freetype-config --cflags`
  242           LDFLAGS=`freetype-config --libs`
  243           PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
  244 
  245           ./configure --prefix=$LibrariesPath/ffmpeg-cache \
  246           --extra-cflags="$MIN_MAC $UNGUARDED" \
  247           --extra-cxxflags="$MIN_MAC $UNGUARDED" \
  248           --extra-ldflags="$MIN_MAC" \
  249           --x86asmexe=`pwd`/macos_yasm_wrap.sh \
  250           --enable-protocol=file \
  251           --enable-libopus \
  252           --disable-programs \
  253           --disable-doc \
  254           --disable-network \
  255           --disable-everything \
  256           --enable-hwaccel=h264_videotoolbox \
  257           --enable-hwaccel=hevc_videotoolbox \
  258           --enable-hwaccel=mpeg1_videotoolbox \
  259           --enable-hwaccel=mpeg2_videotoolbox \
  260           --enable-hwaccel=mpeg4_videotoolbox \
  261           --enable-decoder=aac \
  262           --enable-decoder=aac_at \
  263           --enable-decoder=aac_fixed \
  264           --enable-decoder=aac_latm \
  265           --enable-decoder=aasc \
  266           --enable-decoder=alac \
  267           --enable-decoder=alac_at \
  268           --enable-decoder=flac \
  269           --enable-decoder=gif \
  270           --enable-decoder=h264 \
  271           --enable-decoder=hevc \
  272           --enable-decoder=mp1 \
  273           --enable-decoder=mp1float \
  274           --enable-decoder=mp2 \
  275           --enable-decoder=mp2float \
  276           --enable-decoder=mp3 \
  277           --enable-decoder=mp3adu \
  278           --enable-decoder=mp3adufloat \
  279           --enable-decoder=mp3float \
  280           --enable-decoder=mp3on4 \
  281           --enable-decoder=mp3on4float \
  282           --enable-decoder=mpeg4 \
  283           --enable-decoder=msmpeg4v2 \
  284           --enable-decoder=msmpeg4v3 \
  285           --enable-decoder=opus \
  286           --enable-decoder=pcm_alaw \
  287           --enable-decoder=pcm_alaw_at \
  288           --enable-decoder=pcm_f32be \
  289           --enable-decoder=pcm_f32le \
  290           --enable-decoder=pcm_f64be \
  291           --enable-decoder=pcm_f64le \
  292           --enable-decoder=pcm_lxf \
  293           --enable-decoder=pcm_mulaw \
  294           --enable-decoder=pcm_mulaw_at \
  295           --enable-decoder=pcm_s16be \
  296           --enable-decoder=pcm_s16be_planar \
  297           --enable-decoder=pcm_s16le \
  298           --enable-decoder=pcm_s16le_planar \
  299           --enable-decoder=pcm_s24be \
  300           --enable-decoder=pcm_s24daud \
  301           --enable-decoder=pcm_s24le \
  302           --enable-decoder=pcm_s24le_planar \
  303           --enable-decoder=pcm_s32be \
  304           --enable-decoder=pcm_s32le \
  305           --enable-decoder=pcm_s32le_planar \
  306           --enable-decoder=pcm_s64be \
  307           --enable-decoder=pcm_s64le \
  308           --enable-decoder=pcm_s8 \
  309           --enable-decoder=pcm_s8_planar \
  310           --enable-decoder=pcm_u16be \
  311           --enable-decoder=pcm_u16le \
  312           --enable-decoder=pcm_u24be \
  313           --enable-decoder=pcm_u24le \
  314           --enable-decoder=pcm_u32be \
  315           --enable-decoder=pcm_u32le \
  316           --enable-decoder=pcm_u8 \
  317           --enable-decoder=pcm_zork \
  318           --enable-decoder=vorbis \
  319           --enable-decoder=wavpack \
  320           --enable-decoder=wmalossless \
  321           --enable-decoder=wmapro \
  322           --enable-decoder=wmav1 \
  323           --enable-decoder=wmav2 \
  324           --enable-decoder=wmavoice \
  325           --enable-encoder=libopus \
  326           --enable-parser=aac \
  327           --enable-parser=aac_latm \
  328           --enable-parser=flac \
  329           --enable-parser=h264 \
  330           --enable-parser=hevc \
  331           --enable-parser=mpeg4video \
  332           --enable-parser=mpegaudio \
  333           --enable-parser=opus \
  334           --enable-parser=vorbis \
  335           --enable-demuxer=aac \
  336           --enable-demuxer=flac \
  337           --enable-demuxer=gif \
  338           --enable-demuxer=h264 \
  339           --enable-demuxer=hevc \
  340           --enable-demuxer=m4v \
  341           --enable-demuxer=mov \
  342           --enable-demuxer=mp3 \
  343           --enable-demuxer=ogg \
  344           --enable-demuxer=wav \
  345           --enable-muxer=ogg \
  346           --enable-muxer=opus
  347 
  348           make -j$(nproc)
  349           sudo make install
  350       - name: FFmpeg install.
  351         run: |
  352           cd $LibrariesPath
  353           #List of files from cmake/external/ffmpeg/CMakeLists.txt.
  354           copyLib() {
  355             mkdir -p ffmpeg/$1
  356             \cp -fR ffmpeg-cache/lib/$1.a ffmpeg/$1/$1.a
  357           }
  358           copyLib libavformat
  359           copyLib libavcodec
  360           copyLib libswresample
  361           copyLib libswscale
  362           copyLib libavutil
  363 
  364           sudo cp -R ffmpeg-cache/. /usr/local/
  365           sudo cp -R ffmpeg-cache/include/. ffmpeg/
  366 
  367       - name: OpenAL Soft.
  368         run: |
  369           cd $LibrariesPath
  370 
  371           git clone $GIT/kcat/openal-soft.git
  372           cd openal-soft
  373           git checkout 3970252da9
  374           cd build
  375 
  376           CFLAGS="$UNGUARDED" CPPFLAGS="$UNGUARDED" cmake \
  377           -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \
  378           -D ALSOFT_EXAMPLES=OFF \
  379           -D LIBTYPE:STRING=STATIC \
  380           -D CMAKE_OSX_DEPLOYMENT_TARGET:STRING=$MACOSX_DEPLOYMENT_TARGET ..
  381 
  382           make -j$(nproc)
  383           sudo make install
  384 
  385       - name: Crashpad cache.
  386         id: cache-crashpad
  387         uses: actions/cache@v2
  388         with:
  389           path: ${{ env.LibrariesPath }}/crashpad
  390           key: ${{ runner.OS }}-crashpad-${{ env.CACHE_KEY }}-${{ hashFiles('**/crashpad.diff') }}-${{ hashFiles('**/mini_chromium.diff') }}
  391       - name: Crashpad.
  392         if: steps.cache-crashpad.outputs.cache-hit != 'true'
  393         run: |
  394           cd Libraries
  395           echo Install GYP for Crashpad.
  396           git clone https://chromium.googlesource.com/external/gyp
  397           git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  398           cd gyp
  399           git checkout 9f2a7bb1
  400           git apply $LibrariesPath/patches/gyp.diff
  401           ./setup.py build
  402           sudo ./setup.py install
  403 
  404           cd $LibrariesPath
  405 
  406           git clone https://chromium.googlesource.com/crashpad/crashpad.git
  407           cd crashpad
  408           git checkout feb3aa3923
  409           git apply ../patches/crashpad.diff
  410           cd third_party/mini_chromium
  411           git clone https://chromium.googlesource.com/chromium/mini_chromium
  412           cd mini_chromium
  413           git checkout 7c5b0c1ab4
  414           git apply ../../../../patches/mini_chromium.diff
  415           cd ../../gtest
  416           git clone https://chromium.googlesource.com/external/github.com/google/googletest gtest
  417           cd gtest
  418           git checkout d62d6c6556
  419           cd ../../..
  420 
  421           build/gyp_crashpad.py -Dmac_deployment_target=10.10
  422           ninja -C out/Debug
  423 
  424       - name: Qt 5.15.2 cache.
  425         id: cache-qt
  426         uses: actions/cache@v2
  427         with:
  428           path: ${{ env.LibrariesPath }}/qt-cache
  429           key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_15_2/*') }}
  430       - name: Use cached Qt 5.15.2.
  431         if: steps.cache-qt.outputs.cache-hit == 'true'
  432         run: |
  433           cd $LibrariesPath
  434           mv qt-cache Qt-5.15.2
  435           sudo mkdir -p $QT_PREFIX
  436           sudo mv -f Qt-5.15.2 "$(dirname "$QT_PREFIX")"/
  437       - name: Qt 5.15.2 build.
  438         if: steps.cache-qt.outputs.cache-hit != 'true'
  439         run: |
  440           cd $LibrariesPath
  441 
  442           git clone git://code.qt.io/qt/qt5.git qt_$QT
  443           cd qt_$QT
  444           perl init-repository --module-subset=qtbase,qtimageformats
  445           git checkout v5.15.2
  446           git submodule update qtbase
  447           git submodule update qtimageformats
  448           cd qtbase
  449           find ../../patches/qtbase_$QT -type f -print0 | sort -z | xargs -0 git apply
  450           cd ..
  451 
  452           ./configure \
  453           -prefix "$QT_PREFIX" \
  454           -debug \
  455           -force-debug-info \
  456           -opensource \
  457           -confirm-license \
  458           -static \
  459           -opengl desktop \
  460           -no-openssl \
  461           -securetransport \
  462           -nomake examples \
  463           -nomake tests \
  464           -platform macx-clang \
  465           -I "/usr/local/macos/include" \
  466           LIBJPEG_LIBS="/usr/local/macos/lib/libjpeg.a" \
  467           ZLIB_LIBS="/usr/local/macos/lib/libz.a"
  468 
  469           make -j$(nproc)
  470           sudo make install
  471 
  472           make clean
  473           cp -r $QT_PREFIX $LibrariesPath/qt-cache
  474 
  475       - name: WebRTC cache.
  476         id: cache-webrtc
  477         uses: actions/cache@v2
  478         with:
  479           path: ${{ env.LibrariesPath }}/tg_owt
  480           key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }}-${{ hashFiles('**/tg_owt-version.json') }}
  481       - name: WebRTC.
  482         if: steps.cache-webrtc.outputs.cache-hit != 'true'
  483         run: |
  484           cd $LibrariesPath
  485 
  486           git clone --recursive $GIT/desktop-app/tg_owt.git
  487           mkdir -p tg_owt/out/Debug
  488           cd tg_owt/out/Debug
  489           cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug \
  490           -DTG_OWT_SPECIAL_TARGET=mac \
  491           -DTG_OWT_LIBJPEG_INCLUDE_PATH=/usr/local/macos/include \
  492           -DTG_OWT_OPENSSL_INCLUDE_PATH=`pwd`/../../../openssl_$OPENSSL_VER/include \
  493           -DTG_OWT_OPUS_INCLUDE_PATH=$PREFIX/include/opus \
  494           -DTG_OWT_FFMPEG_INCLUDE_PATH=/usr/local/include \
  495           ../..
  496           ninja
  497 
  498           # Cleanup.
  499           cd $LibrariesPath/tg_owt
  500           mv out/Debug/libtg_owt.a libtg_owt.a
  501           rm -rf out
  502           mkdir -p out/Debug
  503           mv libtg_owt.a out/Debug/libtg_owt.a
  504 
  505       - name: Telegram Desktop build.
  506         if: env.ONLY_CACHE == 'false'
  507         run: |
  508           cd $REPO_NAME/Telegram
  509 
  510           DEFINE=""
  511           if [ -n "${{ matrix.defines }}" ]; then
  512             DEFINE="-D ${{ matrix.defines }}=ON"
  513             echo Define from matrix: $DEFINE
  514             echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV
  515           else
  516             echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
  517           fi
  518 
  519           ./configure.sh \
  520           -D CMAKE_C_FLAGS="-Werror" \
  521           -D CMAKE_CXX_FLAGS="-Werror" \
  522           -D TDESKTOP_API_TEST=ON \
  523           -D DESKTOP_APP_USE_PACKAGED=OFF \
  524           -D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
  525           $DEFINE
  526 
  527           cd ../out
  528 
  529           xcoderun='xcodebuild build -project Telegram.xcodeproj -scheme Telegram -destination "platform=macOS,arch=x86_64" -configuration Debug'
  530           bash -c "$xcoderun" || bash -c "$xcoderun" || bash -c "$xcoderun"
  531 
  532       - name: Move artifact.
  533         if: env.UPLOAD_ARTIFACT == 'true'
  534         run: |
  535           cd $REPO_NAME/out/Debug
  536           mkdir artifact
  537           mv Telegram.app artifact/
  538           mv Updater artifact/
  539       - uses: actions/upload-artifact@master
  540         if: env.UPLOAD_ARTIFACT == 'true'
  541         name: Upload artifact.
  542         with:
  543           name: ${{ env.ARTIFACT_NAME }}
  544           path: ${{ env.REPO_NAME }}/out/Debug/artifact/