Fix packaged macOS build (#97)
This commit is contained in:
parent
b9c7d2e133
commit
5ba0af4945
5 changed files with 36 additions and 17 deletions
39
.github/workflows/mac-packaged.yml
vendored
39
.github/workflows/mac-packaged.yml
vendored
|
|
@ -58,6 +58,11 @@ jobs:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GIT: "https://github.com"
|
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"
|
UPLOAD_ARTIFACT: "false"
|
||||||
ONLY_CACHE: "false"
|
ONLY_CACHE: "false"
|
||||||
MANUAL_CACHING: "1"
|
MANUAL_CACHING: "1"
|
||||||
|
|
@ -75,7 +80,7 @@ jobs:
|
||||||
|
|
||||||
- name: First set up.
|
- name: First set up.
|
||||||
run: |
|
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
|
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
||||||
|
|
||||||
xcodebuild -version > CACHE_KEY.txt
|
xcodebuild -version > CACHE_KEY.txt
|
||||||
|
|
@ -87,7 +92,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
echo ::set-env name=CACHE_KEY::`md5 -q CACHE_KEY.txt`
|
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
|
mkdir -p Libraries/macos
|
||||||
cd Libraries/macos
|
cd Libraries/macos
|
||||||
|
|
@ -222,16 +227,33 @@ jobs:
|
||||||
cd $LibrariesPath
|
cd $LibrariesPath
|
||||||
sudo cp -R ffmpeg-cache/. /
|
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.
|
- name: Kotatogram Desktop build.
|
||||||
if: env.ONLY_CACHE == 'false'
|
if: env.ONLY_CACHE == 'false'
|
||||||
env:
|
env:
|
||||||
PKG_CONFIG_PATH: /usr/local/ffmpeg/lib/pkgconfig
|
tg_owt_DIR: ${{ env.LibrariesPath }}/tg_owt/build
|
||||||
OPENALDIR: /usr/local/opt/openal-soft
|
|
||||||
OPENSSL_ROOT_DIR: /usr/local/opt/openssl@1.1
|
|
||||||
Qt5_DIR: /usr/local/opt/qt/lib/cmake/Qt5
|
|
||||||
run: |
|
run: |
|
||||||
cd $REPO_NAME/Telegram
|
cd $REPO_NAME/Telegram
|
||||||
export PATH="/usr/local/opt/qt/bin:$PATH"
|
|
||||||
|
|
||||||
DEFINE=""
|
DEFINE=""
|
||||||
if [ -n "${{ matrix.defines }}" ]; then
|
if [ -n "${{ matrix.defines }}" ]; then
|
||||||
|
|
@ -244,12 +266,9 @@ jobs:
|
||||||
|
|
||||||
./configure.sh \
|
./configure.sh \
|
||||||
-DCMAKE_FIND_FRAMEWORK=LAST \
|
-DCMAKE_FIND_FRAMEWORK=LAST \
|
||||||
-DCMAKE_LIBRARY_PATH=/usr/local/ffmpeg/lib \
|
|
||||||
-DTDESKTOP_API_TEST=ON \
|
-DTDESKTOP_API_TEST=ON \
|
||||||
-DDESKTOP_APP_USE_PACKAGED_LAZY=ON \
|
-DDESKTOP_APP_USE_PACKAGED_LAZY=ON \
|
||||||
-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF \
|
|
||||||
-DDESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC=ON \
|
-DDESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC=ON \
|
||||||
-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME=OFF \
|
|
||||||
$DEFINE
|
$DEFINE
|
||||||
|
|
||||||
cmake --build ../out --config Debug
|
cmake --build ../out --config Debug
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "api/api_sending.h"
|
#include "api/api_sending.h"
|
||||||
#include "base/call_delayed.h"
|
#include "base/call_delayed.h"
|
||||||
#include "base/platform/mac/base_utilities_mac.h"
|
#include "base/platform/mac/base_utilities_mac.h"
|
||||||
|
#include "platform/platform_specific.h"
|
||||||
#include "boxes/confirm_box.h"
|
#include "boxes/confirm_box.h"
|
||||||
#include "chat_helpers/emoji_list_widget.h"
|
#include "chat_helpers/emoji_list_widget.h"
|
||||||
#include "core/sandbox.h"
|
#include "core/sandbox.h"
|
||||||
|
|
@ -43,7 +44,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#import <AppKit/NSSegmentedControl.h>
|
#import <AppKit/NSSegmentedControl.h>
|
||||||
#import <AppKit/NSTextField.h>
|
#import <AppKit/NSTextField.h>
|
||||||
|
|
||||||
NSImage *qt_mac_create_nsimage(const QPixmap &pm);
|
|
||||||
using TouchBar::kCircleDiameter;
|
using TouchBar::kCircleDiameter;
|
||||||
using TouchBar::CreateNSImageFromStyleIcon;
|
using TouchBar::CreateNSImageFromStyleIcon;
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ NSImage *CreateNSImageFromEmoji(EmojiPtr emoji) {
|
||||||
Ui::Emoji::GetSizeTouchbar(),
|
Ui::Emoji::GetSizeTouchbar(),
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
return [qt_mac_create_nsimage(pixmap) autorelease];
|
return [Platform::ToNSImage(pixmap) autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ActiveChat(not_null<Window::Controller*> controller) {
|
auto ActiveChat(not_null<Window::Controller*> controller) {
|
||||||
|
|
@ -421,7 +421,7 @@ void AppendEmojiPacks(
|
||||||
PickerScrubberItemView *itemView = [scrubber
|
PickerScrubberItemView *itemView = [scrubber
|
||||||
makeItemWithIdentifier:kStickerItemIdentifier
|
makeItemWithIdentifier:kStickerItemIdentifier
|
||||||
owner:self];
|
owner:self];
|
||||||
itemView.imageView.image = [qt_mac_create_nsimage(item.qpixmap)
|
itemView.imageView.image = [Platform::ToNSImage(item.qpixmap)
|
||||||
autorelease];
|
autorelease];
|
||||||
itemView->documentId = document->id;
|
itemView->documentId = document->id;
|
||||||
return itemView;
|
return itemView;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#import <AppKit/NSSlider.h>
|
#import <AppKit/NSSlider.h>
|
||||||
#import <AppKit/NSSliderTouchBarItem.h>
|
#import <AppKit/NSSliderTouchBarItem.h>
|
||||||
|
|
||||||
NSImage *qt_mac_create_nsimage(const QPixmap &pm);
|
|
||||||
using TouchBar::kCircleDiameter;
|
using TouchBar::kCircleDiameter;
|
||||||
using TouchBar::CreateNSImageFromStyleIcon;
|
using TouchBar::CreateNSImageFromStyleIcon;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#ifndef OS_OSX
|
#ifndef OS_OSX
|
||||||
|
|
||||||
#import <AppKit/NSTextField.h>
|
#include "platform/platform_specific.h"
|
||||||
|
|
||||||
NSImage *qt_mac_create_nsimage(const QPixmap &pm);
|
#import <AppKit/NSTextField.h>
|
||||||
|
|
||||||
namespace TouchBar {
|
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);
|
const auto instance = icon.instance(QColor(255, 255, 255, 255), 100);
|
||||||
auto pixmap = QPixmap::fromImage(instance);
|
auto pixmap = QPixmap::fromImage(instance);
|
||||||
pixmap.setDevicePixelRatio(cRetinaFactor());
|
pixmap.setDevicePixelRatio(cRetinaFactor());
|
||||||
NSImage *image = [qt_mac_create_nsimage(pixmap) autorelease];
|
NSImage *image = [Platform::ToNSImage(pixmap) autorelease];
|
||||||
[image setSize:NSMakeSize(size, size)];
|
[image setSize:NSMakeSize(size, size)];
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ if (NOT DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION)
|
||||||
target_link_libraries(lib_tgcalls
|
target_link_libraries(lib_tgcalls
|
||||||
PRIVATE
|
PRIVATE
|
||||||
desktop-app::external_webrtc
|
desktop-app::external_webrtc
|
||||||
|
desktop-app::external_openssl
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue