summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Minnocci2021-05-28 15:05:46 +0200
committerFrancesco Minnocci2021-05-28 15:05:46 +0200
commit9c823e0618469f61ef1312bd1b491b8b933a8f17 (patch)
treea3c892e91e85d131d03ea08708ed6d4f84057592
parentd1394db0cb3ad495e8cd3bb81ca7281e5fc0a3fe (diff)
downloadaur-9c823e0618469f61ef1312bd1b491b8b933a8f17.tar.gz
Add patch for building with gcc11; move gtk3 and webkit2gtk in makedeps
-rw-r--r--.SRCINFO35
-rw-r--r--PKGBUILD74
-rw-r--r--dlopen-gtk.patch106
-rw-r--r--lib_base-gcc11-fix.patch12
-rw-r--r--mallocng.patch23
5 files changed, 241 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6cbadd1b8ea8..b672e58fb5b0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -13,6 +13,8 @@ pkgbase = kotatogram-dev-git
makedepends = tl-expected
makedepends = microsoft-gsl
makedepends = libtg_owt
+ makedepends = gtk3
+ makedepends = webkit2gtk
depends = qt5-imageformats
depends = ffmpeg
depends = openal
@@ -24,10 +26,9 @@ pkgbase = kotatogram-dev-git
depends = libdbusmenu-qt5
depends = hunspell
optdepends = ttf-opensans: default Open Sans font family
- optdepends = gtk3: GTK integration
provides = kotatogram-desktop
conflicts = kotatogram-desktop
- source = kotatogram-desktop::git+https://github.com/kotatogram/kotatogram-desktop.git#branch=test
+ source = kotatogram-desktop::git+https://github.com/kotatogram/kotatogram-desktop.git#branch=dev
source = kotatogram-desktop-libtgvoip::git+https://github.com/telegramdesktop/libtgvoip
source = kotatogram-desktop-rlottie::git+https://github.com/desktop-app/rlottie.git
source = kotatogram-desktop-lib_crl::git+https://github.com/desktop-app/lib_crl.git
@@ -45,7 +46,24 @@ pkgbase = kotatogram-dev-git
source = kotatogram-desktop-lib_qr::git+https://github.com/desktop-app/lib_qr.git
source = kotatogram-desktop-lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git
source = kotatogram-desktop-tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git
+ source = kotatogram-desktop-lib_webview::git+https://github.com/kotatogram/lib_webview.git
+ source = kotatogram-desktop-mallocng::git+https://github.com/desktop-app/mallocng.git
source = 0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch
+ source = dlopen-gtk.patch
+ source = https://github.com/telegramdesktop/tdesktop/commit/71deaa48afab2bcf9df67b9b347b1f44aad3a9ce.patch
+ source = https://github.com/telegramdesktop/tdesktop/commit/a8807bc915f2439acc7c84f06d931d96d6ca602a.patch
+ source = https://github.com/telegramdesktop/tdesktop/commit/d87ea056c6166345d061fc3a69a6f95eceaab0a1.patch
+ source = https://github.com/telegramdesktop/tdesktop/commit/98180d3a9e994081a134196adad0023651d28bf3.patch
+ source = https://github.com/telegramdesktop/tdesktop/commit/383acf0ffc489990302797ff0f048519b3c7c9bf.patch
+ source = lib_base-gcc11-fix.patch
+ source = https://github.com/desktop-app/lib_webview/commit/8816639c74a4cb6d512cba8e2271aceb404b0492.patch
+ source = mallocng.patch
+ source = https://github.com/desktop-app/cmake_helpers/commit/5318ac7c54dbf33b17ccc4bd3281bb8b8db25e02.patch
+ source = https://github.com/desktop-app/cmake_helpers/commit/de65519132126db2c2166cdf5af5f12e61652419.patch
+ source = https://github.com/desktop-app/cmake_helpers/commit/45be9e321517f15378982bd0353f80ab884679eb.patch
+ source = https://github.com/desktop-app/cmake_helpers/commit/bcc0ac15f497513455aa144ffe4e658f7aca0e73.patch
+ sha512sums = SKIP
+ sha512sums = SKIP
sha512sums = SKIP
sha512sums = SKIP
sha512sums = SKIP
@@ -65,5 +83,18 @@ pkgbase = kotatogram-dev-git
sha512sums = SKIP
sha512sums = SKIP
sha512sums = 13357d081fb658c735bb2575360f5d48214e1cf5002719ba410405a2fe05c7c3d2379588c2ca3c2ca6a5e6ff64e01e6d1ff3aecdaee8f3dd0519a64f6ee94182
+ sha512sums = 3a2cf87836153d2a184b18e8ede4a279e5b55c6c8023e2ac5234482c510c4a7aff58fade8f6fcb4d52fb76601afda11b676694d4eaf3029836101aeeee0007e7
+ sha512sums = cabdadddc7a6873c7c6fc8128ceddf2712c0c73d3316520482162e5c67937bda2a627ddb2f078558a52e812c2a876351196488a5a75381d84a43815b873bac5b
+ sha512sums = 72ef9bddef1f40e09b9c4334153f1ab8aaddf63d95d9f25dc1b0a0826b7f2ae24f7c5fc4cb5ce90aae2c3144a5d52c4cb870d643f447d654190c4a2c78079354
+ sha512sums = b285c65c2e6bb70730eddca2fe6b58e0d0cee466f919913f00f5b81fd4e67e3edd147de572bb5604317ad0c16b568ae4001e63433bd40d6a910b9cdb6aa61d83
+ sha512sums = fcc4c5f649381ace974a3b73cd76f7dd3e78c3a8c0d0bffeccd3e66ec45b84c0cada1f6fd91e1498e0442ed70b679d6b975b499b1f37d25113053b38c873e9e7
+ sha512sums = c5511bd073095a171b998ae8425d01305ac7927398640c0b62d5dcbcc2184e8dae25c1430a5950c45fac38ec5de353449765454f428fa6e16dc588214edd8db8
+ sha512sums = ce364d20b9c3e8d65d4d0def6c2f025e16814c8782c78f720ee5e9891e0b296c6edca9f3a7fa46652516c6a748e29a8cdbbf5f7d1273e4e1a64c7216275c5cda
+ sha512sums = c82e41e9fab49d7eca4602327ebb10c795cf6db414a3c5fe91271af336c327fed5a5c67e3219734e20b7559ff7cbca220be8b94b3b551bf33c162c90370e5af3
+ sha512sums = 12c6a439b3960cb5a25edd2b2b1959f96fdbba634f281890f5ec91420834a852a7bcfa5d11051dfdf4fe719137345b23ae77a8e48eb6b9444ad973a34574cb84
+ sha512sums = 2f7c24851e9879b238366c82f35a046c5a69ec5059e6441ac6eae578450669f094bb659a63b79be635dcae93ddd388bc957e29a219cc3cfc0e6591f0f333d7e3
+ sha512sums = 6bce17e6e763859a95a35ff759b56aa5e51b7ba7534d5502517ae3a970cb42d901b2f6a9862a4ef06adfa5ef85e6e3e517a16ce7ab516ee9f3e4c21c38bb8cdb
+ sha512sums = 110654df22e36fc3185e8db05fd4cefcee30ade1a76f0640b97a15bcf532b8b560e8a9740f4e73be48accad4459487e5246d8f44d988a021b9f8024d27d29bfe
+ sha512sums = db3d5b53436a732ea2950c7772c9edec2e6879caefa2bfb6112e5bb12f464a33a11ca9d4f3d2699da99df97d6721fbcf958a8b2256e911fb9a18c8229e5b67fd
pkgname = kotatogram-dev-git
diff --git a/PKGBUILD b/PKGBUILD
index 4afa8d85df5c..4c385571cba0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,8 +2,8 @@
pkgname=kotatogram-dev-git
_pkgname=kotatogram-desktop
-pkgver=k1.4.12.g40df43998
-pkgrel=2
+pkgver=k1.4.1.6.gb0fed1a6a
+pkgrel=1
pkgdesc="Kotatogram – experimental Telegram Desktop fork - Dev branch"
arch=(x86_64)
url="https://github.com/kotatogram/kotatogram-desktop"
@@ -29,15 +29,16 @@ makedepends=(
tl-expected
microsoft-gsl
libtg_owt
+ gtk3
+ webkit2gtk
)
optdepends=(
'ttf-opensans: default Open Sans font family'
- 'gtk3: GTK integration'
)
conflicts=('kotatogram-desktop')
provides=('kotatogram-desktop')
source=(
- "${_pkgname}::git+${url}.git#branch=test"
+ "${_pkgname}::git+${url}.git#branch=dev"
"${_pkgname}-libtgvoip::git+https://github.com/telegramdesktop/libtgvoip"
"${_pkgname}-rlottie::git+https://github.com/desktop-app/rlottie.git"
"${_pkgname}-lib_crl::git+https://github.com/desktop-app/lib_crl.git"
@@ -55,9 +56,25 @@ source=(
"${_pkgname}-lib_qr::git+https://github.com/desktop-app/lib_qr.git"
"${_pkgname}-lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git"
"${_pkgname}-tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git"
+ "${_pkgname}-lib_webview::git+https://github.com/kotatogram/lib_webview.git"
+ "${_pkgname}-mallocng::git+https://github.com/desktop-app/mallocng.git"
"0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch"
-)
-sha512sums=('SKIP'
+ "dlopen-gtk.patch"
+ "https://github.com/telegramdesktop/tdesktop/commit/71deaa48afab2bcf9df67b9b347b1f44aad3a9ce.patch"
+ "https://github.com/telegramdesktop/tdesktop/commit/a8807bc915f2439acc7c84f06d931d96d6ca602a.patch"
+ "https://github.com/telegramdesktop/tdesktop/commit/d87ea056c6166345d061fc3a69a6f95eceaab0a1.patch"
+ "https://github.com/telegramdesktop/tdesktop/commit/98180d3a9e994081a134196adad0023651d28bf3.patch"
+ "https://github.com/telegramdesktop/tdesktop/commit/383acf0ffc489990302797ff0f048519b3c7c9bf.patch"
+ "lib_base-gcc11-fix.patch"
+ "https://github.com/desktop-app/lib_webview/commit/8816639c74a4cb6d512cba8e2271aceb404b0492.patch"
+ "mallocng.patch"
+ "https://github.com/desktop-app/cmake_helpers/commit/5318ac7c54dbf33b17ccc4bd3281bb8b8db25e02.patch"
+ "https://github.com/desktop-app/cmake_helpers/commit/de65519132126db2c2166cdf5af5f12e61652419.patch"
+ "https://github.com/desktop-app/cmake_helpers/commit/45be9e321517f15378982bd0353f80ab884679eb.patch"
+ "https://github.com/desktop-app/cmake_helpers/commit/bcc0ac15f497513455aa144ffe4e658f7aca0e73.patch")
+sha512sums=(
+ 'SKIP'
+ 'SKIP'
'SKIP'
'SKIP'
'SKIP'
@@ -75,7 +92,22 @@ sha512sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
- '13357d081fb658c735bb2575360f5d48214e1cf5002719ba410405a2fe05c7c3d2379588c2ca3c2ca6a5e6ff64e01e6d1ff3aecdaee8f3dd0519a64f6ee94182')
+ 'SKIP'
+ '13357d081fb658c735bb2575360f5d48214e1cf5002719ba410405a2fe05c7c3d2379588c2ca3c2ca6a5e6ff64e01e6d1ff3aecdaee8f3dd0519a64f6ee94182'
+ '3a2cf87836153d2a184b18e8ede4a279e5b55c6c8023e2ac5234482c510c4a7aff58fade8f6fcb4d52fb76601afda11b676694d4eaf3029836101aeeee0007e7'
+ 'cabdadddc7a6873c7c6fc8128ceddf2712c0c73d3316520482162e5c67937bda2a627ddb2f078558a52e812c2a876351196488a5a75381d84a43815b873bac5b'
+ '72ef9bddef1f40e09b9c4334153f1ab8aaddf63d95d9f25dc1b0a0826b7f2ae24f7c5fc4cb5ce90aae2c3144a5d52c4cb870d643f447d654190c4a2c78079354'
+ 'b285c65c2e6bb70730eddca2fe6b58e0d0cee466f919913f00f5b81fd4e67e3edd147de572bb5604317ad0c16b568ae4001e63433bd40d6a910b9cdb6aa61d83'
+ 'fcc4c5f649381ace974a3b73cd76f7dd3e78c3a8c0d0bffeccd3e66ec45b84c0cada1f6fd91e1498e0442ed70b679d6b975b499b1f37d25113053b38c873e9e7'
+ 'c5511bd073095a171b998ae8425d01305ac7927398640c0b62d5dcbcc2184e8dae25c1430a5950c45fac38ec5de353449765454f428fa6e16dc588214edd8db8'
+ 'ce364d20b9c3e8d65d4d0def6c2f025e16814c8782c78f720ee5e9891e0b296c6edca9f3a7fa46652516c6a748e29a8cdbbf5f7d1273e4e1a64c7216275c5cda'
+ 'c82e41e9fab49d7eca4602327ebb10c795cf6db414a3c5fe91271af336c327fed5a5c67e3219734e20b7559ff7cbca220be8b94b3b551bf33c162c90370e5af3'
+ '12c6a439b3960cb5a25edd2b2b1959f96fdbba634f281890f5ec91420834a852a7bcfa5d11051dfdf4fe719137345b23ae77a8e48eb6b9444ad973a34574cb84'
+ '2f7c24851e9879b238366c82f35a046c5a69ec5059e6441ac6eae578450669f094bb659a63b79be635dcae93ddd388bc957e29a219cc3cfc0e6591f0f333d7e3'
+ '6bce17e6e763859a95a35ff759b56aa5e51b7ba7534d5502517ae3a970cb42d901b2f6a9862a4ef06adfa5ef85e6e3e517a16ce7ab516ee9f3e4c21c38bb8cdb'
+ '110654df22e36fc3185e8db05fd4cefcee30ade1a76f0640b97a15bcf532b8b560e8a9740f4e73be48accad4459487e5246d8f44d988a021b9f8024d27d29bfe'
+ 'db3d5b53436a732ea2950c7772c9edec2e6879caefa2bfb6112e5bb12f464a33a11ca9d4f3d2699da99df97d6721fbcf958a8b2256e911fb9a18c8229e5b67fd'
+)
pkgver() {
cd "${srcdir}/${_pkgname}"
@@ -103,6 +135,7 @@ prepare() {
git config submodule.Telegram/lib_qr.url "${srcdir}/${_pkgname}-lib_qr"
git config sumbodule.Telegram/lib_webrtc.url "${srcdir}/${_pkgname}-lib_webrtc"
git config sumbodule.Telegram/ThirdParty/tgcalls.url "${srcdir}/${_pkgname}-tgcalls"
+ git config submodule.Telegram/lib_webview.url "${srcdir}/${_pkgname}-lib_webview"
git submodule update
pushd cmake
@@ -111,6 +144,33 @@ prepare() {
popd
patch -p1 < ${srcdir}/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch
+ patch -p1 < ${srcdir}/dlopen-gtk.patch
+
+ # some fixes
+ patch -p1 < ${srcdir}/71deaa48afab2bcf9df67b9b347b1f44aad3a9ce.patch
+ patch -p1 < ${srcdir}/a8807bc915f2439acc7c84f06d931d96d6ca602a.patch
+ patch -p1 < ${srcdir}/d87ea056c6166345d061fc3a69a6f95eceaab0a1.patch
+ patch -p1 < ${srcdir}/98180d3a9e994081a134196adad0023651d28bf3.patch
+ patch -p1 < ${srcdir}/383acf0ffc489990302797ff0f048519b3c7c9bf.patch
+ pushd Telegram/lib_base
+ patch -p1 < ${srcdir}/lib_base-gcc11-fix.patch
+ popd
+ pushd Telegram/lib_webview
+ patch -p1 < ${srcdir}/8816639c74a4cb6d512cba8e2271aceb404b0492.patch
+ popd
+
+ # backported mallocng usage
+ patch -p1 < ${srcdir}/mallocng.patch
+ pushd cmake
+ patch -p1 < ${srcdir}/5318ac7c54dbf33b17ccc4bd3281bb8b8db25e02.patch
+ patch -p1 < ${srcdir}/de65519132126db2c2166cdf5af5f12e61652419.patch
+ patch -p1 < ${srcdir}/45be9e321517f15378982bd0353f80ab884679eb.patch
+ patch -p1 < ${srcdir}/bcc0ac15f497513455aa144ffe4e658f7aca0e73.patch
+ popd
+ git submodule add "${srcdir}/${_pkgname}-mallocng" Telegram/ThirdParty/mallocng
+ pushd Telegram/ThirdParty/mallocng
+ git checkout cf3eabc443292aad8ee63491274d7865b5e0864c
+ popd
}
build() {
diff --git a/dlopen-gtk.patch b/dlopen-gtk.patch
new file mode 100644
index 000000000000..7f4fb54720bb
--- /dev/null
+++ b/dlopen-gtk.patch
@@ -0,0 +1,106 @@
+diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
+index fe177acf6..3adfac28d 100644
+--- a/Telegram/CMakeLists.txt
++++ b/Telegram/CMakeLists.txt
+@@ -116,21 +116,11 @@ elseif (LINUX)
+ if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
+ find_package(PkgConfig REQUIRED)
+
+- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+- pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
+- target_link_libraries(Telegram PRIVATE PkgConfig::GTK3)
++ pkg_search_module(GTK REQUIRED gtk+-3.0 gtk+-2.0)
++ target_include_directories(Telegram PRIVATE ${GTK_INCLUDE_DIRS})
+
+- if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
+- pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)
+- target_link_libraries(Telegram PRIVATE PkgConfig::X11)
+- endif()
+- else()
+- pkg_search_module(GTK REQUIRED gtk+-3.0 gtk+-2.0)
+- target_include_directories(Telegram PRIVATE ${GTK_INCLUDE_DIRS})
+-
+- if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
+- target_link_libraries(Telegram PRIVATE X11)
+- endif()
++ if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
++ target_link_libraries(Telegram PRIVATE X11)
+ endif()
+ endif()
+ endif()
+Submodule Telegram/lib_base contains modified content
+diff --git a/Telegram/lib_base/CMakeLists.txt b/Telegram/lib_base/CMakeLists.txt
+index b413b47..e3f5973 100644
+--- a/Telegram/lib_base/CMakeLists.txt
++++ b/Telegram/lib_base/CMakeLists.txt
+@@ -242,21 +242,11 @@ if (LINUX)
+ if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
+ find_package(PkgConfig REQUIRED)
+
+- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+- pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
+- target_link_libraries(lib_base PUBLIC PkgConfig::GTK3)
++ pkg_search_module(GTK REQUIRED gtk+-3.0 gtk+-2.0)
++ target_include_directories(lib_base PUBLIC ${GTK_INCLUDE_DIRS})
+
+- if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
+- pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)
+- target_link_libraries(lib_base PUBLIC PkgConfig::X11)
+- endif()
+- else()
+- pkg_search_module(GTK REQUIRED gtk+-3.0 gtk+-2.0)
+- target_include_directories(lib_base PUBLIC ${GTK_INCLUDE_DIRS})
+-
+- if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
+- target_link_libraries(lib_base PUBLIC X11)
+- endif()
++ if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
++ target_link_libraries(lib_base PUBLIC X11)
+ endif()
+ endif()
+ endif()
+diff --git a/Telegram/lib_base/base/platform/linux/base_linux_gtk_integration_p.h b/Telegram/lib_base/base/platform/linux/base_linux_gtk_integration_p.h
+index 73a5bb4..d9551df 100644
+--- a/Telegram/lib_base/base/platform/linux/base_linux_gtk_integration_p.h
++++ b/Telegram/lib_base/base/platform/linux/base_linux_gtk_integration_p.h
+@@ -15,10 +15,6 @@ extern "C" {
+ #include <gdk/gdk.h>
+ } // extern "C"
+
+-#if defined DESKTOP_APP_USE_PACKAGED && !defined DESKTOP_APP_USE_PACKAGED_LAZY
+-#define LINK_TO_GTK
+-#endif // DESKTOP_APP_USE_PACKAGED && !DESKTOP_APP_USE_PACKAGED_LAZY
+-
+ #ifdef LINK_TO_GTK
+ #define LOAD_GTK_SYMBOL(lib, func) (func = ::func)
+ #else // LINK_TO_GTK
+Submodule Telegram/lib_webview contains modified content
+diff --git a/Telegram/lib_webview/CMakeLists.txt b/Telegram/lib_webview/CMakeLists.txt
+index 1f26f0a..f725630 100644
+--- a/Telegram/lib_webview/CMakeLists.txt
++++ b/Telegram/lib_webview/CMakeLists.txt
+@@ -119,19 +119,11 @@ elseif (LINUX)
+ if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
+ find_package(PkgConfig REQUIRED)
+
+- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+- pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
+- target_link_libraries(lib_webview PUBLIC PkgConfig::GTK3)
+-
+- pkg_check_modules(WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-4.0)
+- target_link_libraries(lib_webview PUBLIC PkgConfig::WEBKIT)
+- else()
+- pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
+- target_include_directories(lib_webview PUBLIC ${GTK3_INCLUDE_DIRS})
+-
+- pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0)
+- target_include_directories(lib_webview PUBLIC ${WEBKIT_INCLUDE_DIRS})
+- endif()
++ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
++ target_include_directories(lib_webview PUBLIC ${GTK3_INCLUDE_DIRS})
++
++ pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0)
++ target_include_directories(lib_webview PUBLIC ${WEBKIT_INCLUDE_DIRS})
+ else()
+ remove_target_sources(lib_webview ${src_loc}
+ webview/platform/linux/webview_linux_webkit_gtk.cpp
diff --git a/lib_base-gcc11-fix.patch b/lib_base-gcc11-fix.patch
new file mode 100644
index 000000000000..2405329b0e29
--- /dev/null
+++ b/lib_base-gcc11-fix.patch
@@ -0,0 +1,12 @@
+diff --git a/base/platform/linux/base_linux_gtk_integration.h b/base/platform/linux/base_linux_gtk_integration.h
+index be19ce0..6622d3e 100644
+--- a/base/platform/linux/base_linux_gtk_integration.h
++++ b/base/platform/linux/base_linux_gtk_integration.h
+@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+ #include "base/const_string.h"
+
+ #include <QtCore/QLibrary>
++#include <optional>
+
+ namespace base {
+ namespace Platform {
diff --git a/mallocng.patch b/mallocng.patch
new file mode 100644
index 000000000000..d4288b654177
--- /dev/null
+++ b/mallocng.patch
@@ -0,0 +1,23 @@
+diff --git a/.gitmodules b/.gitmodules
+index beda934f6..01f7cbb83 100644
+--- a/.gitmodules
++++ b/.gitmodules
+@@ -91,3 +91,6 @@
+ [submodule "Telegram/lib_webview"]
+ path = Telegram/lib_webview
+ url = https://github.com/kotatogram/lib_webview.git
++[submodule "Telegram/ThirdParty/mallocng"]
++ path = Telegram/ThirdParty/mallocng
++ url = https://github.com/desktop-app/mallocng.git
+diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
+index 0e00fcee1..fed1f9634 100644
+--- a/Telegram/CMakeLists.txt
++++ b/Telegram/CMakeLists.txt
+@@ -89,6 +89,7 @@ elseif (LINUX)
+ PRIVATE
+ desktop-app::external_glibmm
+ desktop-app::external_glib
++ desktop-app::external_mallocng
+ )
+
+ if (NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)