Compare commits
27 Commits
v5.8.2
...
linux_webv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
672aacd528 | ||
|
|
1a5e807fa9 | ||
|
|
f98f4f0d14 | ||
|
|
78def16ced | ||
|
|
cd7b3419de | ||
|
|
dc4048f1c1 | ||
|
|
bef5320163 | ||
|
|
9a722ea8d4 | ||
|
|
1aefada45d | ||
|
|
f5a8bf0e74 | ||
|
|
738439c334 | ||
|
|
8949c9969b | ||
|
|
cdf6fb1512 | ||
|
|
fb0ea59ff3 | ||
|
|
36f5be60f4 | ||
|
|
46508f7e5e | ||
|
|
28137dfb60 | ||
|
|
e7784620d3 | ||
|
|
462986e9c3 | ||
|
|
c11de2380e | ||
|
|
a432e826a6 | ||
|
|
ea9e85e70f | ||
|
|
d3829c52ec | ||
|
|
9f04570335 | ||
|
|
3c486522a7 | ||
|
|
07cd8c4e83 | ||
|
|
7447c6ea75 |
3
.gitattributes
vendored
@@ -4,6 +4,3 @@
|
||||
# Ensure diffs have LF endings
|
||||
*.diff text eol=lf
|
||||
*.bat text eol=crlf
|
||||
|
||||
# Ensure lottie animations are treated as binary files
|
||||
*.lottie binary
|
||||
|
||||
34
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report errors or unexpected behavior.
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Thanks for reporting issues of Telegram Desktop!
|
||||
|
||||
To make it easier for us to help you please enter detailed information below.
|
||||
-->
|
||||
### Steps to reproduce
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
### Expected behaviour
|
||||
Tell us what should happen
|
||||
|
||||
### Actual behaviour
|
||||
Tell us what happens instead
|
||||
|
||||
### Configuration
|
||||
**Operating system:**
|
||||
|
||||
**Version of Telegram Desktop:**
|
||||
|
||||
**Installation source (Linux Only)** - the official website / GitHub releases / flatpak / snap / distribution package:
|
||||
|
||||
**Used theme**:
|
||||
|
||||
<details><summary><b>Logs</b>:</summary>
|
||||
Insert log.txt here (if necessary)
|
||||
</details>
|
||||
78
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
vendored
@@ -1,78 +0,0 @@
|
||||
name: Bug report
|
||||
description: Report errors or unexpected behavior.
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for reporting issues of Telegram Desktop!
|
||||
|
||||
To make it easier for us to help you please enter detailed information below.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
placeholder: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected behaviour
|
||||
placeholder: Tell us what should happen
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual behaviour
|
||||
placeholder: Tell us what happens instead
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Operating system
|
||||
description: >
|
||||
Your operating system name, version and desktop environment.
|
||||
**Don't use kernel version (uname), it's useless.**
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Version of Telegram Desktop
|
||||
description: >
|
||||
Please note we don't support versions from Linux distro repositories.
|
||||
If you need support for these versions, **please contact your distro maintainer**
|
||||
or your distro bugtracker.
|
||||
**Don't use 'latest'**, specify actual version, **that's a reason to close your issue**.
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Installation source
|
||||
multiple: false
|
||||
options:
|
||||
- Static binary from official website
|
||||
- Microsoft Store
|
||||
- Mac App Store
|
||||
- Flatpak
|
||||
- Snap
|
||||
- Other (unofficial) source
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Crash ID
|
||||
description: >
|
||||
If you're reporting a crash, please enter the crash ID from the crash reporter
|
||||
opening on the next launch after crash. **You have to enable beta versions
|
||||
installation in Settings -> Advanced for the reporter to appear.**
|
||||
You don't have to wait for a beta version to arrive.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Logs
|
||||
description: >
|
||||
You can find log.txt using the `viewlogs`
|
||||
[cheat code](https://github.com/telegramdesktop/tdesktop/wiki/Cheat-Codes).
|
||||
placeholder: Insert log.txt here (if necessary)
|
||||
render: shell
|
||||
18
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea.
|
||||
title: "[Feature Request] "
|
||||
|
||||
---
|
||||
|
||||
### Is your feature request related to a problem?
|
||||
A clear and concise description of what the problem is.
|
||||
|
||||
### Describe the solution you'd like
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
### Describe alternatives you've considered
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
### Additional context
|
||||
Add any other context or screenshots about the feature request here.
|
||||
29
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml
vendored
@@ -1,29 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
description: Suggest an idea.
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Is your feature request related to a problem?
|
||||
placeholder: A clear and concise description of what the problem is.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
placeholder: A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe alternatives you've considered
|
||||
placeholder: A clear and concise description of any alternative solutions or features you've considered.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
placeholder: Add any other context or screenshots about the feature request here.
|
||||
validations:
|
||||
required: false
|
||||
8
.github/ISSUE_TEMPLATE/QUESTION.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
name: Question
|
||||
about: Ask a question.
|
||||
title: "[Question] "
|
||||
labels: 'question'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
11
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,11 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Platform-wide issue
|
||||
url: https://bugs.telegram.org
|
||||
about: Any bug report or feature request affecting more than only Telegram Desktop.
|
||||
- name: Issue of other client
|
||||
url: https://bugs.telegram.org
|
||||
about: Any bug report or feature request not about Telegram Desktop.
|
||||
- name: Question
|
||||
url: https://t.me/TelegramDesktopTalk
|
||||
about: Ask a question.
|
||||
6
.github/dependabot.yml
vendored
@@ -1,6 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
11
.github/no-response.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Number of days of inactivity before an Issue is closed for lack of response
|
||||
daysUntilClose: 30
|
||||
# Label requiring a response
|
||||
responseRequiredLabel: waiting for answer
|
||||
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
|
||||
closeComment: >
|
||||
This issue has been automatically closed because there has been no response
|
||||
to our request for more information from the original author. With only the
|
||||
information that is currently in the issue, we don't have enough information
|
||||
to take action. Please reach out if you have or find the answers we need so
|
||||
that we can investigate further.
|
||||
21
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 180
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 30
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels: []
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: |
|
||||
Hey there!
|
||||
|
||||
This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.
|
||||
|
||||
Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.
|
||||
|
||||
Thanks!
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
# Process only issues
|
||||
only: issues
|
||||
25
.github/workflows/cant-reproduce.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Can't reproduce.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * *'
|
||||
|
||||
jobs:
|
||||
cant-reproduce:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: lee-dohm/no-response@v0.5.0
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
responseRequiredLabel: cant reproduce
|
||||
closeComment: >
|
||||
This issue has been automatically closed because no developer succeeded to
|
||||
reproduce the issue with the given reproduction steps. With only the
|
||||
information that is currently in the issue, we don't have enough
|
||||
information to take action. Please reach out if you find what's missing to
|
||||
reproduce the issue so that we can investigate further.
|
||||
|
||||
|
||||
Note that GitHub is a developer communication platform. If you're an ordinary
|
||||
user seeking for help, get to support crew via `Settings -> Ask question` in
|
||||
the application.
|
||||
23
.github/workflows/docker.yml
vendored
@@ -15,30 +15,11 @@ jobs:
|
||||
name: Ubuntu
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
IMAGE_TAG: ghcr.io/${{ github.repository }}/centos_env:latest
|
||||
|
||||
steps:
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: First set up.
|
||||
run: |
|
||||
sudo apt update
|
||||
curl -sSL https://install.python-poetry.org | python3 -
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
|
||||
|
||||
- name: Free up some disk space.
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
|
||||
- name: Docker image build.
|
||||
run: |
|
||||
cd Telegram/build/docker/centos_env
|
||||
poetry install
|
||||
DEBUG= LTO= poetry run gen_dockerfile | DOCKER_BUILDKIT=1 docker build -t $IMAGE_TAG -
|
||||
|
||||
- name: Push the Docker image.
|
||||
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
||||
run: docker push $IMAGE_TAG
|
||||
run: docker build -t telegram_desktop Telegram/build/docker/centos_env
|
||||
|
||||
56
.github/workflows/linux.yml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '!docs/building-cmake.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
@@ -12,6 +13,7 @@ on:
|
||||
- '!.github/workflows/linux.yml'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
@@ -23,6 +25,7 @@ on:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '!docs/building-cmake.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
@@ -30,6 +33,7 @@ on:
|
||||
- '!.github/workflows/linux.yml'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
@@ -41,37 +45,50 @@ on:
|
||||
jobs:
|
||||
|
||||
linux:
|
||||
name: Rocky Linux 8
|
||||
name: CentOS 7
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.pkg.github.com/telegramdesktop/tdesktop/centos_env
|
||||
credentials:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: scl enable devtoolset-9 -- bash --noprofile --norc -eo pipefail {0}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
defines:
|
||||
- ""
|
||||
- "DESKTOP_APP_DISABLE_DBUS_INTEGRATION"
|
||||
- "DESKTOP_APP_DISABLE_X11_INTEGRATION"
|
||||
- "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION"
|
||||
- "DESKTOP_APP_DISABLE_GTK_INTEGRATION"
|
||||
- "LIBTGVOIP_DISABLE_ALSA"
|
||||
- "LIBTGVOIP_DISABLE_PULSEAUDIO"
|
||||
|
||||
env:
|
||||
UPLOAD_ARTIFACT: "true"
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
|
||||
steps:
|
||||
- name: Get repository name.
|
||||
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
path: ${{ env.REPO_NAME }}
|
||||
|
||||
- name: First set up.
|
||||
run: |
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
|
||||
docker pull ghcr.io/$GITHUB_REPOSITORY/centos_env
|
||||
docker tag ghcr.io/$GITHUB_REPOSITORY/centos_env tdesktop:centos_env
|
||||
gcc --version
|
||||
ln -s $LibrariesPath Libraries
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
run: |
|
||||
cd $REPO_NAME
|
||||
cd $REPO_NAME/Telegram
|
||||
|
||||
DEFINE=""
|
||||
if [ -n "${{ matrix.defines }}" ]; then
|
||||
@@ -82,24 +99,21 @@ jobs:
|
||||
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
docker run --rm \
|
||||
-v $PWD:/usr/src/tdesktop \
|
||||
-e CONFIG=Debug \
|
||||
tdesktop:centos_env \
|
||||
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
|
||||
-D CMAKE_C_FLAGS_DEBUG="" \
|
||||
-D CMAKE_CXX_FLAGS_DEBUG="" \
|
||||
./configure.sh \
|
||||
-D CMAKE_C_FLAGS="-Werror" \
|
||||
-D CMAKE_CXX_FLAGS="-Werror" \
|
||||
-D CMAKE_EXE_LINKER_FLAGS="-s" \
|
||||
-D TDESKTOP_API_TEST=ON \
|
||||
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF \
|
||||
-D DESKTOP_APP_USE_PACKAGED=OFF \
|
||||
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
|
||||
$DEFINE
|
||||
|
||||
cd ../out/Debug
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Check.
|
||||
run: |
|
||||
filePath="$REPO_NAME/out/Debug/Telegram"
|
||||
filePath="$REPO_NAME/out/Debug/bin/Telegram"
|
||||
if test -f "$filePath"; then
|
||||
echo "Build successfully done! :)"
|
||||
|
||||
@@ -113,12 +127,12 @@ jobs:
|
||||
- name: Move artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
cd $REPO_NAME/out/Debug
|
||||
sudo mkdir artifact
|
||||
sudo mv {Telegram,Updater} artifact/
|
||||
- uses: actions/upload-artifact@v4
|
||||
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: ${{ env.ARTIFACT_NAME }}
|
||||
path: ${{ env.REPO_NAME }}/out/Debug/artifact/
|
||||
path: ${{ env.REPO_NAME }}/out/Debug/bin/artifact/
|
||||
|
||||
16
.github/workflows/lock.yml
vendored
@@ -2,14 +2,22 @@ name: 'Lock Threads'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
- cron: '0 * * * *'
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v5
|
||||
- uses: dessant/lock-threads@v2
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-inactive-days: 45
|
||||
pr-inactive-days: 45
|
||||
issue-lock-inactive-days: 45
|
||||
pr-lock-inactive-days: 45
|
||||
issue-lock-comment: >
|
||||
This issue has been automatically locked since there
|
||||
has not been any recent activity after it was closed.
|
||||
Please open a new issue for related bugs.
|
||||
pr-lock-comment: >
|
||||
This pull request has been automatically locked since there
|
||||
has not been any recent activity after it was closed.
|
||||
Please open a new issue for related bugs.
|
||||
|
||||
466
.github/workflows/mac.yml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '!docs/building-xcode.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
@@ -12,7 +13,8 @@ on:
|
||||
- '!.github/workflows/mac.yml'
|
||||
- 'lib/xdg/**'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/docker/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
@@ -22,6 +24,7 @@ on:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '!docs/building-xcode.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
@@ -29,7 +32,8 @@ on:
|
||||
- '!.github/workflows/mac.yml'
|
||||
- 'lib/xdg/**'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/docker/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
@@ -40,23 +44,35 @@ jobs:
|
||||
|
||||
macos:
|
||||
name: MacOS
|
||||
runs-on: macos-13
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
defines:
|
||||
- ""
|
||||
env:
|
||||
UPLOAD_ARTIFACT: "true"
|
||||
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"
|
||||
XZ: "xz-5.2.5"
|
||||
QT: "5_15_2"
|
||||
OPENSSL_VER: "1_1_1"
|
||||
QT_PREFIX: "/usr/local/desktop-app/Qt-5.15.2"
|
||||
LIBICONV_VER: "libiconv-1.16"
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
ONLY_CACHE: "false"
|
||||
PREPARE_PATH: "Telegram/build/prepare/prepare.py"
|
||||
MANUAL_CACHING: "2"
|
||||
DOC_PATH: "docs/building-xcode.md"
|
||||
AUTO_CACHING: "1"
|
||||
|
||||
steps:
|
||||
- name: Get repository name.
|
||||
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
path: ${{ env.REPO_NAME }}
|
||||
@@ -64,40 +80,429 @@ jobs:
|
||||
- name: First set up.
|
||||
run: |
|
||||
sudo chown -R `whoami`:admin /usr/local/share
|
||||
|
||||
brew update
|
||||
brew upgrade || true
|
||||
brew install automake meson nasm ninja pkg-config
|
||||
brew install automake fdk-aac lame libass libtool libvorbis libvpx \
|
||||
ninja opus sdl shtool texi2html theora x264 xvid yasm pkg-config
|
||||
|
||||
# Disable spotlight.
|
||||
sudo mdutil -a -i off
|
||||
|
||||
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
||||
|
||||
- name: ThirdParty cache.
|
||||
id: cache-third-party
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ThirdParty
|
||||
key: ${{ runner.OS }}-third-party-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
|
||||
restore-keys: ${{ runner.OS }}-third-party-
|
||||
xcodebuild -version > CACHE_KEY.txt
|
||||
echo $MIN_MAC >> CACHE_KEY.txt
|
||||
echo $PREFIX >> CACHE_KEY.txt
|
||||
echo $MANUAL_CACHING >> CACHE_KEY.txt
|
||||
echo "$GITHUB_WORKSPACE" >> CACHE_KEY.txt
|
||||
if [ "$AUTO_CACHING" == "1" ]; then
|
||||
thisFile=$REPO_NAME/.github/workflows/mac.yml
|
||||
echo `md5 -q $thisFile` >> CACHE_KEY.txt
|
||||
fi
|
||||
echo "CACHE_KEY=`md5 -q CACHE_KEY.txt`" >> $GITHUB_ENV
|
||||
|
||||
- name: Libraries cache.
|
||||
id: cache-libs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: Libraries
|
||||
key: ${{ runner.OS }}-libs-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
|
||||
restore-keys: ${{ runner.OS }}-libs-
|
||||
echo "$PWD/Libraries/depot_tools" >> $GITHUB_PATH
|
||||
|
||||
- name: Libraries.
|
||||
mkdir -p Libraries/macos
|
||||
cd Libraries/macos
|
||||
echo "LibrariesPath=`pwd`" >> $GITHUB_ENV
|
||||
|
||||
curl -o tg_owt-version.json https://api.github.com/repos/desktop-app/tg_owt/git/refs/heads/master
|
||||
|
||||
- name: Patches.
|
||||
run: |
|
||||
./$REPO_NAME/Telegram/build/prepare/mac.sh skip-release silent
|
||||
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: Free up some disk space.
|
||||
- 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
|
||||
CFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- 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=$PREFIX \
|
||||
-DWITH_JPEG8=ON \
|
||||
-DPNG_SUPPORTED=OFF
|
||||
cmake --build build -j$(nproc)
|
||||
sudo cmake --install build
|
||||
|
||||
- name: OpenSSL cache.
|
||||
id: cache-openssl
|
||||
uses: actions/cache@v2
|
||||
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
|
||||
|
||||
git clone $GIT/openssl/openssl openssl
|
||||
cd openssl
|
||||
git checkout OpenSSL_"$OPENSSL_VER"-stable
|
||||
./Configure \
|
||||
--prefix=$PREFIX \
|
||||
no-tests \
|
||||
darwin64-x86_64-cc \
|
||||
-static \
|
||||
$MIN_MAC
|
||||
make build_libs -j$(nproc)
|
||||
|
||||
SSL_DIR=$LibrariesPath/openssl_$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@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/opus-cache
|
||||
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
|
||||
CFLAGS="$MIN_MAC $UNGUARDED" CPPFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
||||
make -j$(nproc)
|
||||
sudo make DESTDIR="$LibrariesPath/opus-cache" install
|
||||
- name: Opus install.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
sudo cp -R opus-cache/. /
|
||||
|
||||
- name: Libiconv cache.
|
||||
id: cache-libiconv
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/libiconv-cache
|
||||
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)
|
||||
sudo make DESTDIR="$LibrariesPath/libiconv-cache" install
|
||||
- name: Libiconv install.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
sudo cp -R libiconv-cache/. /
|
||||
|
||||
- name: FFmpeg cache.
|
||||
id: cache-ffmpeg
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/ffmpeg-cache
|
||||
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
|
||||
git checkout release/4.2
|
||||
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
|
||||
|
||||
./configure --prefix=$LibrariesPath/ffmpeg-cache \
|
||||
--extra-cflags="$MIN_MAC $UNGUARDED" \
|
||||
--extra-cxxflags="$MIN_MAC $UNGUARDED" \
|
||||
--extra-ldflags="$MIN_MAC" \
|
||||
--x86asmexe=`pwd`/macos_yasm_wrap.sh \
|
||||
--enable-protocol=file \
|
||||
--enable-libopus \
|
||||
--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)
|
||||
sudo make install
|
||||
- name: FFmpeg install.
|
||||
run: |
|
||||
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/. $PREFIX
|
||||
sudo cp -R ffmpeg-cache/include/. ffmpeg/
|
||||
|
||||
- name: OpenAL Soft.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone --branch capture_with_webrtc $GIT/telegramdesktop/openal-soft.git
|
||||
cd openal-soft/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
|
||||
uses: actions/cache@v2
|
||||
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
|
||||
find . -iname "*.dir" -exec rm -rf {} || true \;
|
||||
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
|
||||
|
||||
- name: Qt 5.15.2 cache.
|
||||
id: cache-qt
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/qt-cache
|
||||
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_15_2/*') }}
|
||||
- name: Use cached Qt 5.15.2.
|
||||
if: steps.cache-qt.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
mv qt-cache Qt-5.15.2
|
||||
sudo mkdir -p $QT_PREFIX
|
||||
sudo mv -f Qt-5.15.2 "$(dirname "$QT_PREFIX")"/
|
||||
- name: Qt 5.15.2 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.15.2
|
||||
git submodule update qtbase
|
||||
git submodule update qtimageformats
|
||||
cd qtbase
|
||||
find ../../patches/qtbase_$QT -type f -print0 | sort -z | xargs -0 git apply
|
||||
cd ..
|
||||
|
||||
./configure \
|
||||
-prefix "$QT_PREFIX" \
|
||||
-debug \
|
||||
-force-debug-info \
|
||||
-opensource \
|
||||
-confirm-license \
|
||||
-static \
|
||||
-opengl desktop \
|
||||
-no-openssl \
|
||||
-securetransport \
|
||||
-nomake examples \
|
||||
-nomake tests \
|
||||
-platform macx-clang \
|
||||
-I "$PREFIX/include" \
|
||||
LIBJPEG_LIBS="$PREFIX/lib/libjpeg.a" \
|
||||
ZLIB_LIBS="$PREFIX/lib/libz.a"
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
make clean
|
||||
cp -r $QT_PREFIX $LibrariesPath/qt-cache
|
||||
|
||||
- name: WebRTC cache.
|
||||
id: cache-webrtc
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/tg_owt
|
||||
key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }}-${{ hashFiles('**/tg_owt-version.json') }}
|
||||
- name: WebRTC.
|
||||
if: steps.cache-webrtc.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone --recursive $GIT/desktop-app/tg_owt.git
|
||||
mkdir -p tg_owt/out/Debug
|
||||
cd tg_owt/out/Debug
|
||||
cmake -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DTG_OWT_SPECIAL_TARGET=mac \
|
||||
-DTG_OWT_LIBJPEG_INCLUDE_PATH=$PREFIX/include \
|
||||
-DTG_OWT_OPENSSL_INCLUDE_PATH=`pwd`/../../../openssl_$OPENSSL_VER/include \
|
||||
-DTG_OWT_OPUS_INCLUDE_PATH=$PREFIX/include/opus \
|
||||
-DTG_OWT_FFMPEG_INCLUDE_PATH=$PREFIX/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
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
@@ -116,9 +521,8 @@ jobs:
|
||||
./configure.sh \
|
||||
-D CMAKE_C_FLAGS="-Werror" \
|
||||
-D CMAKE_CXX_FLAGS="-Werror" \
|
||||
-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO \
|
||||
-D TDESKTOP_API_TEST=ON \
|
||||
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF \
|
||||
-D DESKTOP_APP_USE_PACKAGED=OFF \
|
||||
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
|
||||
$DEFINE
|
||||
|
||||
@@ -134,7 +538,7 @@ jobs:
|
||||
mkdir artifact
|
||||
mv Telegram.app artifact/
|
||||
mv Updater artifact/
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@master
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
name: Upload artifact.
|
||||
with:
|
||||
|
||||
168
.github/workflows/mac_packaged.yml
vendored
@@ -1,168 +0,0 @@
|
||||
name: MacOS Packaged.
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/mac_packaged.yml'
|
||||
- 'lib/xdg/**'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
- 'Telegram/SourceFiles/platform/linux/**'
|
||||
- 'Telegram/configure.bat'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/mac_packaged.yml'
|
||||
- 'lib/xdg/**'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
- 'Telegram/SourceFiles/platform/linux/**'
|
||||
- 'Telegram/configure.bat'
|
||||
|
||||
jobs:
|
||||
|
||||
macos:
|
||||
name: MacOS
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
defines:
|
||||
- ""
|
||||
|
||||
env:
|
||||
GIT: "https://github.com"
|
||||
CMAKE_PREFIX_PATH: "/opt/homebrew/opt/ffmpeg@6:/opt/homebrew/opt/openal-soft"
|
||||
UPLOAD_ARTIFACT: "true"
|
||||
ONLY_CACHE: "false"
|
||||
MANUAL_CACHING: "1"
|
||||
AUTO_CACHING: "1"
|
||||
|
||||
steps:
|
||||
- name: Get repository name.
|
||||
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
path: ${{ env.REPO_NAME }}
|
||||
|
||||
- name: First set up.
|
||||
run: |
|
||||
brew update
|
||||
brew upgrade || true
|
||||
brew install ada-url autoconf automake boost cmake ffmpeg@6 libtool openal-soft openh264 openssl opus ninja pkg-config python qt yasm xz
|
||||
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
||||
|
||||
xcodebuild -version > CACHE_KEY.txt
|
||||
brew list --versions >> CACHE_KEY.txt
|
||||
echo $MANUAL_CACHING >> CACHE_KEY.txt
|
||||
echo "$GITHUB_WORKSPACE" >> CACHE_KEY.txt
|
||||
if [ "$AUTO_CACHING" = "1" ]; then
|
||||
thisFile=$REPO_NAME/.github/workflows/mac_packaged.yml
|
||||
echo `md5 -q $thisFile` >> CACHE_KEY.txt
|
||||
fi
|
||||
echo "CACHE_KEY=`md5 -q CACHE_KEY.txt`" >> $GITHUB_ENV
|
||||
|
||||
echo "LibrariesPath=`pwd`" >> $GITHUB_ENV
|
||||
|
||||
curl -o tg_owt-version.json https://api.github.com/repos/desktop-app/tg_owt/git/refs/heads/master
|
||||
|
||||
- name: RNNoise.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone --depth=1 https://gitlab.xiph.org/xiph/rnnoise.git
|
||||
cd rnnoise
|
||||
./autogen.sh
|
||||
./configure --disable-examples --disable-doc
|
||||
make -j$(sysctl -n hw.logicalcpu)
|
||||
sudo make install
|
||||
|
||||
- name: WebRTC cache.
|
||||
id: cache-webrtc
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/tg_owt
|
||||
key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }}-${{ hashFiles('**/tg_owt-version.json') }}
|
||||
- name: WebRTC.
|
||||
if: steps.cache-webrtc.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone --depth=1 --recursive --shallow-submodules $GIT/desktop-app/tg_owt.git
|
||||
cd tg_owt
|
||||
|
||||
cmake -Bbuild -GNinja . \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DCMAKE_C_FLAGS_DEBUG="" \
|
||||
-DCMAKE_CXX_FLAGS_DEBUG=""
|
||||
|
||||
cmake --build build --parallel
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
env:
|
||||
tg_owt_DIR: ${{ env.LibrariesPath }}/tg_owt/build
|
||||
run: |
|
||||
cd $REPO_NAME
|
||||
|
||||
DEFINE=""
|
||||
if [ -n "${{ matrix.defines }}" ]; then
|
||||
DEFINE="-D ${{ matrix.defines }}=ON"
|
||||
echo Define from matrix: $DEFINE
|
||||
echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
cmake -Bbuild -GNinja . \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DCMAKE_C_FLAGS_DEBUG="" \
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-s" \
|
||||
-DCMAKE_FIND_FRAMEWORK=LAST \
|
||||
-DTDESKTOP_API_TEST=ON \
|
||||
-DDESKTOP_APP_USE_PACKAGED_LAZY=ON \
|
||||
$DEFINE
|
||||
|
||||
cmake --build build --parallel
|
||||
|
||||
cd build
|
||||
macdeployqt Telegram.app
|
||||
codesign --remove-signature Telegram.app
|
||||
|
||||
mkdir dmgsrc
|
||||
mv Telegram.app dmgsrc
|
||||
hdiutil create -volname Telegram -srcfolder dmgsrc -ov -format UDZO Telegram.dmg
|
||||
|
||||
- name: Move artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
cd $REPO_NAME/build
|
||||
mkdir artifact
|
||||
mv Telegram.dmg artifact/
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
name: Upload artifact.
|
||||
with:
|
||||
name: ${{ env.ARTIFACT_NAME }}
|
||||
path: ${{ env.REPO_NAME }}/build/artifact/
|
||||
4
.github/workflows/master_updater.yml
vendored
@@ -11,9 +11,7 @@ jobs:
|
||||
SKIP: "0"
|
||||
to_branch: "master"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v1
|
||||
if: env.SKIP == '0'
|
||||
- name: Push the code to the master branch.
|
||||
if: env.SKIP == '0'
|
||||
|
||||
16
.github/workflows/needs-user-action.yml
vendored
@@ -1,16 +0,0 @@
|
||||
name: Needs user action.
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
|
||||
jobs:
|
||||
needs-user-action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: lee-dohm/no-response@v0.5.0
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
responseRequiredLabel: needs user action
|
||||
25
.github/workflows/snap.yml
vendored
@@ -11,6 +11,7 @@ on:
|
||||
- '.github/**'
|
||||
- '!.github/workflows/snap.yml'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
@@ -28,6 +29,7 @@ on:
|
||||
- '.github/**'
|
||||
- '!.github/workflows/snap.yml'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/Resources/winrc/**'
|
||||
- 'Telegram/SourceFiles/platform/win/**'
|
||||
@@ -38,33 +40,38 @@ on:
|
||||
|
||||
jobs:
|
||||
|
||||
snap:
|
||||
linux:
|
||||
name: Ubuntu
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
UPLOAD_ARTIFACT: "true"
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
|
||||
steps:
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: First set up.
|
||||
run: |
|
||||
sudo iptables -P FORWARD ACCEPT
|
||||
sudo apt-get purge --autoremove lxd
|
||||
|
||||
sudo snap install --classic snapcraft
|
||||
sudo snap install lxd
|
||||
|
||||
# Workaround for snapcraft
|
||||
# See https://forum.snapcraft.io/t/13258
|
||||
sudo chown root:root /
|
||||
|
||||
sudo usermod -aG lxd $USER
|
||||
|
||||
sudo snap run lxd init --auto
|
||||
sudo snap run lxd waitready
|
||||
|
||||
- name: Free up some disk space.
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
|
||||
- name: Telegram Desktop snap build.
|
||||
run: sg lxd -c 'snap run snapcraft --verbosity=debug'
|
||||
run: sg lxd -c 'snap run snapcraft --use-lxd'
|
||||
|
||||
- name: Move artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
@@ -75,7 +82,7 @@ jobs:
|
||||
mkdir artifact
|
||||
mv $artifact_name artifact
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@master
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
name: Upload artifact.
|
||||
with:
|
||||
|
||||
25
.github/workflows/stale.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
stale-issue-message: |
|
||||
Hey there!
|
||||
|
||||
This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.
|
||||
|
||||
Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.
|
||||
|
||||
Thanks!
|
||||
stale-issue-label: 'stale'
|
||||
exempt-issue-labels: 'enhancement'
|
||||
days-before-stale: 180
|
||||
days-before-close: 30
|
||||
days-before-pr-stale: -1
|
||||
operations-per-run: 1000
|
||||
16
.github/workflows/waiting-for-answer.yml
vendored
@@ -1,16 +0,0 @@
|
||||
name: Waiting for answer.
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
schedule:
|
||||
- cron: '30 0 * * *'
|
||||
|
||||
jobs:
|
||||
waiting-for-answer:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: lee-dohm/no-response@v0.5.0
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
responseRequiredLabel: waiting for answer
|
||||
442
.github/workflows/win.yml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '!docs/building-msvc.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
@@ -12,7 +13,9 @@ on:
|
||||
- '!.github/workflows/win.yml'
|
||||
- 'lib/xdg/**'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/docker/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- '!Telegram/Patches/build_ffmpeg_win.sh'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/SourceFiles/platform/linux/**'
|
||||
- 'Telegram/SourceFiles/platform/mac/**'
|
||||
@@ -23,6 +26,7 @@ on:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '!docs/building-msvc.md'
|
||||
- 'changelog.txt'
|
||||
- 'LEGAL'
|
||||
- 'LICENSE'
|
||||
@@ -30,10 +34,13 @@ on:
|
||||
- '!.github/workflows/win.yml'
|
||||
- 'lib/xdg/**'
|
||||
- 'snap/**'
|
||||
- 'Telegram/build/docker/**'
|
||||
- 'Telegram/build/**'
|
||||
- 'Telegram/Patches/**'
|
||||
- '!Telegram/Patches/build_ffmpeg_win.sh'
|
||||
- 'Telegram/Resources/uwp/**'
|
||||
- 'Telegram/SourceFiles/platform/linux/**'
|
||||
- 'Telegram/SourceFiles/platform/mac/**'
|
||||
- '!Telegram/Patches/breakpad.diff'
|
||||
- 'Telegram/Telegram/**'
|
||||
- 'Telegram/configure.sh'
|
||||
- 'Telegram/Telegram.plist'
|
||||
@@ -46,156 +53,379 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [Win32, x64]
|
||||
generator: ["", "Ninja Multi-Config"]
|
||||
|
||||
defines:
|
||||
- ""
|
||||
env:
|
||||
UPLOAD_ARTIFACT: "true"
|
||||
SDK: "10.0.18362.0"
|
||||
VC: "call vcvars32.bat && cd Libraries"
|
||||
GIT: "https://github.com"
|
||||
QT: "5_15_2"
|
||||
QT_VER: "5.15.2"
|
||||
OPENSSL_VER: "1_1_1"
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
ONLY_CACHE: "false"
|
||||
PREPARE_PATH: "Telegram/build/prepare/prepare.py"
|
||||
MANUAL_CACHING: "2"
|
||||
DOC_PATH: "docs/building-msvc.md"
|
||||
AUTO_CACHING: "1"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: cmd
|
||||
|
||||
steps:
|
||||
- name: Prepare directories.
|
||||
run: |
|
||||
mkdir %userprofile%\TBuild\Libraries
|
||||
mklink /d %GITHUB_WORKSPACE%\TBuild %userprofile%\TBuild
|
||||
echo TBUILD=%GITHUB_WORKSPACE%\TBuild>>%GITHUB_ENV%
|
||||
|
||||
- name: Get repository name.
|
||||
shell: bash
|
||||
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
name: Native Tools Command Prompt.
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
path: ${{ env.TBUILD }}\${{ env.REPO_NAME }}
|
||||
|
||||
- name: Set up environment paths.
|
||||
shell: bash
|
||||
run: |
|
||||
echo "CACHE_KEY=$(sha256sum $TBUILD/$REPO_NAME/$PREPARE_PATH | awk '{ print $1 }')" >> $GITHUB_ENV
|
||||
echo "C:\\Strawberry\\perl\\bin\\" >> $GITHUB_PATH
|
||||
echo "C:\\Program Files\\NASM\\" >> $GITHUB_PATH
|
||||
echo "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\" >> $GITHUB_PATH
|
||||
|
||||
echo "Configurate git for cherry-picks."
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Sample"
|
||||
mkdir Libraries && cd Libraries
|
||||
echo "Convert unix path to win path."
|
||||
p=`pwd | sed 's#^/[d]#d:#g' |sed 's#/#\\\\#g'`
|
||||
echo "LibrariesPath=$p" >> $GITHUB_ENV
|
||||
|
||||
- name: NuGet sources.
|
||||
- name: Save msbuild version.
|
||||
run: |
|
||||
nuget sources Disable -Name "Microsoft Visual Studio Offline Packages"
|
||||
nuget sources Add -Source https://api.nuget.org/v3/index.json & exit 0
|
||||
call vcvars32.bat
|
||||
msbuild -version > CACHE_KEY.txt
|
||||
|
||||
- name: ThirdParty cache.
|
||||
id: cache-third-party
|
||||
uses: actions/cache@v4
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{ env.TBUILD }}\ThirdParty
|
||||
key: ${{ runner.OS }}-${{ matrix.arch }}-third-party-${{ env.CACHE_KEY }}
|
||||
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-third-party-
|
||||
submodules: recursive
|
||||
path: ${{ env.REPO_NAME }}
|
||||
|
||||
- name: Libraries cache.
|
||||
id: cache-libs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.TBUILD }}\Libraries
|
||||
key: ${{ runner.OS }}-${{ matrix.arch }}-libs-${{ env.CACHE_KEY }}
|
||||
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-libs-
|
||||
|
||||
- name: Libraries.
|
||||
env:
|
||||
GYP_MSVS_OVERRIDE_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\'
|
||||
GYP_MSVS_VERSION: 2022
|
||||
run: |
|
||||
cd %TBUILD%
|
||||
%REPO_NAME%\Telegram\build\prepare\win.bat skip-release silent
|
||||
|
||||
- name: Read configuration matrix.
|
||||
- name: Generate cache key.
|
||||
shell: bash
|
||||
run: |
|
||||
ARTIFACT_NAME="Telegram"
|
||||
|
||||
ARCH=""
|
||||
if [ -n "${{ matrix.arch }}" ]; then
|
||||
case "${{ matrix.arch }}" in
|
||||
Win32) ARCH="x86";;
|
||||
*) ARCH="${{ matrix.arch }}";;
|
||||
esac
|
||||
echo "Architecture from matrix: $ARCH"
|
||||
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.arch }}"
|
||||
curl -o $LibrariesPath/tg_owt-version.json https://api.github.com/repos/desktop-app/tg_owt/git/refs/heads/master
|
||||
echo $MANUAL_CACHING >> CACHE_KEY.txt
|
||||
if [ "$AUTO_CACHING" == "1" ]; then
|
||||
thisFile=$REPO_NAME/.github/workflows/win.yml
|
||||
echo `md5sum $thisFile | awk '{ print $1 }'` >> CACHE_KEY.txt
|
||||
fi
|
||||
echo "CACHE_KEY=`md5sum CACHE_KEY.txt | awk '{ print $1 }'`" >> $GITHUB_ENV
|
||||
|
||||
GENERATOR=""
|
||||
if [ -n "${{ matrix.generator }}" ]; then
|
||||
GENERATOR="-G \"${{ matrix.generator }}\""
|
||||
echo "Generator from matrix: $GENERATOR"
|
||||
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.generator }}"
|
||||
- name: Choco installs.
|
||||
run: choco install --no-progress -y nasm yasm jom ninja
|
||||
|
||||
- name: Patches.
|
||||
shell: bash
|
||||
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: Find any version of Python 2.
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Find any version of Python 2."
|
||||
p=`ls /c/hostedtoolcache/windows/python | grep "^2" | tail -1`
|
||||
if [ -z "$p" ]; then
|
||||
echo "Python 2 is not found."
|
||||
exit 1
|
||||
fi
|
||||
echo "TDESKTOP_BUILD_GENERATOR=$GENERATOR" >> $GITHUB_ENV
|
||||
echo "PY2=C:\\hostedtoolcache\\windows\\Python\\$p\\x64" >> $GITHUB_ENV
|
||||
echo "Found $p."
|
||||
|
||||
[ -n "$GENERATOR" ] && ARCH=""
|
||||
echo "TDESKTOP_BUILD_ARCH=$ARCH" >> $GITHUB_ENV
|
||||
- name: LZMA.
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/telegramdesktop/lzma.git
|
||||
cd lzma
|
||||
cd C\Util\LzmaLib
|
||||
msbuild -m LzmaLib.sln /property:Configuration=Debug
|
||||
|
||||
- name: OpenSSL cache.
|
||||
id: cache-openssl
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/openssl_${{ env.OPENSSL_VER }}
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_KEY }}-${{ env.OPENSSL_VER }}
|
||||
- name: OpenSSL.
|
||||
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/openssl/openssl.git openssl_%OPENSSL_VER%
|
||||
cd openssl_%OPENSSL_VER%
|
||||
git checkout OpenSSL_%OPENSSL_VER%-stable
|
||||
perl Configure no-shared no-tests debug-VC-WIN32
|
||||
nmake
|
||||
mkdir out32.dbg
|
||||
move libcrypto.lib out32.dbg
|
||||
move libssl.lib out32.dbg
|
||||
move ossl_static.pdb out32.dbg\ossl_static
|
||||
nmake clean
|
||||
move out32.dbg\ossl_static out32.dbg\ossl_static.pdb
|
||||
perl Configure no-shared no-tests VC-WIN32
|
||||
nmake
|
||||
mkdir out32
|
||||
move libcrypto.lib out32
|
||||
move libssl.lib out32
|
||||
move ossl_static.pdb out32
|
||||
|
||||
rmdir /S /Q test
|
||||
rmdir /S /Q .git
|
||||
|
||||
- name: Zlib.
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/telegramdesktop/zlib.git
|
||||
cd zlib
|
||||
git checkout tdesktop
|
||||
cd contrib\vstudio\vc14
|
||||
msbuild -m zlibstat.vcxproj /property:Configuration=Debug
|
||||
|
||||
- name: MozJPEG.
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone -b v4.0.1-rc2 %GIT%/mozilla/mozjpeg.git
|
||||
cd mozjpeg
|
||||
cmake . ^
|
||||
-G "Visual Studio 16 2019" ^
|
||||
-A Win32 ^
|
||||
-DWITH_JPEG8=ON ^
|
||||
-DPNG_SUPPORTED=OFF
|
||||
cmake --build . --config Debug
|
||||
|
||||
- name: OpenAL Soft cache.
|
||||
id: cache-openal
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/openal-soft
|
||||
key: ${{ runner.OS }}-openal-soft-${{ env.CACHE_KEY }}
|
||||
- name: OpenAL Soft.
|
||||
if: steps.cache-openal.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone -b openal-soft-1.21.0 --depth=1 %GIT%/kcat/openal-soft.git
|
||||
cd openal-soft\build
|
||||
cmake .. ^
|
||||
-G "Visual Studio 16 2019" ^
|
||||
-A Win32 ^
|
||||
-D LIBTYPE:STRING=STATIC ^
|
||||
-D FORCE_STATIC_VCRT=ON ^
|
||||
-D ALSOFT_BACKEND_DSOUND=OFF
|
||||
|
||||
msbuild -m OpenAL.vcxproj /property:Configuration=Debug
|
||||
|
||||
- name: Breakpad cache.
|
||||
id: cache-breakpad
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/breakpad
|
||||
key: ${{ runner.OS }}-breakpad-${{ env.CACHE_KEY }}-${{ hashFiles('**/breakpad.diff') }}
|
||||
- name: Breakpad.
|
||||
env:
|
||||
GYP_MSVS_OVERRIDE_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\'
|
||||
GYP_MSVS_VERSION: 2019
|
||||
if: steps.cache-breakpad.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd %LibrariesPath%
|
||||
|
||||
git clone %GIT%/telegramdesktop/gyp.git
|
||||
cd gyp
|
||||
SET PATH=%PY2%;%cd%;%PATH%
|
||||
git checkout tdesktop
|
||||
|
||||
cd %LibrariesPath%
|
||||
|
||||
git clone %GIT%/google/breakpad
|
||||
cd breakpad
|
||||
git checkout a1dbcdcb43
|
||||
git apply ../patches/breakpad.diff
|
||||
cd src
|
||||
git clone %GIT%/google/googletest testing
|
||||
cd client\windows
|
||||
call gyp --no-circular-check breakpad_client.gyp --format=ninja
|
||||
cd ..\..
|
||||
ninja -C out/Debug common crash_generation_client exception_handler
|
||||
ninja -C out/Release common crash_generation_client exception_handler
|
||||
cd tools\windows\dump_syms
|
||||
call gyp dump_syms.gyp
|
||||
|
||||
call vcvars32.bat
|
||||
msbuild -m dump_syms.vcxproj /property:Configuration=Release
|
||||
|
||||
- name: Opus cache.
|
||||
id: cache-opus
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/opus
|
||||
key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }}
|
||||
- name: Opus.
|
||||
if: steps.cache-opus.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/telegramdesktop/opus.git
|
||||
cd opus
|
||||
git checkout tdesktop
|
||||
cd win32\VS2015
|
||||
msbuild -m opus.sln /property:Configuration=Debug /property:Platform="Win32"
|
||||
msbuild -m opus.sln /property:Configuration=Release /property:Platform="Win32"
|
||||
|
||||
- name: FFmpeg cache.
|
||||
id: cache-ffmpeg
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/ffmpeg
|
||||
key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}-2-${{ hashFiles('**/build_ffmpeg_win.sh') }}
|
||||
- name: FFmpeg.
|
||||
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
choco install --no-progress -y msys2
|
||||
|
||||
git clone %GIT%/FFmpeg/FFmpeg.git ffmpeg
|
||||
cd ffmpeg
|
||||
git checkout release/4.2
|
||||
set CHERE_INVOKING=enabled_from_arguments
|
||||
set MSYS2_PATH_TYPE=inherit
|
||||
call c:\tools\msys64\usr\bin\bash --login ../patches/build_ffmpeg_win.sh
|
||||
|
||||
rmdir /S /Q .git
|
||||
|
||||
- name: Qt 5.15.2 cache.
|
||||
id: cache-qt
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/Qt-${{ env.QT_VER }}
|
||||
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_15_2/*') }}
|
||||
- name: Configure Qt 5.15.2.
|
||||
if: steps.cache-qt.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone git://code.qt.io/qt/qt5.git qt_%QT%
|
||||
cd qt_%QT%
|
||||
perl init-repository --module-subset=qtbase,qtimageformats
|
||||
git checkout v%QT_VER%
|
||||
git submodule update qtbase
|
||||
git submodule update qtimageformats
|
||||
cd qtbase
|
||||
for /r %%i in (..\..\patches\qtbase_%QT%\*) do git apply %%i
|
||||
cd ..
|
||||
|
||||
SET SSL=%LibrariesPath%\openssl_%OPENSSL_VER%
|
||||
SET LIBS=libcrypto.lib Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib
|
||||
|
||||
configure ^
|
||||
-prefix "%LibrariesPath%\Qt-%QT_VER%" ^
|
||||
-debug ^
|
||||
-force-debug-info ^
|
||||
-opensource ^
|
||||
-confirm-license ^
|
||||
-static ^
|
||||
-static-runtime -I "%SSL%\include" ^
|
||||
-no-opengl ^
|
||||
-openssl-linked ^
|
||||
OPENSSL_LIBS_DEBUG="%SSL%\out32.dbg\libssl.lib %SSL%\out32.dbg\%LIBS%" ^
|
||||
OPENSSL_LIBS_RELEASE="%SSL%\out32\libssl.lib %SSL%\out32\%LIBS%" ^
|
||||
-mp ^
|
||||
-nomake examples ^
|
||||
-nomake tests ^
|
||||
-platform win32-msvc ^
|
||||
-I "%LibrariesPath%\mozjpeg" ^
|
||||
LIBJPEG_LIBS_DEBUG="%LibrariesPath%\mozjpeg\Debug\jpeg-static.lib" ^
|
||||
LIBJPEG_LIBS_RELEASE="%LibrariesPath%\mozjpeg\Release\jpeg-static.lib"
|
||||
- name: Qt 5.15.2 build.
|
||||
if: steps.cache-qt.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
cd qt_%QT%
|
||||
|
||||
jom -j%NUMBER_OF_PROCESSORS%
|
||||
jom -j%NUMBER_OF_PROCESSORS% install
|
||||
|
||||
cd ..
|
||||
rmdir /S /Q qt_%QT%
|
||||
|
||||
- name: WebRTC cache.
|
||||
id: cache-webrtc
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/tg_owt
|
||||
key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }}-${{ hashFiles('**/tg_owt-version.json') }}
|
||||
- name: WebRTC.
|
||||
if: steps.cache-webrtc.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone --recursive %GIT%/desktop-app/tg_owt.git
|
||||
mkdir tg_owt\out\Debug
|
||||
cd tg_owt\out\Debug
|
||||
cmake -G Ninja ^
|
||||
-DCMAKE_BUILD_TYPE=Debug ^
|
||||
-DTG_OWT_SPECIAL_TARGET=win ^
|
||||
-DTG_OWT_LIBJPEG_INCLUDE_PATH=%cd%/../../../mozjpeg ^
|
||||
-DTG_OWT_OPENSSL_INCLUDE_PATH=%cd%/../../../openssl_%OPENSSL_VER%/include ^
|
||||
-DTG_OWT_OPUS_INCLUDE_PATH=%cd%/../../../opus/include ^
|
||||
-DTG_OWT_FFMPEG_INCLUDE_PATH=%cd%/../../../ffmpeg ^
|
||||
../..
|
||||
|
||||
ninja
|
||||
|
||||
:: Cleanup.
|
||||
cd %LibrariesPath%\tg_owt
|
||||
move out\Debug\tg_owt.lib tg_owt.lib
|
||||
rmdir /S /Q out
|
||||
mkdir out\Debug
|
||||
move tg_owt.lib out\Debug\tg_owt.lib
|
||||
|
||||
- name: Read defines.
|
||||
shell: bash
|
||||
run: |
|
||||
DEFINE=""
|
||||
if [ -n "${{ matrix.defines }}" ]; then
|
||||
DEFINE="-D ${{ matrix.defines }}=ON"
|
||||
echo "Define from matrix: $DEFINE"
|
||||
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.defines }}"
|
||||
echo Define from matrix: $DEFINE
|
||||
echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
|
||||
fi
|
||||
echo "TDESKTOP_BUILD_DEFINE=$DEFINE" >> $GITHUB_ENV
|
||||
|
||||
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
|
||||
|
||||
API="-D TDESKTOP_API_TEST=ON"
|
||||
if [ $GITHUB_REF == 'refs/heads/nightly' ]; then
|
||||
echo "Use the open credentials."
|
||||
API="-D TDESKTOP_API_ID=611335 -D TDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
|
||||
fi
|
||||
echo "TDESKTOP_BUILD_API=$API" >> $GITHUB_ENV
|
||||
|
||||
- name: Free up some disk space.
|
||||
run: |
|
||||
cd %TBUILD%
|
||||
del /S Libraries\*.pdb
|
||||
del /S Libraries\*.pch
|
||||
del /S Libraries\*.obj
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
run: |
|
||||
cd %TBUILD%\%REPO_NAME%\Telegram
|
||||
cd %REPO_NAME%\Telegram
|
||||
|
||||
call configure.bat ^
|
||||
%TDESKTOP_BUILD_GENERATOR% ^
|
||||
%TDESKTOP_BUILD_ARCH% ^
|
||||
%TDESKTOP_BUILD_API% ^
|
||||
-D CMAKE_C_FLAGS="/WX" ^
|
||||
-D CMAKE_CXX_FLAGS="/WX" ^
|
||||
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF ^
|
||||
-D TDESKTOP_API_TEST=ON ^
|
||||
-D DESKTOP_APP_USE_PACKAGED=OFF ^
|
||||
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^
|
||||
-D DESKTOP_APP_NO_PDB=ON ^
|
||||
%TDESKTOP_BUILD_DEFINE%
|
||||
%TDESKTOP_BUILD_DEFINE% ^
|
||||
-DCMAKE_SYSTEM_VERSION=%SDK%
|
||||
|
||||
cmake --build ..\out --config Debug --parallel
|
||||
call vcvars32.bat
|
||||
cd ..\out
|
||||
msbuild -m Telegram.sln /nologo /p:Configuration=Debug,Platform=Win32
|
||||
|
||||
- name: Move artifact.
|
||||
if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly')
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
set OUT=%TBUILD%\%REPO_NAME%\out\Debug
|
||||
cd %REPO_NAME%\out\Debug
|
||||
mkdir artifact
|
||||
move %OUT%\Telegram.exe artifact/
|
||||
move %OUT%\Updater.exe artifact/
|
||||
- uses: actions/upload-artifact@v4
|
||||
move Telegram.exe artifact/
|
||||
- uses: actions/upload-artifact@master
|
||||
name: Upload artifact.
|
||||
if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly')
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
with:
|
||||
name: ${{ env.ARTIFACT_NAME }}
|
||||
path: artifact\
|
||||
path: ${{ env.REPO_NAME }}\out\Debug\artifact\
|
||||
|
||||
20
.github/workflows/winget.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Publish to WinGet
|
||||
on:
|
||||
release:
|
||||
types: [released, prereleased]
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest # action can only be run on windows
|
||||
steps:
|
||||
- if: github.event.action == 'released'
|
||||
uses: telegramdesktop/winget-releaser@main
|
||||
with:
|
||||
identifier: Telegram.TelegramDesktop
|
||||
installers-regex: 't(setup|portable).*(exe|zip)$'
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
- if: github.event.action == 'prereleased'
|
||||
uses: telegramdesktop/winget-releaser@main
|
||||
with:
|
||||
identifier: Telegram.TelegramDesktop.Beta
|
||||
installers-regex: 't(setup|portable).*(exe|zip)$'
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
3
.gitignore
vendored
@@ -18,7 +18,6 @@ Release/
|
||||
*.xcodeproj
|
||||
ipch/
|
||||
.vs/
|
||||
.vscode/
|
||||
|
||||
/Telegram/log.txt
|
||||
/Telegram/data
|
||||
@@ -49,5 +48,3 @@ stage
|
||||
/Linux/
|
||||
/Telegram/Makefile
|
||||
*.*~
|
||||
.idea/
|
||||
cmake-build-debug/
|
||||
|
||||
36
.gitmodules
vendored
@@ -4,6 +4,9 @@
|
||||
[submodule "Telegram/ThirdParty/GSL"]
|
||||
path = Telegram/ThirdParty/GSL
|
||||
url = https://github.com/Microsoft/GSL.git
|
||||
[submodule "Telegram/ThirdParty/Catch"]
|
||||
path = Telegram/ThirdParty/Catch
|
||||
url = https://github.com/philsquared/Catch
|
||||
[submodule "Telegram/ThirdParty/xxHash"]
|
||||
path = Telegram/ThirdParty/xxHash
|
||||
url = https://github.com/Cyan4973/xxHash.git
|
||||
@@ -28,6 +31,9 @@
|
||||
[submodule "Telegram/lib_ui"]
|
||||
path = Telegram/lib_ui
|
||||
url = https://github.com/desktop-app/lib_ui.git
|
||||
[submodule "Telegram/lib_rlottie"]
|
||||
path = Telegram/lib_rlottie
|
||||
url = https://github.com/desktop-app/lib_rlottie.git
|
||||
[submodule "Telegram/lib_lottie"]
|
||||
path = Telegram/lib_lottie
|
||||
url = https://github.com/desktop-app/lib_lottie.git
|
||||
@@ -52,18 +58,27 @@
|
||||
[submodule "Telegram/lib_qr"]
|
||||
path = Telegram/lib_qr
|
||||
url = https://github.com/desktop-app/lib_qr.git
|
||||
[submodule "Telegram/ThirdParty/libdbusmenu-qt"]
|
||||
path = Telegram/ThirdParty/libdbusmenu-qt
|
||||
url = https://github.com/desktop-app/libdbusmenu-qt.git
|
||||
[submodule "Telegram/ThirdParty/hunspell"]
|
||||
path = Telegram/ThirdParty/hunspell
|
||||
url = https://github.com/hunspell/hunspell
|
||||
[submodule "Telegram/ThirdParty/range-v3"]
|
||||
path = Telegram/ThirdParty/range-v3
|
||||
url = https://github.com/ericniebler/range-v3.git
|
||||
[submodule "Telegram/ThirdParty/fcitx-qt5"]
|
||||
path = Telegram/ThirdParty/fcitx-qt5
|
||||
url = https://github.com/fcitx/fcitx-qt5.git
|
||||
[submodule "Telegram/ThirdParty/nimf"]
|
||||
path = Telegram/ThirdParty/nimf
|
||||
url = https://github.com/hamonikr/nimf.git
|
||||
[submodule "Telegram/ThirdParty/hime"]
|
||||
path = Telegram/ThirdParty/hime
|
||||
url = https://github.com/hime-ime/hime.git
|
||||
[submodule "Telegram/ThirdParty/qt5ct"]
|
||||
path = Telegram/ThirdParty/qt5ct
|
||||
url = https://github.com/desktop-app/qt5ct.git
|
||||
[submodule "Telegram/ThirdParty/fcitx5-qt"]
|
||||
path = Telegram/ThirdParty/fcitx5-qt
|
||||
url = https://github.com/fcitx/fcitx5-qt.git
|
||||
@@ -76,24 +91,3 @@
|
||||
[submodule "Telegram/lib_webview"]
|
||||
path = Telegram/lib_webview
|
||||
url = https://github.com/desktop-app/lib_webview.git
|
||||
[submodule "Telegram/ThirdParty/jemalloc"]
|
||||
path = Telegram/ThirdParty/jemalloc
|
||||
url = https://github.com/jemalloc/jemalloc
|
||||
[submodule "Telegram/ThirdParty/dispatch"]
|
||||
path = Telegram/ThirdParty/dispatch
|
||||
url = https://github.com/apple/swift-corelibs-libdispatch
|
||||
[submodule "Telegram/ThirdParty/kimageformats"]
|
||||
path = Telegram/ThirdParty/kimageformats
|
||||
url = https://github.com/KDE/kimageformats.git
|
||||
[submodule "Telegram/ThirdParty/kcoreaddons"]
|
||||
path = Telegram/ThirdParty/kcoreaddons
|
||||
url = https://github.com/KDE/kcoreaddons.git
|
||||
[submodule "Telegram/ThirdParty/cld3"]
|
||||
path = Telegram/ThirdParty/cld3
|
||||
url = https://github.com/google/cld3.git
|
||||
[submodule "Telegram/ThirdParty/libprisma"]
|
||||
path = Telegram/ThirdParty/libprisma
|
||||
url = https://github.com/desktop-app/libprisma.git
|
||||
[submodule "Telegram/ThirdParty/xdg-desktop-portal"]
|
||||
path = Telegram/ThirdParty/xdg-desktop-portal
|
||||
url = https://github.com/flatpak/xdg-desktop-portal.git
|
||||
|
||||
@@ -4,15 +4,9 @@
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
if (APPLE)
|
||||
# target_precompile_headers with COMPILE_LANGUAGE restriction.
|
||||
cmake_minimum_required(VERSION 3.23)
|
||||
else()
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
endif()
|
||||
if (POLICY CMP0149)
|
||||
cmake_policy(SET CMP0149 NEW)
|
||||
endif()
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
cmake_policy(SET CMP0076 NEW)
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
@@ -20,15 +14,8 @@ include(cmake/validate_special_target.cmake)
|
||||
include(cmake/version.cmake)
|
||||
desktop_app_parse_version(Telegram/build/version)
|
||||
|
||||
set(project_langs C CXX)
|
||||
if (APPLE)
|
||||
list(APPEND project_langs OBJC OBJCXX)
|
||||
elseif (LINUX)
|
||||
list(APPEND project_langs ASM)
|
||||
endif()
|
||||
|
||||
project(Telegram
|
||||
LANGUAGES ${project_langs}
|
||||
LANGUAGES C CXX
|
||||
VERSION ${desktop_app_version_cmake}
|
||||
DESCRIPTION "Official Telegram Desktop messenger"
|
||||
HOMEPAGE_URL "https://desktop.telegram.org"
|
||||
@@ -37,30 +24,19 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT T
|
||||
|
||||
get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH)
|
||||
get_filename_component(submodules_loc "Telegram" REALPATH)
|
||||
get_filename_component(cmake_helpers_loc "cmake" REALPATH)
|
||||
|
||||
if (NOT DESKTOP_APP_USE_PACKAGED AND WIN32)
|
||||
set(Python3_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/python/Scripts/python)
|
||||
endif()
|
||||
|
||||
include(cmake/variables.cmake)
|
||||
include(cmake/nice_target_sources.cmake)
|
||||
include(cmake/target_compile_options_if_exists.cmake)
|
||||
include(cmake/target_link_frameworks.cmake)
|
||||
include(cmake/target_link_optional_libraries.cmake)
|
||||
include(cmake/target_link_options_if_exists.cmake)
|
||||
include(cmake/target_link_static_libraries.cmake)
|
||||
include(cmake/target_link_frameworks.cmake)
|
||||
include(cmake/init_target.cmake)
|
||||
include(cmake/generate_target.cmake)
|
||||
include(cmake/nuget.cmake)
|
||||
include(cmake/validate_d3d_compiler.cmake)
|
||||
include(cmake/target_prepare_qrc.cmake)
|
||||
|
||||
include(cmake/options.cmake)
|
||||
|
||||
include(cmake/external/qt/package.cmake)
|
||||
|
||||
set(desktop_app_skip_libs
|
||||
glibmm
|
||||
variant
|
||||
)
|
||||
|
||||
|
||||
2
LEGAL
@@ -1,7 +1,7 @@
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
Copyright (c) 2014-2024 The Telegram Desktop Authors.
|
||||
Copyright (c) 2014-2021 The Telegram Desktop Authors.
|
||||
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
36
README.md
@@ -1,6 +1,6 @@
|
||||
# [Telegram Desktop][telegram_desktop] – Official Messenger
|
||||
|
||||
This is the complete source code and the build instructions for the official [Telegram][telegram] messenger desktop client, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol.
|
||||
This is the complete source code and the build instructions for the alpha version of the official desktop client for the [Telegram][telegram] messenger, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol.
|
||||
|
||||
[](https://github.com/telegramdesktop/tdesktop/releases)
|
||||
[](https://github.com/telegramdesktop/tdesktop/actions)
|
||||
@@ -15,20 +15,14 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
|
||||
|
||||
The latest version is available for
|
||||
|
||||
* [Windows 7 and above (64 bit)](https://telegram.org/dl/desktop/win64) ([portable](https://telegram.org/dl/desktop/win64_portable))
|
||||
* [Windows 7 and above (32 bit)](https://telegram.org/dl/desktop/win) ([portable](https://telegram.org/dl/desktop/win_portable))
|
||||
* [macOS 10.13 and above](https://telegram.org/dl/desktop/mac)
|
||||
* [Windows 7 and above](https://telegram.org/dl/desktop/win) ([portable](https://telegram.org/dl/desktop/win_portable))
|
||||
* [macOS 10.12 and above](https://telegram.org/dl/desktop/mac)
|
||||
* [Linux static build for 64 bit](https://telegram.org/dl/desktop/linux)
|
||||
* [Snap](https://snapcraft.io/telegram-desktop)
|
||||
* [Flatpak](https://flathub.org/apps/details/org.telegram.desktop)
|
||||
|
||||
## Old system versions
|
||||
|
||||
Version **4.9.9** was the last that supports older systems
|
||||
|
||||
* [macOS 10.12](https://updates.tdesktop.com/tmac/tsetup.4.9.9.dmg)
|
||||
* [Linux with glibc < 2.28 static build](https://updates.tdesktop.com/tlinux/tsetup.4.9.9.tar.xz)
|
||||
|
||||
Version **2.4.4** was the last that supports older systems
|
||||
|
||||
* [OS X 10.10 and 10.11](https://updates.tdesktop.com/tosx/tsetup-osx.2.4.4.dmg)
|
||||
@@ -42,8 +36,8 @@ Version **1.8.15** was the last that supports older systems
|
||||
|
||||
## Third-party
|
||||
|
||||
* Qt 6 ([LGPL](http://doc.qt.io/qt-6/lgpl.html)) and Qt 5.15 ([LGPL](http://doc.qt.io/qt-5/lgpl.html)) slightly patched
|
||||
* OpenSSL 3.2.1 ([Apache License 2.0](https://www.openssl.org/source/apache-license-2.0.txt))
|
||||
* Qt 5.15.2, 5.6.2 and 5.3.2 slightly patched ([LGPL](http://doc.qt.io/qt-5/lgpl.html))
|
||||
* OpenSSL 1.1.1 and 1.0.1 ([OpenSSL License](https://www.openssl.org/source/license.html))
|
||||
* WebRTC ([New BSD License](https://github.com/desktop-app/tg_owt/blob/master/LICENSE))
|
||||
* zlib 1.2.11 ([zlib License](http://www.zlib.net/zlib_license.html))
|
||||
* LZMA SDK 9.20 ([public domain](http://www.7-zip.org/sdk.html))
|
||||
@@ -58,19 +52,19 @@ Version **1.8.15** was the last that supports older systems
|
||||
* Guideline Support Library ([MIT License](https://github.com/Microsoft/GSL/blob/master/LICENSE))
|
||||
* Range-v3 ([Boost License](https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt))
|
||||
* Open Sans font ([Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html))
|
||||
* Vazir font ([SIL Open Font License 1.1](https://github.com/rastikerdar/vazir-font/blob/master/OFL.txt))
|
||||
* Vazir font ([License](https://github.com/rastikerdar/vazir-font/blob/master/LICENSE))
|
||||
* Emoji alpha codes ([MIT License](https://github.com/emojione/emojione/blob/master/extras/alpha-codes/LICENSE.md))
|
||||
* Catch test framework ([Boost License](https://github.com/philsquared/Catch/blob/master/LICENSE.txt))
|
||||
* xxHash ([BSD License](https://github.com/Cyan4973/xxHash/blob/dev/LICENSE))
|
||||
* QR Code generator ([MIT License](https://github.com/nayuki/QR-Code-generator#license))
|
||||
* CMake ([New BSD License](https://github.com/Kitware/CMake/blob/master/Copyright.txt))
|
||||
* Hunspell ([LGPL](https://github.com/hunspell/hunspell/blob/master/COPYING.LESSER))
|
||||
* Ada ([Apache License 2.0](https://github.com/ada-url/ada/blob/main/LICENSE-APACHE))
|
||||
* Hunspell ([GPL](https://github.com/hunspell/hunspell/blob/master/COPYING))
|
||||
|
||||
## Build instructions
|
||||
|
||||
* Windows [(32-bit)][win32] [(64-bit)][win64]
|
||||
* [macOS][mac]
|
||||
* [GNU/Linux using Docker][linux]
|
||||
* [Visual Studio 2019][msvc]
|
||||
* [Xcode 12][xcode]
|
||||
* [CMake on GNU/Linux][cmake]
|
||||
|
||||
[//]: # (LINKS)
|
||||
[telegram]: https://telegram.org
|
||||
@@ -78,9 +72,9 @@ Version **1.8.15** was the last that supports older systems
|
||||
[telegram_api]: https://core.telegram.org
|
||||
[telegram_proto]: https://core.telegram.org/mtproto
|
||||
[license]: LICENSE
|
||||
[win32]: docs/building-win.md
|
||||
[win64]: docs/building-win-x64.md
|
||||
[mac]: docs/building-mac.md
|
||||
[linux]: docs/building-linux.md
|
||||
[msvc]: docs/building-msvc.md
|
||||
[xcode]: docs/building-xcode.md
|
||||
[xcode_old]: docs/building-xcode-old.md
|
||||
[cmake]: docs/building-cmake.md
|
||||
[preview_image]: https://github.com/telegramdesktop/tdesktop/blob/dev/docs/assets/preview.png "Preview of Telegram Desktop"
|
||||
[preview_image_url]: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/docs/assets/preview.png
|
||||
|
||||
651
Telegram/Patches/breakpad.diff
Normal file
@@ -0,0 +1,651 @@
|
||||
diff --git a/src/build/common.gypi b/src/build/common.gypi
|
||||
index 29990c65..53e99d44 100644
|
||||
--- a/src/build/common.gypi
|
||||
+++ b/src/build/common.gypi
|
||||
@@ -330,6 +330,7 @@
|
||||
'VCCLCompilerTool': {
|
||||
'WarnAsError': 'true',
|
||||
'Detect64BitPortabilityProblems': 'false',
|
||||
+ 'TreatWChar_tAsBuiltInType': 'false',
|
||||
},
|
||||
},
|
||||
}],
|
||||
diff --git a/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
|
||||
index 1a93ce6d..b5986e33 100644
|
||||
--- a/src/client/mac/Breakpad.xcodeproj/project.pbxproj
|
||||
+++ b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
|
||||
@@ -35,6 +35,19 @@
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
+ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; };
|
||||
+ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
|
||||
+ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
|
||||
+ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
|
||||
+ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
|
||||
+ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
|
||||
+ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
|
||||
+ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
|
||||
+ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; };
|
||||
+ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
|
||||
+ 0748C04E1C63C51C004489BF /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; };
|
||||
+ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
|
||||
+ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
|
||||
162F64F2161C577500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; };
|
||||
162F64F3161C577500CD68D5 /* arch_utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 162F64F1161C577500CD68D5 /* arch_utilities.h */; };
|
||||
162F64F4161C579B00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; };
|
||||
@@ -67,6 +80,7 @@
|
||||
4DBE49A7134A4F280072546A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DBE4769134A4F080072546A /* CoreServices.framework */; };
|
||||
4DBE49A8134A4F380072546A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DBE4769134A4F080072546A /* CoreServices.framework */; };
|
||||
4DBE49A9134A4F460072546A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DBE4769134A4F080072546A /* CoreServices.framework */; };
|
||||
+ 5A8B220921E0C5740045F83C /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; };
|
||||
8B3101C611F0CD9F00FCF3E4 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
|
||||
8B3101C711F0CD9F00FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
|
||||
8B3101CA11F0CDB000FCF3E4 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
|
||||
@@ -170,11 +184,8 @@
|
||||
F92C564A0ECD10CA009BE4BA /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
|
||||
F92C564C0ECD10DD009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
|
||||
F92C56570ECD113E009BE4BA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C554A0ECCF530009BE4BA /* Carbon.framework */; };
|
||||
- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
|
||||
F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */; };
|
||||
F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
|
||||
- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
|
||||
- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */ = {isa = PBXBuildFile; fileRef = F92C53540ECCE349009BE4BA /* Inspector */; };
|
||||
F92C56A90ECE04C5009BE4BA /* crash_report_sender.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */; };
|
||||
F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
|
||||
F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
|
||||
@@ -213,7 +224,6 @@
|
||||
F9C44DBD0EF072A0003AEBAA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */; };
|
||||
F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; };
|
||||
F9C44E3C0EF08B12003AEBAA /* Breakpad.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; };
|
||||
- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */ = {isa = PBXBuildFile; fileRef = F92C56A00ECE04A7009BE4BA /* crash_report_sender.app */; };
|
||||
F9C44EA20EF09F93003AEBAA /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */; };
|
||||
F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */; };
|
||||
F9C44EE90EF0A3C1003AEBAA /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */; };
|
||||
@@ -410,20 +420,6 @@
|
||||
remoteGlobalIDString = F92C563B0ECD10B3009BE4BA;
|
||||
remoteInfo = breakpadUtilities;
|
||||
};
|
||||
- F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */ = {
|
||||
- isa = PBXContainerItemProxy;
|
||||
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
- proxyType = 1;
|
||||
- remoteGlobalIDString = F92C563B0ECD10B3009BE4BA;
|
||||
- remoteInfo = breakpadUtilities;
|
||||
- };
|
||||
- F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */ = {
|
||||
- isa = PBXContainerItemProxy;
|
||||
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
- proxyType = 1;
|
||||
- remoteGlobalIDString = F92C53530ECCE349009BE4BA;
|
||||
- remoteInfo = Inspector;
|
||||
- };
|
||||
F93DE2FB0F82C3C600608B94 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
@@ -536,13 +532,6 @@
|
||||
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
|
||||
remoteInfo = Breakpad;
|
||||
};
|
||||
- F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */ = {
|
||||
- isa = PBXContainerItemProxy;
|
||||
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
- proxyType = 1;
|
||||
- remoteGlobalIDString = F92C569F0ECE04A7009BE4BA;
|
||||
- remoteInfo = crash_report_sender;
|
||||
- };
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@@ -714,7 +703,6 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */,
|
||||
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -1181,18 +1169,13 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */;
|
||||
buildPhases = (
|
||||
- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */,
|
||||
8DC2EF500486A6940098B216 /* Headers */,
|
||||
- 8DC2EF520486A6940098B216 /* Resources */,
|
||||
8DC2EF540486A6940098B216 /* Sources */,
|
||||
8DC2EF560486A6940098B216 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */,
|
||||
- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */,
|
||||
- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */,
|
||||
);
|
||||
name = Breakpad;
|
||||
productInstallPath = "$(HOME)/Library/Frameworks";
|
||||
@@ -1399,6 +1382,8 @@
|
||||
/* Begin PBXProject section */
|
||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
+ attributes = {
|
||||
+ };
|
||||
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */;
|
||||
compatibilityVersion = "Xcode 3.1";
|
||||
developmentRegion = English;
|
||||
@@ -1583,16 +1568,6 @@
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
- 8DC2EF520486A6940098B216 /* Resources */ = {
|
||||
- isa = PBXResourcesBuildPhase;
|
||||
- buildActionMask = 2147483647;
|
||||
- files = (
|
||||
- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */,
|
||||
- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */,
|
||||
- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */,
|
||||
- );
|
||||
- runOnlyForDeploymentPostprocessing = 0;
|
||||
- };
|
||||
F92C569C0ECE04A7009BE4BA /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -1640,20 +1615,6 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "install_name_tool -id \"@executable_path/../Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n";
|
||||
};
|
||||
- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */ = {
|
||||
- isa = PBXShellScriptBuildPhase;
|
||||
- buildActionMask = 2147483647;
|
||||
- files = (
|
||||
- );
|
||||
- inputPaths = (
|
||||
- );
|
||||
- name = "Change install name of breakpadUtilities";
|
||||
- outputPaths = (
|
||||
- );
|
||||
- runOnlyForDeploymentPostprocessing = 0;
|
||||
- shellPath = /bin/sh;
|
||||
- shellScript = "#!/bin/bash\ninstall_name_tool -id \"@executable_path/../Frameworks/Breakpad.framework/Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n";
|
||||
- };
|
||||
F9C77DD80F7DD5CF0045F7DB /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -1674,6 +1635,20 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
+ 5A8B220921E0C5740045F83C /* breakpad_nlist_64.cc in Sources */,
|
||||
+ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */,
|
||||
+ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */,
|
||||
+ 0748C04E1C63C51C004489BF /* md5.cc in Sources */,
|
||||
+ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */,
|
||||
+ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */,
|
||||
+ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */,
|
||||
+ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */,
|
||||
+ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */,
|
||||
+ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */,
|
||||
+ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */,
|
||||
+ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */,
|
||||
+ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */,
|
||||
+ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */,
|
||||
F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */,
|
||||
F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */,
|
||||
F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */,
|
||||
@@ -1955,16 +1930,6 @@
|
||||
target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
|
||||
targetProxy = F92C564D0ECD10E5009BE4BA /* PBXContainerItemProxy */;
|
||||
};
|
||||
- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */ = {
|
||||
- isa = PBXTargetDependency;
|
||||
- target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
|
||||
- targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */;
|
||||
- };
|
||||
- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */ = {
|
||||
- isa = PBXTargetDependency;
|
||||
- target = F92C53530ECCE349009BE4BA /* Inspector */;
|
||||
- targetProxy = F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */;
|
||||
- };
|
||||
F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = F93803BD0F80820F004D428B /* generator_test */;
|
||||
@@ -2025,11 +1990,6 @@
|
||||
target = 8DC2EF4F0486A6940098B216 /* Breakpad */;
|
||||
targetProxy = F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */;
|
||||
};
|
||||
- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */ = {
|
||||
- isa = PBXTargetDependency;
|
||||
- target = F92C569F0ECE04A7009BE4BA /* crash_report_sender */;
|
||||
- targetProxy = F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */;
|
||||
- };
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
@@ -2126,8 +2086,12 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
|
||||
buildSettings = {
|
||||
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
+ CLANG_CXX_LIBRARY = "libc++";
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
- SDKROOT = macosx10.5;
|
||||
+ GCC_VERSION = "";
|
||||
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
+ SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -2135,7 +2099,12 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */;
|
||||
buildSettings = {
|
||||
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
+ CLANG_CXX_LIBRARY = "libc++";
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
+ GCC_VERSION = "";
|
||||
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
+ SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -2454,7 +2423,12 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
|
||||
buildSettings = {
|
||||
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
+ CLANG_CXX_LIBRARY = "libc++";
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
+ GCC_VERSION = "";
|
||||
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
+ SDKROOT = macosx;
|
||||
};
|
||||
name = "Debug With Code Coverage";
|
||||
};
|
||||
diff --git a/src/client/mac/Framework/Breakpad.mm b/src/client/mac/Framework/Breakpad.mm
|
||||
index 1d2e519b..943310fa 100644
|
||||
--- a/src/client/mac/Framework/Breakpad.mm
|
||||
+++ b/src/client/mac/Framework/Breakpad.mm
|
||||
@@ -355,10 +355,10 @@ bool Breakpad::Initialize(NSDictionary *parameters) {
|
||||
return false;
|
||||
}
|
||||
|
||||
- if ([[parameters objectForKey:@BREAKPAD_IN_PROCESS] boolValue])
|
||||
+// if ([[parameters objectForKey:@BREAKPAD_IN_PROCESS] boolValue])
|
||||
return InitializeInProcess(parameters);
|
||||
- else
|
||||
- return InitializeOutOfProcess(parameters);
|
||||
+// else
|
||||
+// return InitializeOutOfProcess(parameters);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@@ -373,52 +373,52 @@ bool Breakpad::InitializeInProcess(NSDictionary* parameters) {
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
-bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) {
|
||||
- // Get path to Inspector executable.
|
||||
- NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION);
|
||||
-
|
||||
- // Standardize path (resolve symlinkes, etc.) and escape spaces
|
||||
- inspectorPathString = [inspectorPathString stringByStandardizingPath];
|
||||
- inspectorPathString = [[inspectorPathString componentsSeparatedByString:@" "]
|
||||
- componentsJoinedByString:@"\\ "];
|
||||
-
|
||||
- // Create an on-demand server object representing the Inspector.
|
||||
- // In case of a crash, we simply need to call the LaunchOnDemand()
|
||||
- // method on it, then send a mach message to its service port.
|
||||
- // It will then launch and perform a process inspection of our crashed state.
|
||||
- // See the HandleException() method for the details.
|
||||
-#define RECEIVE_PORT_NAME "com.Breakpad.Inspector"
|
||||
-
|
||||
- name_t portName;
|
||||
- snprintf(portName, sizeof(name_t), "%s%d", RECEIVE_PORT_NAME, getpid());
|
||||
-
|
||||
- // Save the location of the Inspector
|
||||
- strlcpy(inspector_path_, [inspectorPathString fileSystemRepresentation],
|
||||
- sizeof(inspector_path_));
|
||||
-
|
||||
- // Append a single command-line argument to the Inspector path
|
||||
- // representing the bootstrap name of the launch-on-demand receive port.
|
||||
- // When the Inspector is launched, it can use this to lookup the port
|
||||
- // by calling bootstrap_check_in().
|
||||
- strlcat(inspector_path_, " ", sizeof(inspector_path_));
|
||||
- strlcat(inspector_path_, portName, sizeof(inspector_path_));
|
||||
-
|
||||
- kern_return_t kr = inspector_.Initialize(inspector_path_,
|
||||
- portName,
|
||||
- true); // shutdown on exit
|
||||
-
|
||||
- if (kr != KERN_SUCCESS) {
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- // Create the handler (allocating it in our special protected pool)
|
||||
- handler_ =
|
||||
- new (gBreakpadAllocator->Allocate(
|
||||
- sizeof(google_breakpad::ExceptionHandler)))
|
||||
- google_breakpad::ExceptionHandler(
|
||||
- Breakpad::ExceptionHandlerDirectCallback, this, true);
|
||||
- return true;
|
||||
-}
|
||||
+//bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) {
|
||||
+// // Get path to Inspector executable.
|
||||
+// NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION);
|
||||
+//
|
||||
+// // Standardize path (resolve symlinkes, etc.) and escape spaces
|
||||
+// inspectorPathString = [inspectorPathString stringByStandardizingPath];
|
||||
+// inspectorPathString = [[inspectorPathString componentsSeparatedByString:@" "]
|
||||
+// componentsJoinedByString:@"\\ "];
|
||||
+//
|
||||
+// // Create an on-demand server object representing the Inspector.
|
||||
+// // In case of a crash, we simply need to call the LaunchOnDemand()
|
||||
+// // method on it, then send a mach message to its service port.
|
||||
+// // It will then launch and perform a process inspection of our crashed state.
|
||||
+// // See the HandleException() method for the details.
|
||||
+//#define RECEIVE_PORT_NAME "com.Breakpad.Inspector"
|
||||
+//
|
||||
+// name_t portName;
|
||||
+// snprintf(portName, sizeof(name_t), "%s%d", RECEIVE_PORT_NAME, getpid());
|
||||
+//
|
||||
+// // Save the location of the Inspector
|
||||
+// strlcpy(inspector_path_, [inspectorPathString fileSystemRepresentation],
|
||||
+// sizeof(inspector_path_));
|
||||
+//
|
||||
+// // Append a single command-line argument to the Inspector path
|
||||
+// // representing the bootstrap name of the launch-on-demand receive port.
|
||||
+// // When the Inspector is launched, it can use this to lookup the port
|
||||
+// // by calling bootstrap_check_in().
|
||||
+// strlcat(inspector_path_, " ", sizeof(inspector_path_));
|
||||
+// strlcat(inspector_path_, portName, sizeof(inspector_path_));
|
||||
+//
|
||||
+// kern_return_t kr = inspector_.Initialize(inspector_path_,
|
||||
+// portName,
|
||||
+// true); // shutdown on exit
|
||||
+//
|
||||
+// if (kr != KERN_SUCCESS) {
|
||||
+// return false;
|
||||
+// }
|
||||
+//
|
||||
+// // Create the handler (allocating it in our special protected pool)
|
||||
+// handler_ =
|
||||
+// new (gBreakpadAllocator->Allocate(
|
||||
+// sizeof(google_breakpad::ExceptionHandler)))
|
||||
+// google_breakpad::ExceptionHandler(
|
||||
+// Breakpad::ExceptionHandlerDirectCallback, this, true);
|
||||
+// return true;
|
||||
+//}
|
||||
|
||||
//=============================================================================
|
||||
Breakpad::~Breakpad() {
|
||||
@@ -445,10 +445,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
|
||||
NSString *version = [parameters objectForKey:@BREAKPAD_VERSION];
|
||||
NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL];
|
||||
NSString *interval = [parameters objectForKey:@BREAKPAD_REPORT_INTERVAL];
|
||||
- NSString *inspectorPathString =
|
||||
- [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION];
|
||||
- NSString *reporterPathString =
|
||||
- [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION];
|
||||
+// NSString *inspectorPathString =
|
||||
+// [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION];
|
||||
+// NSString *reporterPathString =
|
||||
+// [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION];
|
||||
NSString *timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT];
|
||||
NSArray *logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES];
|
||||
NSString *logFileTailSize =
|
||||
@@ -536,39 +536,39 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
|
||||
}
|
||||
|
||||
// Find the helper applications if not specified in user config.
|
||||
- NSString *resourcePath = nil;
|
||||
- if (!inspectorPathString || !reporterPathString) {
|
||||
- resourcePath = GetResourcePath();
|
||||
- if (!resourcePath) {
|
||||
- return false;
|
||||
- }
|
||||
- }
|
||||
+// NSString *resourcePath = nil;
|
||||
+// if (!inspectorPathString || !reporterPathString) {
|
||||
+// resourcePath = GetResourcePath();
|
||||
+// if (!resourcePath) {
|
||||
+// return false;
|
||||
+// }
|
||||
+// }
|
||||
|
||||
// Find Inspector.
|
||||
- if (!inspectorPathString) {
|
||||
- inspectorPathString =
|
||||
- [resourcePath stringByAppendingPathComponent:@"Inspector"];
|
||||
- }
|
||||
-
|
||||
- // Verify that there is an Inspector tool.
|
||||
- if (![[NSFileManager defaultManager] fileExistsAtPath:inspectorPathString]) {
|
||||
- return false;
|
||||
- }
|
||||
+// if (!inspectorPathString) {
|
||||
+// inspectorPathString =
|
||||
+// [resourcePath stringByAppendingPathComponent:@"Inspector"];
|
||||
+// }
|
||||
+//
|
||||
+// // Verify that there is an Inspector tool.
|
||||
+// if (![[NSFileManager defaultManager] fileExistsAtPath:inspectorPathString]) {
|
||||
+// return false;
|
||||
+// }
|
||||
|
||||
// Find Reporter.
|
||||
- if (!reporterPathString) {
|
||||
- reporterPathString =
|
||||
- [resourcePath
|
||||
- stringByAppendingPathComponent:@"crash_report_sender.app"];
|
||||
- reporterPathString =
|
||||
- [[NSBundle bundleWithPath:reporterPathString] executablePath];
|
||||
- }
|
||||
+// if (!reporterPathString) {
|
||||
+// reporterPathString =
|
||||
+// [resourcePath
|
||||
+// stringByAppendingPathComponent:@"crash_report_sender.app"];
|
||||
+// reporterPathString =
|
||||
+// [[NSBundle bundleWithPath:reporterPathString] executablePath];
|
||||
+// }
|
||||
|
||||
// Verify that there is a Reporter application.
|
||||
- if (![[NSFileManager defaultManager]
|
||||
- fileExistsAtPath:reporterPathString]) {
|
||||
- return false;
|
||||
- }
|
||||
+// if (![[NSFileManager defaultManager]
|
||||
+// fileExistsAtPath:reporterPathString]) {
|
||||
+// return false;
|
||||
+// }
|
||||
|
||||
if (!dumpSubdirectory) {
|
||||
dumpSubdirectory = @"";
|
||||
@@ -601,10 +601,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
|
||||
dictionary.SetKeyValue(BREAKPAD_REPORT_INTERVAL, [interval UTF8String]);
|
||||
dictionary.SetKeyValue(BREAKPAD_SKIP_CONFIRM, [skipConfirm UTF8String]);
|
||||
dictionary.SetKeyValue(BREAKPAD_CONFIRM_TIMEOUT, [timeout UTF8String]);
|
||||
- dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION,
|
||||
- [inspectorPathString fileSystemRepresentation]);
|
||||
- dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION,
|
||||
- [reporterPathString fileSystemRepresentation]);
|
||||
+// dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION,
|
||||
+// [inspectorPathString fileSystemRepresentation]);
|
||||
+// dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION,
|
||||
+// [reporterPathString fileSystemRepresentation]);
|
||||
dictionary.SetKeyValue(BREAKPAD_LOGFILE_UPLOAD_SIZE,
|
||||
[logFileTailSize UTF8String]);
|
||||
dictionary.SetKeyValue(BREAKPAD_REQUEST_COMMENTS,
|
||||
@@ -762,9 +762,9 @@ bool Breakpad::HandleException(int exception_type,
|
||||
bool Breakpad::HandleMinidump(const char *dump_dir, const char *minidump_id) {
|
||||
google_breakpad::ConfigFile config_file;
|
||||
config_file.WriteFile(dump_dir, config_params_, dump_dir, minidump_id);
|
||||
- google_breakpad::LaunchReporter(
|
||||
- config_params_->GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION),
|
||||
- config_file.GetFilePath());
|
||||
+// google_breakpad::LaunchReporter(
|
||||
+// config_params_->GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION),
|
||||
+// config_file.GetFilePath());
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/src/common/language.cc b/src/common/language.cc
|
||||
index 978fb855..a95ae5f7 100644
|
||||
--- a/src/common/language.cc
|
||||
+++ b/src/common/language.cc
|
||||
@@ -46,8 +46,27 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
+#include <cstdio>
|
||||
+#include <iostream>
|
||||
+#include <memory>
|
||||
+#include <stdexcept>
|
||||
+#include <string>
|
||||
+#include <array>
|
||||
+
|
||||
namespace {
|
||||
|
||||
+std::string exec(std::string cmd) {
|
||||
+ std::array<char, 128> buffer;
|
||||
+ std::string result;
|
||||
+ std::shared_ptr<FILE> pipe(popen(cmd.c_str(), "r"), pclose);
|
||||
+ if (!pipe) throw std::runtime_error("popen() failed!");
|
||||
+ while (!feof(pipe.get())) {
|
||||
+ if (fgets(buffer.data(), 128, pipe.get()) != nullptr)
|
||||
+ result += buffer.data();
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
string MakeQualifiedNameWithSeparator(const string& parent_name,
|
||||
const char* separator,
|
||||
const string& name) {
|
||||
@@ -79,11 +98,29 @@ class CPPLanguage: public Language {
|
||||
demangled->clear();
|
||||
return kDontDemangle;
|
||||
#else
|
||||
+ DemangleResult result;
|
||||
+ if (mangled.find("type_erased_handlers") != std::string::npos
|
||||
+ && mangled.find("vtable_once_impl") != std::string::npos) {
|
||||
+
|
||||
+ auto demangled_str = exec("c++filt " + mangled);
|
||||
+ if (!demangled_str.empty() && demangled_str.back() == '\n') {
|
||||
+ demangled_str.pop_back();
|
||||
+ }
|
||||
+ if (demangled_str != mangled) {
|
||||
+ result = kDemangleSuccess;
|
||||
+ demangled->assign(demangled_str.c_str());
|
||||
+ } else {
|
||||
+ result = kDemangleFailure;
|
||||
+ demangled->clear();
|
||||
+ }
|
||||
+
|
||||
+ } else {
|
||||
+
|
||||
int status;
|
||||
char* demangled_c =
|
||||
abi::__cxa_demangle(mangled.c_str(), NULL, NULL, &status);
|
||||
|
||||
- DemangleResult result;
|
||||
+// DemangleResult result;
|
||||
if (status == 0) {
|
||||
result = kDemangleSuccess;
|
||||
demangled->assign(demangled_c);
|
||||
@@ -96,6 +133,8 @@ class CPPLanguage: public Language {
|
||||
free(reinterpret_cast<void*>(demangled_c));
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc
|
||||
index 562875e1..43678510 100644
|
||||
--- a/src/common/linux/elf_symbols_to_module.cc
|
||||
+++ b/src/common/linux/elf_symbols_to_module.cc
|
||||
@@ -39,6 +39,29 @@
|
||||
#include "common/byte_cursor.h"
|
||||
#include "common/module.h"
|
||||
|
||||
+#include <cstdio>
|
||||
+#include <iostream>
|
||||
+#include <memory>
|
||||
+#include <stdexcept>
|
||||
+#include <string>
|
||||
+#include <array>
|
||||
+
|
||||
+namespace {
|
||||
+
|
||||
+std::string exec(std::string cmd) {
|
||||
+ std::array<char, 128> buffer;
|
||||
+ std::string result;
|
||||
+ std::shared_ptr<FILE> pipe(popen(cmd.c_str(), "r"), pclose);
|
||||
+ if (!pipe) throw std::runtime_error("popen() failed!");
|
||||
+ while (!feof(pipe.get())) {
|
||||
+ if (fgets(buffer.data(), 128, pipe.get()) != nullptr)
|
||||
+ result += buffer.data();
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+}
|
||||
+
|
||||
namespace google_breakpad {
|
||||
|
||||
class ELFSymbolIterator {
|
||||
@@ -159,6 +182,19 @@ bool ELFSymbolsToModule(const uint8_t *symtab_section,
|
||||
Module::Extern *ext = new Module::Extern(iterator->value);
|
||||
ext->name = SymbolString(iterator->name_offset, strings);
|
||||
#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
|
||||
+ if (ext->name.find("type_erased_handlers") != std::string::npos
|
||||
+ && ext->name.find("vtable_once_impl") != std::string::npos) {
|
||||
+
|
||||
+ auto demangled_str = exec("c++filt " + ext->name);
|
||||
+ if (!demangled_str.empty() && demangled_str.back() == '\n') {
|
||||
+ demangled_str.pop_back();
|
||||
+ }
|
||||
+ if (demangled_str != ext->name) {
|
||||
+ ext->name = demangled_str;
|
||||
+ }
|
||||
+
|
||||
+ } else {
|
||||
+
|
||||
int status = 0;
|
||||
char* demangled =
|
||||
abi::__cxa_demangle(ext->name.c_str(), NULL, NULL, &status);
|
||||
@@ -167,6 +203,8 @@ bool ELFSymbolsToModule(const uint8_t *symtab_section,
|
||||
ext->name = demangled;
|
||||
free(demangled);
|
||||
}
|
||||
+
|
||||
+ }
|
||||
#endif
|
||||
module->AddExtern(ext);
|
||||
}
|
||||
diff --git a/src/tools/linux/tools_linux.gypi b/src/tools/linux/tools_linux.gypi
|
||||
index 1c15992e..020e4c1c 100644
|
||||
--- a/src/tools/linux/tools_linux.gypi
|
||||
+++ b/src/tools/linux/tools_linux.gypi
|
||||
@@ -58,7 +58,7 @@
|
||||
'target_name': 'minidump_upload',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
- 'symupload/minidump_upload.m',
|
||||
+ 'symupload/minidump_upload.cc',
|
||||
],
|
||||
'dependencies': [
|
||||
'../common/common.gyp:common',
|
||||
diff --git a/src/tools/mac/dump_syms/macho_dump.cc b/src/tools/mac/dump_syms/macho_dump.cc
|
||||
index d882bbe8..3432bb45 100644
|
||||
--- a/src/tools/mac/dump_syms/macho_dump.cc
|
||||
+++ b/src/tools/mac/dump_syms/macho_dump.cc
|
||||
@@ -140,7 +140,7 @@ void DumpFile(const char *filename) {
|
||||
size_t object_files_size;
|
||||
const SuperFatArch* super_fat_object_files =
|
||||
fat_reader.object_files(&object_files_size);
|
||||
- struct fat_arch *object_files;
|
||||
+ struct fat_arch *object_files = 0;
|
||||
if (!super_fat_object_files->ConvertToFatArch(object_files)) {
|
||||
exit(1);
|
||||
}
|
||||
121
Telegram/Patches/build_ffmpeg_win.sh
Normal file
@@ -0,0 +1,121 @@
|
||||
set -e
|
||||
FullExecPath=$PWD
|
||||
pushd `dirname $0` > /dev/null
|
||||
FullScriptPath=`pwd`
|
||||
popd > /dev/null
|
||||
|
||||
pacman --noconfirm -Sy
|
||||
pacman --noconfirm -S msys/make
|
||||
pacman --noconfirm -S mingw64/mingw-w64-x86_64-opus
|
||||
pacman --noconfirm -S diffutils
|
||||
pacman --noconfirm -S pkg-config
|
||||
|
||||
PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
|
||||
./configure --toolchain=msvc \
|
||||
--extra-cflags="-DCONFIG_SAFE_BITSTREAM_READER=1" \
|
||||
--extra-cxxflags="-DCONFIG_SAFE_BITSTREAM_READER=1" \
|
||||
--extra-ldflags="-libpath:$FullExecPath/../opus/win32/VS2015/Win32/Release" \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-network \
|
||||
--disable-everything \
|
||||
--enable-hwaccel=h264_d3d11va \
|
||||
--enable-hwaccel=h264_d3d11va2 \
|
||||
--enable-hwaccel=h264_dxva2 \
|
||||
--enable-hwaccel=hevc_d3d11va \
|
||||
--enable-hwaccel=hevc_d3d11va2 \
|
||||
--enable-hwaccel=hevc_dxva2 \
|
||||
--enable-hwaccel=mpeg2_d3d11va \
|
||||
--enable-hwaccel=mpeg2_d3d11va2 \
|
||||
--enable-hwaccel=mpeg2_dxva2 \
|
||||
--enable-protocol=file --enable-libopus \
|
||||
--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 -j4
|
||||
make -j4 install
|
||||
107
Telegram/Patches/crashpad.diff
Normal file
@@ -0,0 +1,107 @@
|
||||
diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
|
||||
index 436ac5ad..8e14fb9c 100644
|
||||
--- a/client/capture_context_mac_test.cc
|
||||
+++ b/client/capture_context_mac_test.cc
|
||||
@@ -34,11 +34,11 @@ namespace {
|
||||
// gtest assertions.
|
||||
void SanityCheckContext(const NativeCPUContext& context) {
|
||||
#if defined(ARCH_CPU_X86)
|
||||
- ASSERT_EQ(x86_THREAD_STATE32, context.tsh.flavor);
|
||||
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT), context.tsh.count);
|
||||
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
|
||||
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT), implicit_cast<uint32_t>(context.tsh.count));
|
||||
#elif defined(ARCH_CPU_X86_64)
|
||||
- ASSERT_EQ(x86_THREAD_STATE64, context.tsh.flavor);
|
||||
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT), context.tsh.count);
|
||||
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
|
||||
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT), implicit_cast<uint32_t>(context.tsh.count));
|
||||
#endif
|
||||
|
||||
#if defined(ARCH_CPU_X86_FAMILY)
|
||||
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
|
||||
index 7e279015..27864388 100644
|
||||
--- a/client/simulate_crash_mac.cc
|
||||
+++ b/client/simulate_crash_mac.cc
|
||||
@@ -177,12 +177,12 @@ bool DeliverException(thread_t thread,
|
||||
|
||||
void SimulateCrash(const NativeCPUContext& cpu_context) {
|
||||
#if defined(ARCH_CPU_X86)
|
||||
- DCHECK_EQ(cpu_context.tsh.flavor,
|
||||
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
|
||||
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32));
|
||||
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
|
||||
x86_THREAD_STATE32_COUNT);
|
||||
#elif defined(ARCH_CPU_X86_64)
|
||||
- DCHECK_EQ(cpu_context.tsh.flavor,
|
||||
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
|
||||
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64));
|
||||
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
|
||||
x86_THREAD_STATE64_COUNT);
|
||||
diff --git a/client/simulate_crash_mac_test.cc b/client/simulate_crash_mac_test.cc
|
||||
index 87c5f845..ca813e4c 100644
|
||||
--- a/client/simulate_crash_mac_test.cc
|
||||
+++ b/client/simulate_crash_mac_test.cc
|
||||
@@ -130,12 +130,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
||||
reinterpret_cast<const x86_thread_state*>(old_state);
|
||||
switch (state->tsh.flavor) {
|
||||
case x86_THREAD_STATE32:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT),
|
||||
- state->tsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->tsh.count));
|
||||
break;
|
||||
case x86_THREAD_STATE64:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT),
|
||||
- state->tsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->tsh.count));
|
||||
break;
|
||||
default:
|
||||
ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor;
|
||||
@@ -149,12 +149,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
||||
reinterpret_cast<const x86_float_state*>(old_state);
|
||||
switch (state->fsh.flavor) {
|
||||
case x86_FLOAT_STATE32:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE32_COUNT),
|
||||
- state->fsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE32_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->fsh.count));
|
||||
break;
|
||||
case x86_FLOAT_STATE64:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE64_COUNT),
|
||||
- state->fsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE64_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->fsh.count));
|
||||
break;
|
||||
default:
|
||||
ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor;
|
||||
@@ -168,12 +168,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
||||
reinterpret_cast<const x86_debug_state*>(old_state);
|
||||
switch (state->dsh.flavor) {
|
||||
case x86_DEBUG_STATE32:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE32_COUNT),
|
||||
- state->dsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE32_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->dsh.count));
|
||||
break;
|
||||
case x86_DEBUG_STATE64:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE64_COUNT),
|
||||
- state->dsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE64_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->dsh.count));
|
||||
break;
|
||||
default:
|
||||
ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor;
|
||||
diff --git a/crashpad.gyp b/crashpad.gyp
|
||||
index 42fe0a26..d8af1bf1 100644
|
||||
--- a/crashpad.gyp
|
||||
+++ b/crashpad.gyp
|
||||
@@ -25,7 +25,7 @@
|
||||
'minidump/minidump.gyp:*',
|
||||
'minidump/minidump_test.gyp:*',
|
||||
'snapshot/snapshot.gyp:*',
|
||||
- 'snapshot/snapshot_test.gyp:*',
|
||||
+# 'snapshot/snapshot_test.gyp:*',
|
||||
'test/test.gyp:*',
|
||||
'test/test_test.gyp:*',
|
||||
'tools/tools.gyp:*',
|
||||
132
Telegram/Patches/gyp.diff
Normal file
@@ -0,0 +1,132 @@
|
||||
diff --git a/pylib/gyp/generator/cmake.py b/pylib/gyp/generator/cmake.py
|
||||
index 4a2041cf..e5333926 100644
|
||||
--- a/pylib/gyp/generator/cmake.py
|
||||
+++ b/pylib/gyp/generator/cmake.py
|
||||
@@ -1078,6 +1078,23 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
|
||||
|
||||
output.write(')\n')
|
||||
|
||||
+ # Precompile header
|
||||
+ precompiled_header = config.get('cmake_precompiled_header', '')
|
||||
+ if precompiled_header:
|
||||
+ precompiled_header_script = config.get('cmake_precompiled_header_script', '')
|
||||
+ if not precompiled_header_script:
|
||||
+ print ('ERROR: cmake_precompiled_header requires cmake_precompiled_header_script')
|
||||
+ cmake_precompiled_header = NormjoinPath(path_from_cmakelists_to_gyp, precompiled_header)
|
||||
+ cmake_precompiled_header_script = NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, precompiled_header_script)
|
||||
+ output.write('include(')
|
||||
+ output.write(cmake_precompiled_header_script)
|
||||
+ output.write(')\n')
|
||||
+ output.write('add_precompiled_header(')
|
||||
+ output.write(cmake_target_name)
|
||||
+ output.write(' ')
|
||||
+ output.write(cmake_precompiled_header)
|
||||
+ output.write(')\n')
|
||||
+
|
||||
UnsetVariable(output, 'TOOLSET')
|
||||
UnsetVariable(output, 'TARGET')
|
||||
|
||||
@@ -1120,6 +1137,8 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
|
||||
SetVariable(output, 'configuration', config_to_use)
|
||||
|
||||
ar = None
|
||||
+ ranlib = None
|
||||
+ nm = None
|
||||
cc = None
|
||||
cxx = None
|
||||
|
||||
@@ -1129,17 +1148,27 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
|
||||
for key, value in make_global_settings:
|
||||
if key == 'AR':
|
||||
ar = os.path.join(build_to_top, value)
|
||||
+ if key == 'RANLIB':
|
||||
+ ranlib = os.path.join(build_to_top, value)
|
||||
+ if key == 'NM':
|
||||
+ nm = os.path.join(build_to_top, value)
|
||||
if key == 'CC':
|
||||
cc = os.path.join(build_to_top, value)
|
||||
if key == 'CXX':
|
||||
cxx = os.path.join(build_to_top, value)
|
||||
|
||||
ar = gyp.common.GetEnvironFallback(['AR_target', 'AR'], ar)
|
||||
+ ranlib = gyp.common.GetEnvironFallback(['RANLIB_target', 'RANLIB'], ranlib)
|
||||
+ nm = gyp.common.GetEnvironFallback(['NM_target', 'NM'], nm)
|
||||
cc = gyp.common.GetEnvironFallback(['CC_target', 'CC'], cc)
|
||||
cxx = gyp.common.GetEnvironFallback(['CXX_target', 'CXX'], cxx)
|
||||
|
||||
if ar:
|
||||
SetVariable(output, 'CMAKE_AR', ar)
|
||||
+ if ranlib:
|
||||
+ SetVariable(output, 'CMAKE_RANLIB', ranlib)
|
||||
+ if nm:
|
||||
+ SetVariable(output, 'CMAKE_NM', nm)
|
||||
if cc:
|
||||
SetVariable(output, 'CMAKE_C_COMPILER', cc)
|
||||
if cxx:
|
||||
diff --git a/pylib/gyp/generator/xcode.py b/pylib/gyp/generator/xcode.py
|
||||
index 8bc22bed..24bee427 100644
|
||||
--- a/pylib/gyp/generator/xcode.py
|
||||
+++ b/pylib/gyp/generator/xcode.py
|
||||
@@ -74,6 +74,12 @@ generator_additional_non_configuration_keys = [
|
||||
'ios_app_extension',
|
||||
'ios_watch_app',
|
||||
'ios_watchkit_extension',
|
||||
+
|
||||
+ 'mac_sandbox', # sandbox support
|
||||
+ 'mac_sandbox_development_team',
|
||||
+
|
||||
+ 'mac_hardened_runtime', # hardened runtime support
|
||||
+
|
||||
'mac_bundle',
|
||||
'mac_bundle_resources',
|
||||
'mac_framework_headers',
|
||||
@@ -774,6 +780,39 @@ def GenerateOutput(target_list, target_dicts, data, params):
|
||||
xcode_targets[qualified_target] = xct
|
||||
xcode_target_to_target_dict[xct] = spec
|
||||
|
||||
+ # sandbox and hardened runtime support
|
||||
+ is_sandbox = int(spec.get('mac_sandbox', 0))
|
||||
+ is_hardened_runtime = int(spec.get('mac_hardened_runtime', 0))
|
||||
+ if is_sandbox or is_hardened_runtime:
|
||||
+ try:
|
||||
+ tmp = pbxp._properties['attributes']['TargetAttributes']
|
||||
+ except KeyError:
|
||||
+ pbxp._properties['attributes']['TargetAttributes'] = {}
|
||||
+ try:
|
||||
+ tmp = pbxp._properties['attributes']['TargetAttributes'][xct]
|
||||
+ except KeyError:
|
||||
+ pbxp._properties['attributes']['TargetAttributes'][xct] = {}
|
||||
+ try:
|
||||
+ tmp = pbxp._properties['attributes']['TargetAttributes'][xct]['SystemCapabilities']
|
||||
+ except KeyError:
|
||||
+ pbxp._properties['attributes']['TargetAttributes'][xct]['SystemCapabilities'] = {}
|
||||
+
|
||||
+ if is_sandbox:
|
||||
+ dev_team = spec.get('mac_sandbox_development_team', '%%ERROR%%')
|
||||
+ assert dev_team != '%%ERROR%%', (
|
||||
+ 'mac_sandbox must be accompanied by mac_sandbox_development_team (target "%s")' %
|
||||
+ target_name)
|
||||
+ pbxp._properties['attributes']['TargetAttributes'][xct]['DevelopmentTeam'] = dev_team
|
||||
+ pbxp._properties['attributes']['TargetAttributes'][xct]['SystemCapabilities']['com.apple.Sandbox'] = {
|
||||
+ 'enabled': 1,
|
||||
+ }
|
||||
+
|
||||
+ # hardened runtime support
|
||||
+ if is_hardened_runtime:
|
||||
+ pbxp._properties['attributes']['TargetAttributes'][xct]['SystemCapabilities']['com.apple.HardenedRuntime'] = {
|
||||
+ 'enabled': 1,
|
||||
+ }
|
||||
+
|
||||
spec_actions = spec.get('actions', [])
|
||||
spec_rules = spec.get('rules', [])
|
||||
|
||||
@@ -1132,7 +1171,8 @@ exit 1
|
||||
groups = [x for x in groups if not x.endswith('_excluded')]
|
||||
for group in groups:
|
||||
for item in rule.get(group, []):
|
||||
- pbxp.AddOrGetFileInRootGroup(item)
|
||||
+ concrete_item = ExpandXcodeVariables(item, rule_input_dict)
|
||||
+ pbxp.AddOrGetFileInRootGroup(concrete_item)
|
||||
|
||||
# Add "sources".
|
||||
for source in spec.get('sources', []):
|
||||
127
Telegram/Patches/macold/crashpad.diff
Normal file
@@ -0,0 +1,127 @@
|
||||
diff --git a/build/crashpad.gypi b/build/crashpad.gypi
|
||||
index 027c7b68..4bfdfb5a 100644
|
||||
--- a/build/crashpad.gypi
|
||||
+++ b/build/crashpad.gypi
|
||||
@@ -25,5 +25,15 @@
|
||||
4201, # nonstandard extension used : nameless struct/union.
|
||||
4324, # structure was padded due to __declspec(align()).
|
||||
],
|
||||
+ 'xcode_settings': {
|
||||
+ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
|
||||
+ 'OTHER_LDFLAGS': [
|
||||
+ '/usr/local/macold/lib/libc++.a',
|
||||
+ '/usr/local/macold/lib/libc++abi.a',
|
||||
+ ],
|
||||
+ },
|
||||
+ 'include_dirs': [
|
||||
+ '/usr/local/macold/include/c++/v1',
|
||||
+ ],
|
||||
},
|
||||
}
|
||||
diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
|
||||
index 436ac5ad..8e14fb9c 100644
|
||||
--- a/client/capture_context_mac_test.cc
|
||||
+++ b/client/capture_context_mac_test.cc
|
||||
@@ -34,11 +34,11 @@ namespace {
|
||||
// gtest assertions.
|
||||
void SanityCheckContext(const NativeCPUContext& context) {
|
||||
#if defined(ARCH_CPU_X86)
|
||||
- ASSERT_EQ(x86_THREAD_STATE32, context.tsh.flavor);
|
||||
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT), context.tsh.count);
|
||||
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
|
||||
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT), implicit_cast<uint32_t>(context.tsh.count));
|
||||
#elif defined(ARCH_CPU_X86_64)
|
||||
- ASSERT_EQ(x86_THREAD_STATE64, context.tsh.flavor);
|
||||
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT), context.tsh.count);
|
||||
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
|
||||
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT), implicit_cast<uint32_t>(context.tsh.count));
|
||||
#endif
|
||||
|
||||
#if defined(ARCH_CPU_X86_FAMILY)
|
||||
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
|
||||
index 7e279015..27864388 100644
|
||||
--- a/client/simulate_crash_mac.cc
|
||||
+++ b/client/simulate_crash_mac.cc
|
||||
@@ -177,12 +177,12 @@ bool DeliverException(thread_t thread,
|
||||
|
||||
void SimulateCrash(const NativeCPUContext& cpu_context) {
|
||||
#if defined(ARCH_CPU_X86)
|
||||
- DCHECK_EQ(cpu_context.tsh.flavor,
|
||||
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
|
||||
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32));
|
||||
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
|
||||
x86_THREAD_STATE32_COUNT);
|
||||
#elif defined(ARCH_CPU_X86_64)
|
||||
- DCHECK_EQ(cpu_context.tsh.flavor,
|
||||
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
|
||||
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64));
|
||||
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
|
||||
x86_THREAD_STATE64_COUNT);
|
||||
diff --git a/client/simulate_crash_mac_test.cc b/client/simulate_crash_mac_test.cc
|
||||
index 87c5f845..ca813e4c 100644
|
||||
--- a/client/simulate_crash_mac_test.cc
|
||||
+++ b/client/simulate_crash_mac_test.cc
|
||||
@@ -130,12 +130,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
||||
reinterpret_cast<const x86_thread_state*>(old_state);
|
||||
switch (state->tsh.flavor) {
|
||||
case x86_THREAD_STATE32:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT),
|
||||
- state->tsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->tsh.count));
|
||||
break;
|
||||
case x86_THREAD_STATE64:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT),
|
||||
- state->tsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->tsh.count));
|
||||
break;
|
||||
default:
|
||||
ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor;
|
||||
@@ -149,12 +149,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
||||
reinterpret_cast<const x86_float_state*>(old_state);
|
||||
switch (state->fsh.flavor) {
|
||||
case x86_FLOAT_STATE32:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE32_COUNT),
|
||||
- state->fsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE32_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->fsh.count));
|
||||
break;
|
||||
case x86_FLOAT_STATE64:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE64_COUNT),
|
||||
- state->fsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE64_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->fsh.count));
|
||||
break;
|
||||
default:
|
||||
ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor;
|
||||
@@ -168,12 +168,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
||||
reinterpret_cast<const x86_debug_state*>(old_state);
|
||||
switch (state->dsh.flavor) {
|
||||
case x86_DEBUG_STATE32:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE32_COUNT),
|
||||
- state->dsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE32_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->dsh.count));
|
||||
break;
|
||||
case x86_DEBUG_STATE64:
|
||||
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE64_COUNT),
|
||||
- state->dsh.count);
|
||||
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE64_COUNT),
|
||||
+ implicit_cast<uint32_t>(state->dsh.count));
|
||||
break;
|
||||
default:
|
||||
ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor;
|
||||
diff --git a/crashpad.gyp b/crashpad.gyp
|
||||
index 42fe0a26..d8af1bf1 100644
|
||||
--- a/crashpad.gyp
|
||||
+++ b/crashpad.gyp
|
||||
@@ -25,7 +25,7 @@
|
||||
'minidump/minidump.gyp:*',
|
||||
'minidump/minidump_test.gyp:*',
|
||||
'snapshot/snapshot.gyp:*',
|
||||
- 'snapshot/snapshot_test.gyp:*',
|
||||
+# 'snapshot/snapshot_test.gyp:*',
|
||||
'test/test.gyp:*',
|
||||
'test/test_test.gyp:*',
|
||||
'tools/tools.gyp:*',
|
||||
28
Telegram/Patches/macold/mini_chromium.diff
Normal file
@@ -0,0 +1,28 @@
|
||||
diff --git a/build/common.gypi b/build/common.gypi
|
||||
index 1affc70..0677e4b 100644
|
||||
--- a/build/common.gypi
|
||||
+++ b/build/common.gypi
|
||||
@@ -66,6 +66,13 @@
|
||||
'conditions': [
|
||||
['clang!=0', {
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
|
||||
+ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
|
||||
+ 'OTHER_LDFLAGS': [
|
||||
+ '/usr/local/macold/lib/libc++.a',
|
||||
+ '/usr/local/macold/lib/libc++abi.a',
|
||||
+ '-isysroot/',
|
||||
+ '-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/',
|
||||
+ ],
|
||||
|
||||
# Don't link in libarclite_macosx.a, see http://crbug.com/156530.
|
||||
'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
|
||||
@@ -116,6 +123,9 @@
|
||||
],
|
||||
|
||||
},
|
||||
+ 'include_dirs': [
|
||||
+ '/usr/local/macold/include/c++/v1',
|
||||
+ ],
|
||||
}],
|
||||
|
||||
['OS=="linux"', {
|
||||
844
Telegram/Patches/macold/qtbase_5_3_2.diff
Normal file
@@ -0,0 +1,844 @@
|
||||
diff --git a/configure b/configure
|
||||
index cb8d78fd3c..cadb3f0a88 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -511,7 +511,8 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
- if ! /usr/bin/xcrun -find xcrun >/dev/null 2>&1; then
|
||||
+ # Patch: Fix Qt for working with Xcode 8.
|
||||
+ if ! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1; then
|
||||
echo >&2
|
||||
echo " Xcode not set up properly. You may need to confirm the license" >&2
|
||||
echo " agreement by running /usr/bin/xcodebuild without arguments." >&2
|
||||
diff --git a/mkspecs/common/g++-macx.conf b/mkspecs/common/g++-macx.conf
|
||||
index 086510dd96..078a5ed1dd 100644
|
||||
--- a/mkspecs/common/g++-macx.conf
|
||||
+++ b/mkspecs/common/g++-macx.conf
|
||||
@@ -14,7 +14,13 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
|
||||
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
|
||||
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g -gdwarf-2
|
||||
|
||||
-QMAKE_LFLAGS_STATIC_LIB += -all_load
|
||||
+# Patch: Don't remember :(
|
||||
+#QMAKE_LFLAGS_STATIC_LIB += -all_load
|
||||
+
|
||||
+# Patch: Use C++14 with custom libc++ build.
|
||||
+QMAKE_CXXFLAGS_CXX11 = -std=c++1y
|
||||
+QMAKE_CXXFLAGS += -nostdinc++ -I/usr/local/macold/include/c++/v1
|
||||
+QMAKE_LFLAGS += /usr/local/macold/lib/libc++.a /usr/local/macold/lib/libc++abi.a -isysroot /
|
||||
|
||||
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvmgcc42
|
||||
|
||||
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
|
||||
index 0cc8cd6dfd..ca9725b779 100644
|
||||
--- a/mkspecs/features/mac/default_pre.prf
|
||||
+++ b/mkspecs/features/mac/default_pre.prf
|
||||
@@ -12,7 +12,9 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
|
||||
error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
|
||||
|
||||
# Make sure Xcode is set up properly
|
||||
- isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
|
||||
+
|
||||
+ # Patch: Fix Qt for working with Xcode 8.
|
||||
+ isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
|
||||
error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
|
||||
}
|
||||
|
||||
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
|
||||
index bb79a139b3..5d595bc3b3 100644
|
||||
--- a/src/gui/image/qbmphandler.cpp
|
||||
+++ b/src/gui/image/qbmphandler.cpp
|
||||
@@ -220,6 +220,10 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
|
||||
int blue_scale = 0;
|
||||
int alpha_scale = 0;
|
||||
|
||||
+ // Patch: Backport a fix for bmp reader.
|
||||
+ if (!d->isSequential())
|
||||
+ d->seek(startpos + BMP_FILEHDR_SIZE + (bi.biSize >= BMP_WIN4? BMP_WIN : bi.biSize)); // goto start of colormap
|
||||
+
|
||||
if (bi.biSize >= BMP_WIN4 || (comp == BMP_BITFIELDS && (nbits == 16 || nbits == 32))) {
|
||||
if (d->read((char *)&red_mask, sizeof(red_mask)) != sizeof(red_mask))
|
||||
return false;
|
||||
@@ -307,8 +311,9 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
|
||||
image.setDotsPerMeterX(bi.biXPelsPerMeter);
|
||||
image.setDotsPerMeterY(bi.biYPelsPerMeter);
|
||||
|
||||
- if (!d->isSequential())
|
||||
- d->seek(startpos + BMP_FILEHDR_SIZE + (bi.biSize >= BMP_WIN4? BMP_WIN : bi.biSize)); // goto start of colormap
|
||||
+ // Patch: Backport a fix for bmp reader.
|
||||
+ //if (!d->isSequential())
|
||||
+ // d->seek(startpos + BMP_FILEHDR_SIZE + (bi.biSize >= BMP_WIN4? BMP_WIN : bi.biSize)); // goto start of colormap
|
||||
|
||||
if (ncols > 0) { // read color table
|
||||
uchar rgb[4];
|
||||
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
|
||||
index ebff9509ab..4300ca4c0f 100644
|
||||
--- a/src/gui/painting/qpaintengine_p.h
|
||||
+++ b/src/gui/painting/qpaintengine_p.h
|
||||
@@ -87,8 +87,18 @@ public:
|
||||
if (hasSystemTransform) {
|
||||
if (systemTransform.type() <= QTransform::TxTranslate)
|
||||
systemClip.translate(qRound(systemTransform.dx()), qRound(systemTransform.dy()));
|
||||
- else
|
||||
+ // Patch: Transform the system clip region back from device pixels to device-independent pixels before
|
||||
+ // applying systemTransform, which already has transform from device-independent pixels to device pixels.
|
||||
+ else {
|
||||
+#ifdef Q_OS_MAC
|
||||
+ QTransform scaleTransform;
|
||||
+ const qreal invDevicePixelRatio = 1. / pdev->devicePixelRatio();
|
||||
+ scaleTransform.scale(invDevicePixelRatio, invDevicePixelRatio);
|
||||
+ systemClip = systemTransform.map(scaleTransform.map(systemClip));
|
||||
+#else
|
||||
systemClip = systemTransform.map(systemClip);
|
||||
+#endif
|
||||
+ }
|
||||
}
|
||||
|
||||
// Make sure we're inside the viewport.
|
||||
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
|
||||
index 4879ae51d7..56cdcbaf01 100644
|
||||
--- a/src/gui/text/qtextlayout.cpp
|
||||
+++ b/src/gui/text/qtextlayout.cpp
|
||||
@@ -654,6 +654,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const
|
||||
while (oldPos < len && !attributes[oldPos].graphemeBoundary)
|
||||
oldPos++;
|
||||
} else {
|
||||
+ // Patch: Skip to the end of the current word, not to the start of the next one.
|
||||
+ while (oldPos < len && attributes[oldPos].whiteSpace)
|
||||
+ oldPos++;
|
||||
if (oldPos < len && d->atWordSeparator(oldPos)) {
|
||||
oldPos++;
|
||||
while (oldPos < len && d->atWordSeparator(oldPos))
|
||||
@@ -662,8 +665,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const
|
||||
while (oldPos < len && !d->atSpace(oldPos) && !d->atWordSeparator(oldPos))
|
||||
oldPos++;
|
||||
}
|
||||
- while (oldPos < len && d->atSpace(oldPos))
|
||||
- oldPos++;
|
||||
+ // Patch: Skip to the end of the current word, not to the start of the next one.
|
||||
+ //while (oldPos < len && d->atSpace(oldPos))
|
||||
+ // oldPos++;
|
||||
}
|
||||
|
||||
return oldPos;
|
||||
@@ -1602,6 +1606,9 @@ namespace {
|
||||
int currentPosition;
|
||||
glyph_t previousGlyph;
|
||||
|
||||
+ // Patch: Backport a crash fix.
|
||||
+ QFontEngine *previousGlyphFontEngine;
|
||||
+
|
||||
QFixed minw;
|
||||
QFixed softHyphenWidth;
|
||||
QFixed rightBearing;
|
||||
@@ -1634,13 +1641,19 @@ namespace {
|
||||
if (currentPosition > 0 &&
|
||||
logClusters[currentPosition - 1] < glyphs.numGlyphs) {
|
||||
previousGlyph = currentGlyph(); // needed to calculate right bearing later
|
||||
+
|
||||
+ // Patch: Backport a crash fix.
|
||||
+ previousGlyphFontEngine = fontEngine;
|
||||
}
|
||||
}
|
||||
|
||||
- inline void adjustRightBearing(glyph_t glyph)
|
||||
+ // Patch: Backport a crash fix.
|
||||
+ inline void adjustRightBearing(QFontEngine *engine, glyph_t glyph)
|
||||
{
|
||||
qreal rb;
|
||||
- fontEngine->getGlyphBearings(glyph, 0, &rb);
|
||||
+
|
||||
+ // Patch: Backport a crash fix.
|
||||
+ engine->getGlyphBearings(glyph, 0, &rb);
|
||||
rightBearing = qMin(QFixed(), QFixed::fromReal(rb));
|
||||
}
|
||||
|
||||
@@ -1648,13 +1661,16 @@ namespace {
|
||||
{
|
||||
if (currentPosition <= 0)
|
||||
return;
|
||||
- adjustRightBearing(currentGlyph());
|
||||
+
|
||||
+ // Patch: Backport a crash fix.
|
||||
+ adjustRightBearing(fontEngine, currentGlyph());
|
||||
}
|
||||
|
||||
inline void adjustPreviousRightBearing()
|
||||
{
|
||||
if (previousGlyph > 0)
|
||||
- adjustRightBearing(previousGlyph);
|
||||
+ // Patch: Backport a crash fix.
|
||||
+ adjustRightBearing(previousGlyphFontEngine, previousGlyph);
|
||||
}
|
||||
|
||||
inline void resetRightBearing()
|
||||
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
|
||||
index cbe42c3844..b273db7e78 100644
|
||||
--- a/src/gui/text/qtextlayout.h
|
||||
+++ b/src/gui/text/qtextlayout.h
|
||||
@@ -194,6 +194,9 @@ private:
|
||||
QRectF *brect, int tabstops, int* tabarray, int tabarraylen,
|
||||
QPainter *painter);
|
||||
QTextEngine *d;
|
||||
+
|
||||
+ // Patch: Give access to the internal api.
|
||||
+ friend class TextBlock;
|
||||
};
|
||||
|
||||
|
||||
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
|
||||
index 360f9722c7..f28f289ef6 100644
|
||||
--- a/src/network/access/qhttpnetworkconnection.cpp
|
||||
+++ b/src/network/access/qhttpnetworkconnection.cpp
|
||||
@@ -118,6 +118,8 @@ QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate()
|
||||
{
|
||||
for (int i = 0; i < channelCount; ++i) {
|
||||
if (channels[i].socket) {
|
||||
+ // Patch: backport critical bugfix from '4f959b6b30' commit.
|
||||
+ QObject::disconnect(channels[i].socket, Q_NULLPTR, &channels[i], Q_NULLPTR);
|
||||
channels[i].socket->close();
|
||||
delete channels[i].socket;
|
||||
}
|
||||
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
|
||||
index ca7afb7d1b..25ae50008d 100644
|
||||
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
|
||||
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
|
||||
@@ -256,6 +256,13 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
|
||||
|
||||
fd->foundryName = QStringLiteral("CoreText");
|
||||
fd->familyName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute);
|
||||
+
|
||||
+ // Patch: Fix open sans semibold loading.
|
||||
+ QCFString _displayName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontDisplayNameAttribute);
|
||||
+ if (_displayName == QStringLiteral("Open Sans Semibold")) {
|
||||
+ fd->familyName = _displayName;
|
||||
+ }
|
||||
+
|
||||
fd->styleName = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute);
|
||||
fd->weight = QFont::Normal;
|
||||
fd->style = QFont::StyleNormal;
|
||||
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
|
||||
index 6e2c8a2a9a..3cace8abcb 100644
|
||||
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
|
||||
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
|
||||
@@ -717,7 +717,8 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t, QPainterPath *, glyph_metric
|
||||
|
||||
QFixed QCoreTextFontEngine::emSquareSize() const
|
||||
{
|
||||
- return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
|
||||
+ // Patch: Fix build for Xcode 9.3.1.
|
||||
+ return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
|
||||
}
|
||||
|
||||
QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
|
||||
index 92358ecc74..694fee7350 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
|
||||
@@ -213,7 +213,8 @@ static void cleanupCocoaApplicationDelegate()
|
||||
if (reflectionDelegate) {
|
||||
if ([reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)])
|
||||
return [reflectionDelegate applicationShouldTerminate:sender];
|
||||
- return NSTerminateNow;
|
||||
+ // Patch: Don't terminate if reflectionDelegate does not respond to that selector, just use the default.
|
||||
+ //return NSTerminateNow;
|
||||
}
|
||||
|
||||
if ([self canQuit]) {
|
||||
@@ -289,6 +290,11 @@ static void cleanupCocoaApplicationDelegate()
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
+ // Patch: We need to receive this notification in the delegate as well.
|
||||
+ if (reflectionDelegate
|
||||
+ && [reflectionDelegate respondsToSelector:@selector(applicationDidFinishLaunching:)])
|
||||
+ [reflectionDelegate applicationDidFinishLaunching:aNotification];
|
||||
+
|
||||
Q_UNUSED(aNotification);
|
||||
inLaunch = false;
|
||||
// qt_release_apple_event_handler();
|
||||
@@ -411,7 +417,9 @@ static void cleanupCocoaApplicationDelegate()
|
||||
{
|
||||
Q_UNUSED(replyEvent);
|
||||
NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
|
||||
- QWindowSystemInterface::handleFileOpenEvent(QUrl(QCFString::toQString(urlString)));
|
||||
+
|
||||
+ // Patch: Fix opening of an external url by a protocol handler.
|
||||
+ QWindowSystemInterface::handleFileOpenEvent(QUrl::fromNSURL([NSURL URLWithString:urlString]));
|
||||
}
|
||||
|
||||
- (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
|
||||
index b81b9a0b1c..4e59e833b1 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
|
||||
@@ -81,7 +81,7 @@ void QCocoaCursor::setPos(const QPoint &position)
|
||||
pos.x = position.x();
|
||||
pos.y = position.y();
|
||||
|
||||
- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0);
|
||||
+ CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft);
|
||||
CGEventPost(kCGHIDEventTap, e);
|
||||
CFRelease(e);
|
||||
}
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
|
||||
index 9850f83dea..b2e1d3dfda 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
|
||||
@@ -649,9 +649,10 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
|
||||
// Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
|
||||
OSStatus err = noErr;
|
||||
|
||||
- require_action(inContext != NULL, InvalidContext, err = paramErr);
|
||||
- require_action(inBounds != NULL, InvalidBounds, err = paramErr);
|
||||
- require_action(inImage != NULL, InvalidImage, err = paramErr);
|
||||
+ // Patch: Fix build on latest Xcode.
|
||||
+ //require_action(inContext != NULL, InvalidContext, err = paramErr);
|
||||
+ //require_action(inBounds != NULL, InvalidBounds, err = paramErr);
|
||||
+ //require_action(inImage != NULL, InvalidImage, err = paramErr);
|
||||
|
||||
CGContextSaveGState( inContext );
|
||||
CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
|
||||
@@ -660,9 +661,11 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
|
||||
CGContextDrawImage(inContext, *inBounds, inImage);
|
||||
|
||||
CGContextRestoreGState(inContext);
|
||||
-InvalidImage:
|
||||
-InvalidBounds:
|
||||
-InvalidContext:
|
||||
+
|
||||
+// Patch: Fix build on latest Xcode.
|
||||
+//InvalidImage:
|
||||
+//InvalidBounds:
|
||||
+//InvalidContext:
|
||||
return err;
|
||||
}
|
||||
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||
index 9fd05a65ee..dea60720e7 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||
@@ -402,14 +402,24 @@ void QCocoaIntegration::updateScreens()
|
||||
}
|
||||
siblings << screen;
|
||||
}
|
||||
+
|
||||
+ // Patch: Backport crash fix from Qt 5.6.1.
|
||||
+ // Set virtual siblings list. All screens in mScreens are siblings, because we ignored the
|
||||
+ // mirrors. Note that some of the screens we update the siblings list for here may be deleted
|
||||
+ // below, but update anyway to keep the to-be-deleted screens out of the siblings list.
|
||||
+ foreach (QCocoaScreen* screen, mScreens)
|
||||
+ screen->setVirtualSiblings(siblings);
|
||||
+
|
||||
// Now the leftovers in remainingScreens are no longer current, so we can delete them.
|
||||
foreach (QCocoaScreen* screen, remainingScreens) {
|
||||
mScreens.removeOne(screen);
|
||||
delete screen;
|
||||
}
|
||||
+
|
||||
+ // Patch: Backport crash fix from Qt 5.6.1.
|
||||
// All screens in mScreens are siblings, because we ignored the mirrors.
|
||||
- foreach (QCocoaScreen* screen, mScreens)
|
||||
- screen->setVirtualSiblings(siblings);
|
||||
+ //foreach (QCocoaScreen* screen, mScreens)
|
||||
+ // screen->setVirtualSiblings(siblings);
|
||||
}
|
||||
|
||||
QCocoaScreen *QCocoaIntegration::screenAtIndex(int index)
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
|
||||
index e46eaff6be..c62db534a2 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
|
||||
@@ -382,6 +382,12 @@ bool QCocoaKeyMapper::updateKeyboard()
|
||||
keyboardInputLocale = QLocale::c();
|
||||
keyboardInputDirection = Qt::LeftToRight;
|
||||
}
|
||||
+
|
||||
+ // Patch: Backport a fix for layout-independent keyboard shortcuts.
|
||||
+ const auto newMode = keyboard_mode;
|
||||
+ deleteLayouts();
|
||||
+ keyboard_mode = newMode;
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -464,7 +470,8 @@ QList<int> QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const
|
||||
Qt::KeyboardModifiers neededMods = ModsTbl[i];
|
||||
int key = kbItem->qtKey[i];
|
||||
if (key && key != baseKey && ((keyMods & neededMods) == neededMods)) {
|
||||
- ret << int(key + (keyMods & ~neededMods));
|
||||
+ // Patch: Backport a fix for layout-independent keyboard shortcuts.
|
||||
+ ret << int(key + neededMods);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
|
||||
index 83c960d931..03ae9696af 100755
|
||||
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
|
||||
@@ -102,7 +102,10 @@ QT_USE_NAMESPACE
|
||||
QCocoaSystemTrayIcon *systray;
|
||||
NSStatusItem *item;
|
||||
QCocoaMenu *menu;
|
||||
- bool menuVisible;
|
||||
+
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ bool menuVisible, iconSelected;
|
||||
+
|
||||
QIcon icon;
|
||||
QT_MANGLE_NAMESPACE(QNSImageView) *imageCell;
|
||||
}
|
||||
@@ -124,6 +127,10 @@ QT_USE_NAMESPACE
|
||||
QT_MANGLE_NAMESPACE(QNSStatusItem) *parent;
|
||||
}
|
||||
-(id)initWithParent:(QT_MANGLE_NAMESPACE(QNSStatusItem)*)myParent;
|
||||
+
|
||||
+// Patch: Nice macOS tray icon support.
|
||||
+-(void)updateIconSelection;
|
||||
+
|
||||
-(void)menuTrackingDone:(NSNotification*)notification;
|
||||
-(void)mousePressed:(NSEvent *)mouseEvent button:(Qt::MouseButton)mouseButton;
|
||||
@end
|
||||
@@ -187,6 +194,19 @@ void QCocoaSystemTrayIcon::cleanup()
|
||||
m_sys = 0;
|
||||
}
|
||||
|
||||
+// Patch: Nice macOS tray icon support.
|
||||
+namespace {
|
||||
+
|
||||
+qreal getDevicePixelRatio() {
|
||||
+ qreal result = 1.0;
|
||||
+ foreach (QScreen *screen, QGuiApplication::screens()) {
|
||||
+ result = qMax(result, screen->devicePixelRatio());
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
|
||||
{
|
||||
if (!m_sys)
|
||||
@@ -194,13 +214,18 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
|
||||
|
||||
m_sys->item->icon = icon;
|
||||
|
||||
- const bool menuVisible = m_sys->item->menu && m_sys->item->menuVisible;
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ //const bool menuVisible = m_sys->item->menu && m_sys->item->menuVisible;
|
||||
|
||||
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
|
||||
- const short scale = hgt - 4;
|
||||
+ const int padding = 0;
|
||||
+ const int menuHeight = [[NSStatusBar systemStatusBar] thickness];
|
||||
+ const int maxImageHeight = menuHeight - padding;
|
||||
+
|
||||
+ const short scale = maxImageHeight * getDevicePixelRatio();
|
||||
|
||||
QPixmap pm = m_sys->item->icon.pixmap(QSize(scale, scale),
|
||||
- menuVisible ? QIcon::Selected : QIcon::Normal);
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ m_sys->item->iconSelected ? QIcon::Selected : QIcon::Normal);
|
||||
if (pm.isNull()) {
|
||||
pm = QPixmap(scale, scale);
|
||||
pm.fill(Qt::transparent);
|
||||
@@ -322,15 +347,16 @@ QT_END_NAMESPACE
|
||||
return self;
|
||||
}
|
||||
|
||||
--(void)menuTrackingDone:(NSNotification*)notification
|
||||
+// Patch: Nice macOS tray icon support.
|
||||
+-(void)updateIconSelection
|
||||
{
|
||||
- Q_UNUSED(notification);
|
||||
- down = NO;
|
||||
+ const int padding = 0;
|
||||
+ const int menuHeight = [[NSStatusBar systemStatusBar] thickness];
|
||||
+ const int maxImageHeight = menuHeight - padding;
|
||||
|
||||
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
|
||||
- const short scale = hgt - 4;
|
||||
-
|
||||
- QPixmap pm = parent->icon.pixmap(QSize(scale, scale), QIcon::Normal);
|
||||
+ const short scale = maxImageHeight * getDevicePixelRatio();
|
||||
+ QPixmap pm = parent->icon.pixmap(QSize(scale, scale),
|
||||
+ parent->iconSelected ? QIcon::Selected : QIcon::Normal);
|
||||
if (pm.isNull()) {
|
||||
pm = QPixmap(scale, scale);
|
||||
pm.fill(Qt::transparent);
|
||||
@@ -338,9 +364,19 @@ QT_END_NAMESPACE
|
||||
NSImage *nsaltimage = static_cast<NSImage *>(qt_mac_create_nsimage(pm));
|
||||
[self setImage: nsaltimage];
|
||||
[nsaltimage release];
|
||||
+}
|
||||
+
|
||||
+-(void)menuTrackingDone:(NSNotification*)notification
|
||||
+{
|
||||
+ Q_UNUSED(notification);
|
||||
+ down = NO;
|
||||
|
||||
parent->menuVisible = false;
|
||||
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ parent->iconSelected = false;
|
||||
+ [self updateIconSelection];
|
||||
+
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
@@ -350,18 +386,9 @@ QT_END_NAMESPACE
|
||||
int clickCount = [mouseEvent clickCount];
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
|
||||
- const short scale = hgt - 4;
|
||||
-
|
||||
- QPixmap pm = parent->icon.pixmap(QSize(scale, scale),
|
||||
- parent->menuVisible ? QIcon::Selected : QIcon::Normal);
|
||||
- if (pm.isNull()) {
|
||||
- pm = QPixmap(scale, scale);
|
||||
- pm.fill(Qt::transparent);
|
||||
- }
|
||||
- NSImage *nsaltimage = static_cast<NSImage *>(qt_mac_create_nsimage(pm));
|
||||
- [self setImage: nsaltimage];
|
||||
- [nsaltimage release];
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ parent->iconSelected = (clickCount != 2) && parent->menu;
|
||||
+ [self updateIconSelection];
|
||||
|
||||
if (clickCount == 2) {
|
||||
[self menuTrackingDone:nil];
|
||||
@@ -380,6 +407,10 @@ QT_END_NAMESPACE
|
||||
{
|
||||
Q_UNUSED(mouseEvent);
|
||||
[self menuTrackingDone:nil];
|
||||
+
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ parent->iconSelected = false;
|
||||
+ [self updateIconSelection];
|
||||
}
|
||||
|
||||
- (void)rightMouseDown:(NSEvent *)mouseEvent
|
||||
@@ -391,6 +422,10 @@ QT_END_NAMESPACE
|
||||
{
|
||||
Q_UNUSED(mouseEvent);
|
||||
[self menuTrackingDone:nil];
|
||||
+
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ parent->iconSelected = false;
|
||||
+ [self updateIconSelection];
|
||||
}
|
||||
|
||||
- (void)otherMouseDown:(NSEvent *)mouseEvent
|
||||
@@ -405,7 +440,8 @@ QT_END_NAMESPACE
|
||||
}
|
||||
|
||||
-(void)drawRect:(NSRect)rect {
|
||||
- [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:down];
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:parent->menu ? down : NO];
|
||||
[super drawRect:rect];
|
||||
}
|
||||
@end
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
|
||||
index 4d0458a4aa..3357a5ef81 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
|
||||
@@ -167,7 +167,8 @@ static bool isMouseEvent(NSEvent *ev)
|
||||
if (!self.window.delegate)
|
||||
return; // Already detached, pending NSAppKitDefined event
|
||||
|
||||
- if (pw && pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
|
||||
+ // Patch: Fix events loss if the window was minimized or hidden.
|
||||
+ if (pw && pw->frameStrutEventsEnabled() && pw->m_synchedWindowState != Qt::WindowMinimized && pw->m_isExposed && isMouseEvent(theEvent)) {
|
||||
NSPoint loc = [theEvent locationInWindow];
|
||||
NSRect windowFrame = [self.window legacyConvertRectFromScreen:[self.window frame]];
|
||||
NSRect contentFrame = [[self.window contentView] frame];
|
||||
@@ -795,6 +796,16 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
|
||||
{
|
||||
Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask));
|
||||
NSInteger styleMask = NSBorderlessWindowMask;
|
||||
+
|
||||
+ // Patch: allow creating panels floating on all spaces in macOS.
|
||||
+ // If you call "setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary" before
|
||||
+ // setting the "NSNonactivatingPanelMask" bit in the style mask it won't work after that.
|
||||
+ // So we need a way to set that bit before Qt sets collection behavior the way it does.
|
||||
+ QVariant nonactivatingPanelMask = window()->property("_td_macNonactivatingPanelMask");
|
||||
+ if (nonactivatingPanelMask.isValid() && nonactivatingPanelMask.toBool()) {
|
||||
+ styleMask |= NSNonactivatingPanelMask;
|
||||
+ }
|
||||
+
|
||||
if (flags & Qt::FramelessWindowHint)
|
||||
return styleMask;
|
||||
if ((type & Qt::Popup) == Qt::Popup) {
|
||||
@@ -914,6 +925,19 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath)
|
||||
[m_nsWindow setRepresentedFilename: fi.exists() ? QCFString::toNSString(filePath) : @""];
|
||||
}
|
||||
|
||||
+// Patch: Nice macOS window icon.
|
||||
+namespace {
|
||||
+
|
||||
+qreal getDevicePixelRatio() {
|
||||
+ qreal result = 1.0;
|
||||
+ foreach (QScreen *screen, QGuiApplication::screens()) {
|
||||
+ result = qMax(result, screen->devicePixelRatio());
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
void QCocoaWindow::setWindowIcon(const QIcon &icon)
|
||||
{
|
||||
QCocoaAutoReleasePool pool;
|
||||
@@ -929,7 +953,10 @@ void QCocoaWindow::setWindowIcon(const QIcon &icon)
|
||||
if (icon.isNull()) {
|
||||
[iconButton setImage:nil];
|
||||
} else {
|
||||
- QPixmap pixmap = icon.pixmap(QSize(22, 22));
|
||||
+ // Patch: Nice macOS window icon.
|
||||
+ CGFloat hgt = 16. * getDevicePixelRatio();
|
||||
+ QPixmap pixmap = icon.pixmap(QSize(hgt, hgt));
|
||||
+
|
||||
NSImage *image = static_cast<NSImage *>(qt_mac_create_nsimage(pixmap));
|
||||
[iconButton setImage:image];
|
||||
[image release];
|
||||
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
|
||||
index a18ee7ff71..1f91feb0ae 100644
|
||||
--- a/src/plugins/platforms/cocoa/qnsview.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qnsview.mm
|
||||
@@ -393,7 +393,9 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
||||
[self notifyWindowStateChanged:newState];
|
||||
// NSWindowDidOrderOnScreenAndFinishAnimatingNotification is private API, and not
|
||||
// emitted in 10.6, so we bring back the old behavior for that case alone.
|
||||
- if (newState == Qt::WindowNoState && QSysInfo::QSysInfo::MacintoshVersion == QSysInfo::MV_10_6)
|
||||
+
|
||||
+ // Patch: Fix macOS window show after window was hidden.
|
||||
+ if (newState == Qt::WindowNoState/* && QSysInfo::QSysInfo::MacintoshVersion == QSysInfo::MV_10_6*/)
|
||||
m_platformWindow->exposeWindow();
|
||||
} else if ([notificationName isEqualToString: @"NSWindowDidOrderOffScreenNotification"]) {
|
||||
m_platformWindow->obscureWindow();
|
||||
@@ -1300,7 +1302,9 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
|
||||
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) {
|
||||
// On 10.8 and above, MayBegin is likely to happen. We treat it the same as an actual begin.
|
||||
- if (phase == NSEventPhaseMayBegin)
|
||||
+
|
||||
+ // Patch: Actual begin should be treated as begin as well.
|
||||
+ if (phase == NSEventPhaseMayBegin || phase == NSEventPhaseBegan)
|
||||
ph = Qt::ScrollBegin;
|
||||
} else
|
||||
#endif
|
||||
@@ -1366,14 +1370,22 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
||||
quint32 nativeVirtualKey = [nsevent keyCode];
|
||||
|
||||
QChar ch = QChar::ReplacementCharacter;
|
||||
- int keyCode = Qt::Key_unknown;
|
||||
- if ([characters length] != 0) {
|
||||
- if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0))
|
||||
- ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
|
||||
- else
|
||||
- ch = QChar([characters characterAtIndex:0]);
|
||||
- keyCode = [self convertKeyCode:ch];
|
||||
- }
|
||||
+
|
||||
+ // Patch: Backport a fix for layout-independent shortcuts.
|
||||
+ if ([characters length] != 0) // https://bugreports.qt.io/browse/QTBUG-42584
|
||||
+ ch = QChar([characters characterAtIndex:0]);
|
||||
+ else if ([charactersIgnoringModifiers length] != 0 && ((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)))
|
||||
+ ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
|
||||
+
|
||||
+ int keyCode = [self convertKeyCode:ch];
|
||||
+ //int keyCode = Qt::Key_unknown;
|
||||
+ //if ([characters length] != 0) {
|
||||
+ // if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0))
|
||||
+ // ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
|
||||
+ // else
|
||||
+ // ch = QChar([characters characterAtIndex:0]);
|
||||
+ // keyCode = [self convertKeyCode:ch];
|
||||
+ //}
|
||||
|
||||
// we will send a key event unless the input method sets m_sendKeyEvent to false
|
||||
m_sendKeyEvent = true;
|
||||
@@ -1437,6 +1449,11 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
||||
&& qtKey == Qt::Key_Period) {
|
||||
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)];
|
||||
return YES;
|
||||
+
|
||||
+ // Patch: Allow us to handle Ctrl+Tab and Ctrl+Backtab in the app.
|
||||
+ } else if ([nsevent modifierFlags] & NSControlKeyMask && (qtKey == Qt::Key_Tab || qtKey == Qt::Key_Backtab)) {
|
||||
+ [self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)];
|
||||
+ return YES;
|
||||
}
|
||||
}
|
||||
return [super performKeyEquivalent:nsevent];
|
||||
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
|
||||
index c68076477f..e2a7aafa58 100644
|
||||
--- a/src/tools/qlalr/lalr.cpp
|
||||
+++ b/src/tools/qlalr/lalr.cpp
|
||||
@@ -246,11 +246,13 @@ void Grammar::buildExtendedGrammar ()
|
||||
non_terminals.insert (accept_symbol);
|
||||
}
|
||||
|
||||
-struct _Nullable: public std::unary_function<Name, bool>
|
||||
+// Patch: Fix building with the new SDK.
|
||||
+struct __Nullable: public std::unary_function<Name, bool>
|
||||
{
|
||||
Automaton *_M_automaton;
|
||||
|
||||
- _Nullable (Automaton *aut):
|
||||
+ // Patch: Fix building with the new SDK.
|
||||
+ __Nullable (Automaton *aut):
|
||||
_M_automaton (aut) {}
|
||||
|
||||
bool operator () (Name name) const
|
||||
@@ -308,7 +310,8 @@ void Automaton::buildNullables ()
|
||||
|
||||
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
|
||||
{
|
||||
- NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (_Nullable (this)));
|
||||
+ // Patch: Fix building with the new SDK.
|
||||
+ NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (__Nullable (this)));
|
||||
|
||||
if (nn == rule->rhs.end ())
|
||||
changed |= nullables.insert (rule->lhs).second;
|
||||
@@ -643,7 +646,8 @@ void Automaton::buildIncludesDigraph ()
|
||||
if (! _M_grammar->isNonTerminal (*A))
|
||||
continue;
|
||||
|
||||
- NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (_Nullable (this)));
|
||||
+ // Patch: Fix building with the new SDK.
|
||||
+ NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (__Nullable (this)));
|
||||
if (first_not_nullable != rule->rhs.end ())
|
||||
continue;
|
||||
|
||||
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
|
||||
index 7396808442..7178aecf80 100644
|
||||
--- a/src/widgets/kernel/qwidget.cpp
|
||||
+++ b/src/widgets/kernel/qwidget.cpp
|
||||
@@ -4722,6 +4722,17 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
|
||||
return; // Fully transparent.
|
||||
|
||||
Q_D(QWidget);
|
||||
+
|
||||
+ // Patch: save and restore dirtyOpaqueChildren field.
|
||||
+ //
|
||||
+ // Just like in QWidget::grab() this field should be restored
|
||||
+ // after the d->render() call, because it will be set to 1 and
|
||||
+ // opaqueChildren field will be filled with empty region in
|
||||
+ // case the widget is hidden (because all the opaque children
|
||||
+ // will be skipped in isVisible() check).
|
||||
+ //
|
||||
+ const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren;
|
||||
+
|
||||
const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter;
|
||||
const QRegion toBePainted = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags)
|
||||
: sourceRegion;
|
||||
@@ -4743,6 +4754,10 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
|
||||
if (!inRenderWithPainter && (opacity < 1.0 || (target->devType() == QInternal::Printer))) {
|
||||
d->render_helper(painter, targetOffset, toBePainted, renderFlags);
|
||||
d->extra->inRenderWithPainter = inRenderWithPainter;
|
||||
+
|
||||
+ // Patch: save and restore dirtyOpaqueChildren field.
|
||||
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
|
||||
+
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4774,6 +4789,9 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
|
||||
d->setSharedPainter(oldPainter);
|
||||
|
||||
d->extra->inRenderWithPainter = inRenderWithPainter;
|
||||
+
|
||||
+ // Patch: save and restore dirtyOpaqueChildren field.
|
||||
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
|
||||
}
|
||||
|
||||
static void sendResizeEvents(QWidget *target)
|
||||
@@ -7983,7 +8001,8 @@ bool QWidget::event(QEvent *event)
|
||||
case QEvent::KeyPress: {
|
||||
QKeyEvent *k = (QKeyEvent *)event;
|
||||
bool res = false;
|
||||
- if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
|
||||
+ // Patch: Allow us to handle Ctrl+Tab and Ctrl+Backtab in the app.
|
||||
+ if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier))) { //### Add MetaModifier?
|
||||
if (k->key() == Qt::Key_Backtab
|
||||
|| (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier)))
|
||||
res = focusNextPrevChild(false);
|
||||
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
|
||||
index 0845a5eb02..5735cb6b39 100644
|
||||
--- a/src/widgets/styles/qmacstyle_mac.mm
|
||||
+++ b/src/widgets/styles/qmacstyle_mac.mm
|
||||
@@ -3667,9 +3667,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
||||
|
||||
NSBezierPath *pushButtonFocusRingPath;
|
||||
if (bdi.kind == kThemeBevelButton)
|
||||
- pushButtonFocusRingPath = [NSBezierPath bezierPathWithRect:focusRect];
|
||||
+ // Patch: Fix building with the new SDK.
|
||||
+ pushButtonFocusRingPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(focusRect)];
|
||||
else
|
||||
- pushButtonFocusRingPath = [NSBezierPath bezierPathWithRoundedRect:focusRect xRadius:4 yRadius:4];
|
||||
+ // Patch: Fix building with the new SDK.
|
||||
+ pushButtonFocusRingPath = [NSBezierPath bezierPathWithRoundedRect:NSRectFromCGRect(focusRect) xRadius:4 yRadius:4];
|
||||
qt_drawFocusRingOnPath(cg, pushButtonFocusRingPath);
|
||||
}
|
||||
|
||||
diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp
|
||||
index f98aeaf678..00c0734129 100644
|
||||
--- a/src/widgets/util/qsystemtrayicon_qpa.cpp
|
||||
+++ b/src/widgets/util/qsystemtrayicon_qpa.cpp
|
||||
@@ -99,13 +99,18 @@ void QSystemTrayIconPrivate::updateIcon_sys()
|
||||
|
||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
||||
{
|
||||
- if (qpa_sys && menu) {
|
||||
- if (!menu->platformMenu()) {
|
||||
- QPlatformMenu *platformMenu = qpa_sys->createMenu();
|
||||
- if (platformMenu)
|
||||
- menu->setPlatformMenu(platformMenu);
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ if (qpa_sys) {
|
||||
+ if (menu) {
|
||||
+ if (!menu->platformMenu()) {
|
||||
+ QPlatformMenu *platformMenu = qpa_sys->createMenu();
|
||||
+ if (platformMenu)
|
||||
+ menu->setPlatformMenu(platformMenu);
|
||||
+ }
|
||||
+ qpa_sys->updateMenu(menu->platformMenu());
|
||||
+ } else {
|
||||
+ qpa_sys->updateMenu(0);
|
||||
}
|
||||
- qpa_sys->updateMenu(menu->platformMenu());
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
|
||||
index 75f30599be..980f2be1e9 100644
|
||||
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
|
||||
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
|
||||
@@ -1867,7 +1867,8 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
|
||||
|
||||
if (unknown && !isReadOnly()) {
|
||||
QString t = event->text();
|
||||
- if (!t.isEmpty() && t.at(0).isPrint()) {
|
||||
+ // Patch: Enable ZWJ and ZWNJ characters to be in text input.
|
||||
+ if (!t.isEmpty() && (t.at(0).isPrint() || t.at(0).unicode() == 0x200C || t.at(0).unicode() == 0x200D)) {
|
||||
insert(t);
|
||||
#ifndef QT_NO_COMPLETER
|
||||
complete(event->key());
|
||||
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
|
||||
index 96438a0bdf..b0b7206405 100644
|
||||
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
|
||||
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
|
||||
@@ -1342,7 +1342,8 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e)
|
||||
process:
|
||||
{
|
||||
QString text = e->text();
|
||||
- if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) {
|
||||
+ // Patch: Enable ZWJ and ZWNJ characters to be in text input.
|
||||
+ if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t') || text.at(0).unicode() == 0x200C || text.at(0).unicode() == 0x200D)) {
|
||||
if (overwriteMode
|
||||
// no need to call deleteChar() if we have a selection, insertText
|
||||
// does it already
|
||||
47
Telegram/Patches/macold/qtimageformats_5_3_2.diff
Normal file
@@ -0,0 +1,47 @@
|
||||
diff --git a/src/3rdparty/libwebp/src/dec/vp8l.c b/src/3rdparty/libwebp/src/dec/vp8l.c
|
||||
index ea0254d..953ff01 100644
|
||||
--- a/src/3rdparty/libwebp/src/dec/vp8l.c
|
||||
+++ b/src/3rdparty/libwebp/src/dec/vp8l.c
|
||||
@@ -12,7 +12,7 @@
|
||||
// Authors: Vikas Arora (vikaas.arora@gmail.com)
|
||||
// Jyrki Alakuijala (jyrki@google.com)
|
||||
|
||||
-#include <stdio.h>
|
||||
+// Patch: Backport of a crash fix.
|
||||
#include <stdlib.h>
|
||||
#include "./alphai.h"
|
||||
#include "./vp8li.h"
|
||||
@@ -740,6 +740,10 @@ static int DecodeAlphaData(VP8LDecoder* const dec, uint8_t* const data,
|
||||
const int len_code_limit = NUM_LITERAL_CODES + NUM_LENGTH_CODES;
|
||||
const int mask = hdr->huffman_mask_;
|
||||
assert(htree_group != NULL);
|
||||
+
|
||||
+ // Patch: Backport of a crash fix.
|
||||
+ assert(pos < end);
|
||||
+
|
||||
assert(last_row <= height);
|
||||
assert(Is8bOptimizable(hdr));
|
||||
|
||||
@@ -830,6 +834,10 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data,
|
||||
(hdr->color_cache_size_ > 0) ? &hdr->color_cache_ : NULL;
|
||||
const int mask = hdr->huffman_mask_;
|
||||
assert(htree_group != NULL);
|
||||
+
|
||||
+ // Patch: Backport of a crash fix.
|
||||
+ assert(src < src_end);
|
||||
+
|
||||
assert(src_last <= src_end);
|
||||
|
||||
while (!br->eos_ && src < src_last) {
|
||||
@@ -1294,6 +1302,11 @@ int VP8LDecodeAlphaImageStream(ALPHDecoder* const alph_dec, int last_row) {
|
||||
assert(dec->action_ == READ_DATA);
|
||||
assert(last_row <= dec->height_);
|
||||
|
||||
+ // Patch: Backport of a crash fix.
|
||||
+ if (dec->last_pixel_ == dec->width_ * dec->height_) {
|
||||
+ return 1; // done
|
||||
+ }
|
||||
+
|
||||
// Decode (with special row processing).
|
||||
return alph_dec->use_8b_decode ?
|
||||
DecodeAlphaData(dec, (uint8_t*)dec->pixels_, dec->width_, dec->height_,
|
||||
52
Telegram/Patches/mini_chromium.diff
Normal file
@@ -0,0 +1,52 @@
|
||||
diff --git a/base/mac/scoped_nsobject.h b/base/mac/scoped_nsobject.h
|
||||
index 2e157a4..5a306a1 100644
|
||||
--- a/base/mac/scoped_nsobject.h
|
||||
+++ b/base/mac/scoped_nsobject.h
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/mac/scoped_typeref.h"
|
||||
+#include "base/template_util.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@@ -55,7 +56,7 @@ class scoped_nsobject : public scoped_nsprotocol<NST*> {
|
||||
public:
|
||||
using scoped_nsprotocol<NST*>::scoped_nsprotocol;
|
||||
|
||||
- static_assert(std::is_same<NST, NSAutoreleasePool>::value == false,
|
||||
+ static_assert(is_same<NST, NSAutoreleasePool>::value == false,
|
||||
"Use ScopedNSAutoreleasePool instead");
|
||||
};
|
||||
|
||||
diff --git a/base/macros.h b/base/macros.h
|
||||
index 5d96783..096704c 100644
|
||||
--- a/base/macros.h
|
||||
+++ b/base/macros.h
|
||||
@@ -42,8 +42,9 @@ char (&ArraySizeHelper(const T (&array)[N]))[N];
|
||||
|
||||
template <typename Dest, typename Source>
|
||||
inline Dest bit_cast(const Source& source) {
|
||||
+#if __cplusplus >= 201103L
|
||||
static_assert(sizeof(Dest) == sizeof(Source), "sizes must be equal");
|
||||
-
|
||||
+#endif
|
||||
Dest dest;
|
||||
memcpy(&dest, &source, sizeof(dest));
|
||||
return dest;
|
||||
diff --git a/build/common.gypi b/build/common.gypi
|
||||
index 1affc70..6e8f292 100644
|
||||
--- a/build/common.gypi
|
||||
+++ b/build/common.gypi
|
||||
@@ -66,6 +66,11 @@
|
||||
'conditions': [
|
||||
['clang!=0', {
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
|
||||
+ 'conditions': [
|
||||
+ ['mac_deployment_target=="10.8"', {
|
||||
+ 'CLANG_CXX_LIBRARY': 'libc++', # force -stdlib=libc++ for 10.8
|
||||
+ }]
|
||||
+ ],
|
||||
|
||||
# Don't link in libarclite_macosx.a, see http://crbug.com/156530.
|
||||
'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
|
||||
22
Telegram/Patches/openal.diff
Normal file
@@ -0,0 +1,22 @@
|
||||
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
|
||||
index 9d8f8e9..8c8e44a 100644
|
||||
--- a/Alc/backends/winmm.c
|
||||
+++ b/Alc/backends/winmm.c
|
||||
@@ -219,7 +219,7 @@ FORCE_ALIGN static int ALCwinmmPlayback_mixerProc(void *arg)
|
||||
SetRTPriority();
|
||||
althrd_setname(althrd_current(), MIXER_THREAD_NAME);
|
||||
|
||||
- while(GetMessage(&msg, NULL, 0, 0))
|
||||
+ if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if(msg.message != WOM_DONE)
|
||||
continue;
|
||||
@@ -504,7 +504,7 @@ static int ALCwinmmCapture_captureProc(void *arg)
|
||||
|
||||
althrd_setname(althrd_current(), RECORD_THREAD_NAME);
|
||||
|
||||
- while(GetMessage(&msg, NULL, 0, 0))
|
||||
+ if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if(msg.message != WIM_DATA)
|
||||
continue;
|
||||
1708
Telegram/Patches/qtbase_5_6_2.diff
Normal file
BIN
Telegram/Resources/art/bg.jpg
Normal file
|
After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 47 KiB |
BIN
Telegram/Resources/art/favicon.ico
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 826 B |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 361 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 95 KiB |