2019-09-06 05:24:37 +00:00
|
|
|
name: MacOS.
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-04-12 05:17:44 +00:00
|
|
|
- '**.md'
|
2020-05-02 14:53:16 +00:00
|
|
|
- '!docs/building-xcode.md'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'changelog.txt'
|
|
|
|
- 'LEGAL'
|
|
|
|
- 'LICENSE'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/mac.yml'
|
|
|
|
- 'lib/xdg/**'
|
|
|
|
- 'snap/**'
|
|
|
|
- 'Telegram/build/**'
|
|
|
|
- 'Telegram/Patches/**'
|
|
|
|
- 'Telegram/Resources/uwp/**'
|
|
|
|
- 'Telegram/Resources/winrc/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/win/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/linux/**'
|
|
|
|
- 'Telegram/configure.bat'
|
2019-09-06 05:24:37 +00:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-04-12 05:17:44 +00:00
|
|
|
- '**.md'
|
2020-05-02 14:53:16 +00:00
|
|
|
- '!docs/building-xcode.md'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'changelog.txt'
|
|
|
|
- 'LEGAL'
|
|
|
|
- 'LICENSE'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/mac.yml'
|
|
|
|
- 'lib/xdg/**'
|
|
|
|
- 'snap/**'
|
|
|
|
- 'Telegram/build/**'
|
|
|
|
- 'Telegram/Patches/**'
|
|
|
|
- 'Telegram/Resources/uwp/**'
|
|
|
|
- 'Telegram/Resources/winrc/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/win/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/linux/**'
|
|
|
|
- 'Telegram/configure.bat'
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
macos:
|
|
|
|
name: MacOS
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
defines:
|
|
|
|
- ""
|
|
|
|
env:
|
|
|
|
MIN_MAC: "-mmacosx-version-min=10.12"
|
|
|
|
UNGUARDED: "-Werror=unguarded-availability-new"
|
|
|
|
GIT: "https://github.com"
|
|
|
|
PREFIX: "/usr/local/macos"
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: "10.12"
|
2020-02-25 13:56:11 +00:00
|
|
|
XZ: "xz-5.2.4"
|
2020-12-09 13:26:25 +00:00
|
|
|
QT: "5_15_2"
|
2019-09-06 05:24:37 +00:00
|
|
|
OPENSSL_VER: "1_1_1"
|
2020-12-09 13:26:25 +00:00
|
|
|
QT_PREFIX: "/usr/local/desktop-app/Qt-5.15.2"
|
2020-02-25 13:56:11 +00:00
|
|
|
LIBICONV_VER: "libiconv-1.16"
|
2019-09-06 05:24:37 +00:00
|
|
|
UPLOAD_ARTIFACT: "false"
|
2020-01-24 13:17:35 +00:00
|
|
|
ONLY_CACHE: "false"
|
|
|
|
MANUAL_CACHING: "2"
|
2019-09-06 05:24:37 +00:00
|
|
|
DOC_PATH: "docs/building-xcode.md"
|
2020-02-24 13:51:53 +00:00
|
|
|
AUTO_CACHING: "1"
|
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
steps:
|
|
|
|
- name: Get repository name.
|
2020-10-25 01:46:27 +00:00
|
|
|
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: Clone.
|
2020-03-20 16:32:06 +00:00
|
|
|
uses: actions/checkout@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-03-20 16:32:06 +00:00
|
|
|
path: ${{ env.REPO_NAME }}
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: First set up.
|
|
|
|
run: |
|
2020-08-11 12:45:30 +00:00
|
|
|
sudo chown -R `whoami`:admin /usr/local/share
|
2019-09-06 05:24:37 +00:00
|
|
|
brew install automake fdk-aac lame libass libtool libvorbis libvpx \
|
|
|
|
ninja opus sdl shtool texi2html theora x264 xvid yasm pkg-config
|
|
|
|
|
|
|
|
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
|
|
|
|
|
|
|
xcodebuild -version > CACHE_KEY.txt
|
|
|
|
echo $MIN_MAC >> CACHE_KEY.txt
|
|
|
|
echo $PREFIX >> CACHE_KEY.txt
|
|
|
|
echo $MANUAL_CACHING >> CACHE_KEY.txt
|
2020-05-30 09:11:40 +00:00
|
|
|
echo "$GITHUB_WORKSPACE" >> CACHE_KEY.txt
|
2020-02-24 13:51:53 +00:00
|
|
|
if [ "$AUTO_CACHING" == "1" ]; then
|
|
|
|
thisFile=$REPO_NAME/.github/workflows/mac.yml
|
|
|
|
echo `md5 -q $thisFile` >> CACHE_KEY.txt
|
|
|
|
fi
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "CACHE_KEY=`md5 -q CACHE_KEY.txt`" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "$PWD/Libraries/depot_tools" >> $GITHUB_PATH
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
mkdir -p Libraries/macos
|
|
|
|
cd Libraries/macos
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "LibrariesPath=`pwd`" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2021-01-05 08:42:58 +00:00
|
|
|
curl -o tg_owt-version.json https://api.github.com/repos/desktop-app/tg_owt/git/refs/heads/master
|
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
- 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: XZ.
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
|
|
|
wget https://tukaani.org/xz/$XZ.tar.gz
|
|
|
|
tar -xvzf $XZ.tar.gz
|
|
|
|
cd $XZ
|
|
|
|
CFLAGS="$MIN_MAC" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
- name: Zlib.
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
|
|
|
git clone $GIT/desktop-app/zlib.git
|
|
|
|
cd zlib
|
2020-01-19 14:16:10 +00:00
|
|
|
CFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
2019-09-06 05:24:37 +00:00
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
|
2020-10-07 02:21:20 +00:00
|
|
|
- name: MozJPEG.
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
|
|
|
git clone -b v4.0.1-rc2 $GIT/mozilla/mozjpeg.git
|
|
|
|
cd mozjpeg
|
|
|
|
cmake -B build . \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr/local/macos \
|
|
|
|
-DWITH_JPEG8=ON \
|
|
|
|
-DPNG_SUPPORTED=OFF
|
|
|
|
cmake --build build -j$(nproc)
|
|
|
|
sudo cmake --install build
|
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
- name: OpenSSL cache.
|
|
|
|
id: cache-openssl
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
|
|
|
path: ${{ env.LibrariesPath }}/openssl_${{ env.OPENSSL_VER }}
|
|
|
|
key: ${{ runner.OS }}-${{ env.OPENSSL_VER }}-${{ env.CACHE_KEY }}
|
|
|
|
- name: OpenSSL.
|
|
|
|
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
2020-01-24 13:17:35 +00:00
|
|
|
git clone $GIT/openssl/openssl openssl
|
|
|
|
cd openssl
|
2019-09-06 05:24:37 +00:00
|
|
|
git checkout OpenSSL_"$OPENSSL_VER"-stable
|
|
|
|
./Configure \
|
|
|
|
--prefix=$PREFIX \
|
2020-07-12 19:35:19 +00:00
|
|
|
no-tests \
|
2019-09-06 05:24:37 +00:00
|
|
|
darwin64-x86_64-cc \
|
|
|
|
-static \
|
|
|
|
$MIN_MAC
|
|
|
|
make build_libs -j$(nproc)
|
|
|
|
|
2020-08-20 19:19:53 +00:00
|
|
|
SSL_DIR=$LibrariesPath/openssl_$OPENSSL_VER
|
2020-01-24 13:17:35 +00:00
|
|
|
mkdir -p $SSL_DIR/include
|
|
|
|
copyLib() {
|
|
|
|
cp $1.a $SSL_DIR/$1.a
|
|
|
|
}
|
|
|
|
copyLib libssl
|
|
|
|
copyLib libcrypto
|
|
|
|
sudo cp -R include/. $SSL_DIR/include/
|
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
- name: Opus cache.
|
|
|
|
id: cache-opus
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
2020-09-03 11:17:39 +00:00
|
|
|
path: ${{ env.LibrariesPath }}/opus-cache
|
2019-09-06 05:24:37 +00:00
|
|
|
key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }}
|
2020-10-23 09:49:31 +00:00
|
|
|
- name: Opus.
|
2019-09-06 05:24:37 +00:00
|
|
|
if: steps.cache-opus.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
2020-10-23 09:49:31 +00:00
|
|
|
git clone $GIT/xiph/opus
|
2019-09-06 05:24:37 +00:00
|
|
|
cd opus
|
2020-10-23 09:49:31 +00:00
|
|
|
git checkout v1.3
|
2019-09-06 05:24:37 +00:00
|
|
|
./autogen.sh
|
|
|
|
CFLAGS="$MIN_MAC $UNGUARDED" CPPFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
|
|
|
make -j$(nproc)
|
2020-09-03 11:17:39 +00:00
|
|
|
sudo make DESTDIR="$LibrariesPath/opus-cache" install
|
2019-09-06 05:24:37 +00:00
|
|
|
- name: Opus install.
|
|
|
|
run: |
|
2020-09-03 11:17:39 +00:00
|
|
|
cd $LibrariesPath
|
|
|
|
sudo cp -R opus-cache/. /
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: Libiconv cache.
|
|
|
|
id: cache-libiconv
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
2020-09-03 11:17:39 +00:00
|
|
|
path: ${{ env.LibrariesPath }}/libiconv-cache
|
2019-09-06 05:24:37 +00:00
|
|
|
key: ${{ runner.OS }}-${{ env.LIBICONV_VER }}-${{ env.CACHE_KEY }}
|
|
|
|
- name: Libiconv.
|
|
|
|
if: steps.cache-libiconv.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
|
|
|
wget https://ftp.gnu.org/pub/gnu/libiconv/"$LIBICONV_VER".tar.gz
|
|
|
|
tar -xvzf "$LIBICONV_VER".tar.gz
|
|
|
|
cd $LIBICONV_VER
|
|
|
|
CFLAGS="$MIN_MAC $UNGUARDED" CPPFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --enable-static --prefix=$PREFIX
|
|
|
|
make -j$(nproc)
|
2020-09-03 11:17:39 +00:00
|
|
|
sudo make DESTDIR="$LibrariesPath/libiconv-cache" install
|
2019-09-06 05:24:37 +00:00
|
|
|
- name: Libiconv install.
|
|
|
|
run: |
|
2020-09-03 11:17:39 +00:00
|
|
|
cd $LibrariesPath
|
|
|
|
sudo cp -R libiconv-cache/. /
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: FFmpeg cache.
|
|
|
|
id: cache-ffmpeg
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
2020-01-24 13:17:35 +00:00
|
|
|
path: ${{ env.LibrariesPath }}/ffmpeg-cache
|
2019-09-06 05:24:37 +00:00
|
|
|
key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}
|
|
|
|
- name: FFmpeg.
|
|
|
|
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
|
|
|
git clone $GIT/FFmpeg/FFmpeg.git ffmpeg
|
|
|
|
cd ffmpeg
|
2020-11-09 19:44:11 +00:00
|
|
|
git checkout release/4.2
|
2019-09-06 05:24:37 +00:00
|
|
|
CFLAGS=`freetype-config --cflags`
|
|
|
|
LDFLAGS=`freetype-config --libs`
|
|
|
|
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
|
|
|
|
|
2020-01-24 13:17:35 +00:00
|
|
|
./configure --prefix=$LibrariesPath/ffmpeg-cache \
|
2019-09-06 05:24:37 +00:00
|
|
|
--extra-cflags="$MIN_MAC $UNGUARDED" \
|
|
|
|
--extra-cxxflags="$MIN_MAC $UNGUARDED" \
|
|
|
|
--extra-ldflags="$MIN_MAC" \
|
2020-11-09 19:44:11 +00:00
|
|
|
--x86asmexe=`pwd`/macos_yasm_wrap.sh \
|
|
|
|
--enable-protocol=file \
|
|
|
|
--enable-libopus \
|
2019-09-06 05:24:37 +00:00
|
|
|
--disable-programs \
|
|
|
|
--disable-doc \
|
|
|
|
--disable-network \
|
|
|
|
--disable-everything \
|
|
|
|
--enable-hwaccel=h264_videotoolbox \
|
|
|
|
--enable-hwaccel=hevc_videotoolbox \
|
|
|
|
--enable-hwaccel=mpeg1_videotoolbox \
|
|
|
|
--enable-hwaccel=mpeg2_videotoolbox \
|
|
|
|
--enable-hwaccel=mpeg4_videotoolbox \
|
|
|
|
--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=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=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)
|
2020-01-24 13:17:35 +00:00
|
|
|
sudo make install
|
2019-09-06 05:24:37 +00:00
|
|
|
- name: FFmpeg install.
|
|
|
|
run: |
|
2020-01-24 13:17:35 +00:00
|
|
|
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/
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: OpenAL Soft.
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
2020-11-30 19:40:13 +00:00
|
|
|
git clone $GIT/kcat/openal-soft.git
|
2019-09-06 05:24:37 +00:00
|
|
|
cd openal-soft
|
2020-11-30 19:40:13 +00:00
|
|
|
git checkout 3970252da9
|
2019-09-06 05:24:37 +00:00
|
|
|
cd build
|
|
|
|
|
|
|
|
CFLAGS="$UNGUARDED" CPPFLAGS="$UNGUARDED" cmake \
|
|
|
|
-D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \
|
|
|
|
-D ALSOFT_EXAMPLES=OFF \
|
|
|
|
-D LIBTYPE:STRING=STATIC \
|
|
|
|
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING=$MACOSX_DEPLOYMENT_TARGET ..
|
|
|
|
|
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
- name: Crashpad cache.
|
|
|
|
id: cache-crashpad
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
|
|
|
path: ${{ env.LibrariesPath }}/crashpad
|
|
|
|
key: ${{ runner.OS }}-crashpad-${{ env.CACHE_KEY }}-${{ hashFiles('**/crashpad.diff') }}-${{ hashFiles('**/mini_chromium.diff') }}
|
|
|
|
- name: Crashpad.
|
|
|
|
if: steps.cache-crashpad.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd Libraries
|
|
|
|
echo Install GYP for Crashpad.
|
|
|
|
git clone https://chromium.googlesource.com/external/gyp
|
|
|
|
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
|
|
cd gyp
|
|
|
|
git checkout 9f2a7bb1
|
|
|
|
git apply $LibrariesPath/patches/gyp.diff
|
|
|
|
./setup.py build
|
|
|
|
sudo ./setup.py install
|
|
|
|
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
|
|
|
git clone https://chromium.googlesource.com/crashpad/crashpad.git
|
|
|
|
cd crashpad
|
|
|
|
git checkout feb3aa3923
|
|
|
|
git apply ../patches/crashpad.diff
|
|
|
|
cd third_party/mini_chromium
|
|
|
|
git clone https://chromium.googlesource.com/chromium/mini_chromium
|
|
|
|
cd mini_chromium
|
|
|
|
git checkout 7c5b0c1ab4
|
|
|
|
git apply ../../../../patches/mini_chromium.diff
|
|
|
|
cd ../../gtest
|
|
|
|
git clone https://chromium.googlesource.com/external/github.com/google/googletest gtest
|
|
|
|
cd gtest
|
|
|
|
git checkout d62d6c6556
|
|
|
|
cd ../../..
|
|
|
|
|
|
|
|
build/gyp_crashpad.py -Dmac_deployment_target=10.10
|
|
|
|
ninja -C out/Debug
|
|
|
|
|
2020-12-09 13:26:25 +00:00
|
|
|
- name: Qt 5.15.2 cache.
|
2019-09-06 05:24:37 +00:00
|
|
|
id: cache-qt
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
|
|
|
path: ${{ env.LibrariesPath }}/qt-cache
|
2020-12-09 13:26:25 +00:00
|
|
|
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_15_2/*') }}
|
|
|
|
- name: Use cached Qt 5.15.2.
|
2019-09-06 05:24:37 +00:00
|
|
|
if: steps.cache-qt.outputs.cache-hit == 'true'
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
2020-12-09 13:26:25 +00:00
|
|
|
mv qt-cache Qt-5.15.2
|
2019-09-06 05:24:37 +00:00
|
|
|
sudo mkdir -p $QT_PREFIX
|
2020-12-09 13:26:25 +00:00
|
|
|
sudo mv -f Qt-5.15.2 "$(dirname "$QT_PREFIX")"/
|
|
|
|
- name: Qt 5.15.2 build.
|
2019-09-06 05:24:37 +00:00
|
|
|
if: steps.cache-qt.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
2020-08-14 06:45:41 +00:00
|
|
|
git clone git://code.qt.io/qt/qt5.git qt_$QT
|
|
|
|
cd qt_$QT
|
2019-09-06 05:24:37 +00:00
|
|
|
perl init-repository --module-subset=qtbase,qtimageformats
|
2020-12-09 13:26:25 +00:00
|
|
|
git checkout v5.15.2
|
2019-09-06 05:24:37 +00:00
|
|
|
git submodule update qtbase
|
|
|
|
git submodule update qtimageformats
|
|
|
|
cd qtbase
|
2020-06-02 10:14:51 +00:00
|
|
|
find ../../patches/qtbase_$QT -type f -print0 | sort -z | xargs -0 git apply
|
2019-09-06 05:24:37 +00:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
./configure \
|
|
|
|
-prefix "$QT_PREFIX" \
|
|
|
|
-debug \
|
|
|
|
-force-debug-info \
|
|
|
|
-opensource \
|
|
|
|
-confirm-license \
|
|
|
|
-static \
|
|
|
|
-opengl desktop \
|
|
|
|
-no-openssl \
|
|
|
|
-securetransport \
|
|
|
|
-nomake examples \
|
|
|
|
-nomake tests \
|
2020-10-07 02:21:20 +00:00
|
|
|
-platform macx-clang \
|
|
|
|
-I "/usr/local/macos/include" \
|
|
|
|
LIBJPEG_LIBS="/usr/local/macos/lib/libjpeg.a" \
|
|
|
|
ZLIB_LIBS="/usr/local/macos/lib/libz.a"
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
make clean
|
|
|
|
cp -r $QT_PREFIX $LibrariesPath/qt-cache
|
|
|
|
|
2020-08-14 06:45:41 +00:00
|
|
|
- name: WebRTC cache.
|
|
|
|
id: cache-webrtc
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2020-08-20 19:19:53 +00:00
|
|
|
path: ${{ env.LibrariesPath }}/tg_owt
|
2021-01-05 08:42:58 +00:00
|
|
|
key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }}-${{ hashFiles('**/tg_owt-version.json') }}
|
2020-08-14 06:45:41 +00:00
|
|
|
- name: WebRTC.
|
|
|
|
if: steps.cache-webrtc.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd $LibrariesPath
|
|
|
|
|
2020-11-30 19:40:13 +00:00
|
|
|
git clone --recursive $GIT/desktop-app/tg_owt.git
|
2020-08-20 19:19:53 +00:00
|
|
|
mkdir -p tg_owt/out/Debug
|
|
|
|
cd tg_owt/out/Debug
|
|
|
|
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug \
|
|
|
|
-DTG_OWT_SPECIAL_TARGET=mac \
|
2020-10-07 02:21:20 +00:00
|
|
|
-DTG_OWT_LIBJPEG_INCLUDE_PATH=/usr/local/macos/include \
|
2020-08-20 19:19:53 +00:00
|
|
|
-DTG_OWT_OPENSSL_INCLUDE_PATH=`pwd`/../../../openssl_$OPENSSL_VER/include \
|
|
|
|
-DTG_OWT_OPUS_INCLUDE_PATH=$PREFIX/include/opus \
|
|
|
|
-DTG_OWT_FFMPEG_INCLUDE_PATH=/usr/local/include \
|
|
|
|
../..
|
|
|
|
ninja
|
|
|
|
|
|
|
|
# Cleanup.
|
|
|
|
cd $LibrariesPath/tg_owt
|
|
|
|
mv out/Debug/libtg_owt.a libtg_owt.a
|
|
|
|
rm -rf out
|
|
|
|
mkdir -p out/Debug
|
|
|
|
mv libtg_owt.a out/Debug/libtg_owt.a
|
2020-08-14 06:45:41 +00:00
|
|
|
|
2020-01-24 13:17:35 +00:00
|
|
|
- name: Telegram Desktop build.
|
|
|
|
if: env.ONLY_CACHE == 'false'
|
2019-09-06 05:24:37 +00:00
|
|
|
run: |
|
|
|
|
cd $REPO_NAME/Telegram
|
|
|
|
|
|
|
|
DEFINE=""
|
|
|
|
if [ -n "${{ matrix.defines }}" ]; then
|
|
|
|
DEFINE="-D ${{ matrix.defines }}=ON"
|
|
|
|
echo Define from matrix: $DEFINE
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV
|
2020-04-12 19:04:47 +00:00
|
|
|
else
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
fi
|
|
|
|
|
2020-08-10 14:10:42 +00:00
|
|
|
./configure.sh \
|
2020-11-17 10:05:26 +00:00
|
|
|
-D CMAKE_C_FLAGS="-Werror" \
|
|
|
|
-D CMAKE_CXX_FLAGS="-Werror" \
|
2020-08-10 14:10:42 +00:00
|
|
|
-D TDESKTOP_API_TEST=ON \
|
|
|
|
-D DESKTOP_APP_USE_PACKAGED=OFF \
|
|
|
|
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
|
|
|
|
$DEFINE
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
cd ../out
|
|
|
|
|
|
|
|
xcoderun='xcodebuild build -project Telegram.xcodeproj -scheme Telegram -destination "platform=macOS,arch=x86_64" -configuration Debug'
|
|
|
|
bash -c "$xcoderun" || bash -c "$xcoderun" || bash -c "$xcoderun"
|
|
|
|
|
|
|
|
- name: Move artifact.
|
|
|
|
if: env.UPLOAD_ARTIFACT == 'true'
|
|
|
|
run: |
|
|
|
|
cd $REPO_NAME/out/Debug
|
|
|
|
mkdir artifact
|
|
|
|
mv Telegram.app artifact/
|
|
|
|
mv Updater artifact/
|
|
|
|
- uses: actions/upload-artifact@master
|
|
|
|
if: env.UPLOAD_ARTIFACT == 'true'
|
|
|
|
name: Upload artifact.
|
|
|
|
with:
|
2020-04-12 19:04:47 +00:00
|
|
|
name: ${{ env.ARTIFACT_NAME }}
|
2020-01-22 21:31:38 +00:00
|
|
|
path: ${{ env.REPO_NAME }}/out/Debug/artifact/
|