diff --git a/.github/workflows/mac-packaged.yml b/.github/workflows/mac-packaged.yml index 52a450cad..8013a837d 100644 --- a/.github/workflows/mac-packaged.yml +++ b/.github/workflows/mac-packaged.yml @@ -58,6 +58,11 @@ jobs: env: GIT: "https://github.com" + PKG_CONFIG_PATH: /usr/local/ffmpeg/lib/pkgconfig + CMAKE_LIBRARY_PATH: /usr/local/ffmpeg/lib + OPENALDIR: /usr/local/opt/openal-soft + OPENSSL_ROOT_DIR: /usr/local/opt/openssl@1.1 + Qt5_DIR: /usr/local/opt/qt/lib/cmake/Qt5 UPLOAD_ARTIFACT: "false" ONLY_CACHE: "false" MANUAL_CACHING: "1" @@ -75,7 +80,7 @@ jobs: - name: First set up. run: | - brew install cmake dav1d meson openal-soft openssl opus nasm ninja pkg-config python qt xz + brew install cmake dav1d meson openal-soft openssl opus nasm ninja pkg-config python qt yasm xz sudo xcode-select -s /Applications/Xcode.app/Contents/Developer xcodebuild -version > CACHE_KEY.txt @@ -87,7 +92,7 @@ jobs: fi echo ::set-env name=CACHE_KEY::`md5 -q CACHE_KEY.txt` - echo ::add-path::$PWD/Libraries/depot_tools + echo ::add-path::/usr/local/opt/qt/bin mkdir -p Libraries/macos cd Libraries/macos @@ -222,16 +227,33 @@ jobs: cd $LibrariesPath sudo cp -R ffmpeg-cache/. / + - name: WebRTC cache. + id: cache-webrtc + uses: actions/cache@v2 + with: + path: ${{ env.LibrariesPath }}/tg_owt + key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }} + - name: WebRTC. + if: steps.cache-webrtc.outputs.cache-hit != 'true' + run: | + cd $LibrariesPath + + git clone --depth=1 $GIT/desktop-app/tg_owt.git + cd tg_owt + + cmake -B build . \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DTG_OWT_PACKAGED_BUILD_FFMPEG_STATIC=ON + + cmake --build build -j$(sysctl -n hw.logicalcpu) + - name: Kotatogram Desktop build. if: env.ONLY_CACHE == 'false' env: - PKG_CONFIG_PATH: /usr/local/ffmpeg/lib/pkgconfig - OPENALDIR: /usr/local/opt/openal-soft - OPENSSL_ROOT_DIR: /usr/local/opt/openssl@1.1 - Qt5_DIR: /usr/local/opt/qt/lib/cmake/Qt5 + tg_owt_DIR: ${{ env.LibrariesPath }}/tg_owt/build run: | cd $REPO_NAME/Telegram - export PATH="/usr/local/opt/qt/bin:$PATH" DEFINE="" if [ -n "${{ matrix.defines }}" ]; then @@ -244,12 +266,9 @@ jobs: ./configure.sh \ -DCMAKE_FIND_FRAMEWORK=LAST \ - -DCMAKE_LIBRARY_PATH=/usr/local/ffmpeg/lib \ -DTDESKTOP_API_TEST=ON \ -DDESKTOP_APP_USE_PACKAGED_LAZY=ON \ - -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF \ -DDESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC=ON \ - -DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME=OFF \ $DEFINE cmake --build ../out --config Debug diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.mm b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.mm index 0d0395972..282713e10 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.mm @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "api/api_sending.h" #include "base/call_delayed.h" #include "base/platform/mac/base_utilities_mac.h" +#include "platform/platform_specific.h" #include "boxes/confirm_box.h" #include "chat_helpers/emoji_list_widget.h" #include "core/sandbox.h" @@ -43,7 +44,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #import #import -NSImage *qt_mac_create_nsimage(const QPixmap &pm); using TouchBar::kCircleDiameter; using TouchBar::CreateNSImageFromStyleIcon; @@ -154,7 +154,7 @@ NSImage *CreateNSImageFromEmoji(EmojiPtr emoji) { Ui::Emoji::GetSizeTouchbar(), 0, 0); - return [qt_mac_create_nsimage(pixmap) autorelease]; + return [Platform::ToNSImage(pixmap) autorelease]; } auto ActiveChat(not_null controller) { @@ -421,7 +421,7 @@ void AppendEmojiPacks( PickerScrubberItemView *itemView = [scrubber makeItemWithIdentifier:kStickerItemIdentifier owner:self]; - itemView.imageView.image = [qt_mac_create_nsimage(item.qpixmap) + itemView.imageView.image = [Platform::ToNSImage(item.qpixmap) autorelease]; itemView->documentId = document->id; return itemView; diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.mm b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.mm index 3fde9b0c6..decdef0ed 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.mm @@ -20,7 +20,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #import #import -NSImage *qt_mac_create_nsimage(const QPixmap &pm); using TouchBar::kCircleDiameter; using TouchBar::CreateNSImageFromStyleIcon; diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.mm b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.mm index a7954218c..06ad0015c 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.mm @@ -9,9 +9,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #ifndef OS_OSX -#import +#include "platform/platform_specific.h" -NSImage *qt_mac_create_nsimage(const QPixmap &pm); +#import namespace TouchBar { @@ -24,7 +24,7 @@ NSImage *CreateNSImageFromStyleIcon(const style::icon &icon, int size) { const auto instance = icon.instance(QColor(255, 255, 255, 255), 100); auto pixmap = QPixmap::fromImage(instance); pixmap.setDevicePixelRatio(cRetinaFactor()); - NSImage *image = [qt_mac_create_nsimage(pixmap) autorelease]; + NSImage *image = [Platform::ToNSImage(pixmap) autorelease]; [image setSize:NSMakeSize(size, size)]; return image; } diff --git a/Telegram/cmake/lib_tgcalls.cmake b/Telegram/cmake/lib_tgcalls.cmake index b4841e601..2d2d194c6 100644 --- a/Telegram/cmake/lib_tgcalls.cmake +++ b/Telegram/cmake/lib_tgcalls.cmake @@ -115,6 +115,7 @@ if (NOT DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION) target_link_libraries(lib_tgcalls PRIVATE desktop-app::external_webrtc + desktop-app::external_openssl ) endif()