diff --git a/srcpkgs/telegram-desktop/files/Telegram.cmake b/srcpkgs/telegram-desktop/files/Telegram.cmake index cd08360ebfb..456d2eed261 100644 --- a/srcpkgs/telegram-desktop/files/Telegram.cmake +++ b/srcpkgs/telegram-desktop/files/Telegram.cmake @@ -87,6 +87,7 @@ set(QRC_FILES file(GLOB FLAT_SOURCE_FILES SourceFiles/*.cpp + SourceFiles/api/*.cpp SourceFiles/base/*.cpp SourceFiles/calls/*.cpp SourceFiles/chat_helpers/*.cpp diff --git a/srcpkgs/telegram-desktop/files/TelegramCodegen.cmake b/srcpkgs/telegram-desktop/files/TelegramCodegen.cmake index ae8cdf5ad9c..e62c21ccdd0 100644 --- a/srcpkgs/telegram-desktop/files/TelegramCodegen.cmake +++ b/srcpkgs/telegram-desktop/files/TelegramCodegen.cmake @@ -7,8 +7,11 @@ add_custom_command( OUTPUT ${GENERATED_DIR}/scheme.h ${GENERATED_DIR}/scheme.cpp - COMMAND python ${TELEGRAM_SOURCES_DIR}/codegen/scheme/codegen_scheme.py -o${GENERATED_DIR} ${TELEGRAM_RESOURCES_DIR}/scheme.tl - DEPENDS ${TELEGRAM_RESOURCES_DIR}/scheme.tl + COMMAND python ${TELEGRAM_SOURCES_DIR}/codegen/scheme/codegen_scheme.py + -o${GENERATED_DIR} ${TELEGRAM_RESOURCES_DIR}/tl/mtproto.tl + ${TELEGRAM_RESOURCES_DIR}/tl/api.tl + DEPENDS ${TELEGRAM_RESOURCES_DIR}/tl/mtproto.tl + ${TELEGRAM_RESOURCES_DIR}/tl/api.tl COMMENT "Codegen scheme.tl" ) list(APPEND TELEGRAM_GENERATED_SOURCES diff --git a/srcpkgs/telegram-desktop/patches/0001-Revert-Change-some-private-header-includes.patch b/srcpkgs/telegram-desktop/patches/0001-Revert-Change-some-private-header-includes.patch new file mode 100644 index 00000000000..03d902d371f --- /dev/null +++ b/srcpkgs/telegram-desktop/patches/0001-Revert-Change-some-private-header-includes.patch @@ -0,0 +1,67 @@ +From 9202a047d23b8077a55b93e3d1c9e5fba73b3d10 Mon Sep 17 00:00:00 2001 +From: John Zimmermann +Date: Fri, 9 Aug 2019 22:25:34 +0200 +Subject: [PATCH] Revert "Change some private header includes." + +This reverts commit b9d3ba621eb8af638af46c6b3cfd7a8330bf0dd5. +--- + Telegram/SourceFiles/ui/text/text.cpp | 1 - + Telegram/SourceFiles/ui/text/text.h | 2 +- + Telegram/SourceFiles/ui/text/text_block.cpp | 2 -- + Telegram/SourceFiles/ui/text/text_block.h | 2 +- + 4 files changed, 2 insertions(+), 5 deletions(-) + +diff --git Telegram/SourceFiles/ui/text/text.cpp Telegram/SourceFiles/ui/text/text.cpp +index 99d27b60c..ba0b4844f 100644 +--- Telegram/SourceFiles/ui/text/text.cpp ++++ Telegram/SourceFiles/ui/text/text.cpp +@@ -17,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #include "boxes/confirm_box.h" + #include "mainwindow.h" + +-#include + #include + + namespace Ui { +diff --git Telegram/SourceFiles/ui/text/text.h Telegram/SourceFiles/ui/text/text.h +index 537c0b60d..7906b0eee 100644 +--- Telegram/SourceFiles/ui/text/text.h ++++ Telegram/SourceFiles/ui/text/text.h +@@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #include "core/click_handler.h" + #include "base/flags.h" + +-#include ++#include + + static const QChar TextCommand(0x0010); + enum TextCommands { +diff --git Telegram/SourceFiles/ui/text/text_block.cpp Telegram/SourceFiles/ui/text/text_block.cpp +index c7b3fdead..9637a2e07 100644 +--- Telegram/SourceFiles/ui/text/text_block.cpp ++++ Telegram/SourceFiles/ui/text/text_block.cpp +@@ -9,8 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + + #include "core/crash_reports.h" + +-#include +- + // COPIED FROM qtextlayout.cpp AND MODIFIED + namespace Ui { + namespace Text { +diff --git Telegram/SourceFiles/ui/text/text_block.h Telegram/SourceFiles/ui/text/text_block.h +index a20b8123c..38e1e0446 100644 +--- Telegram/SourceFiles/ui/text/text_block.h ++++ Telegram/SourceFiles/ui/text/text_block.h +@@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + */ + #pragma once + +-#include ++#include + + namespace Ui { + namespace Text { +-- +2.22.0 + diff --git a/srcpkgs/telegram-desktop/patches/0001-Use-private-Qt-color-API-only-in-official-build.patch b/srcpkgs/telegram-desktop/patches/0001-Use-private-Qt-color-API-only-in-official-build.patch deleted file mode 100644 index 5e8a93f96f4..00000000000 --- a/srcpkgs/telegram-desktop/patches/0001-Use-private-Qt-color-API-only-in-official-build.patch +++ /dev/null @@ -1,175 +0,0 @@ -From 0710dde4d5526454318b2748331e887c01ecfdce Mon Sep 17 00:00:00 2001 -From: John Preston -Date: Tue, 9 Jul 2019 13:43:57 +0200 -Subject: [PATCH 1/2] Use private Qt color API only in official build. - -Fixes #6219. ---- - .../SourceFiles/ffmpeg/ffmpeg_utility.cpp | 100 ++++++++++++------ - Telegram/gyp/lib_ffmpeg.gyp | 6 +- - 2 files changed, 71 insertions(+), 35 deletions(-) - -diff --git Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp -index 5d0e50926..3775f7503 100644 ---- Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp -+++ Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp -@@ -11,7 +11,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - #include "logs.h" - - #include -+ -+#ifdef TDESKTOP_OFFICIAL_TARGET - #include -+#endif // TDESKTOP_OFFICIAL_TARGET - - extern "C" { - #include -@@ -44,6 +47,58 @@ void AlignedImageBufferCleanupHandler(void* data) { - && !(image.bytesPerLine() % kAlignImageBy); - } - -+void UnPremultiplyLine(uchar *dst, const uchar *src, int intsCount) { -+#ifdef TDESKTOP_OFFICIAL_TARGET -+ const auto layout = &qPixelLayouts[QImage::Format_ARGB32]; -+ const auto convert = layout->convertFromARGB32PM; -+#else // TDESKTOP_OFFICIAL_TARGET -+ const auto layout = nullptr; -+ const auto convert = []( -+ uint *dst, -+ const uint *src, -+ int count, -+ std::nullptr_t, -+ std::nullptr_t) { -+ for (auto i = 0; i != count; ++i) { -+ dst[i] = qUnpremultiply(src[i]); -+ } -+ }; -+#endif // TDESKTOP_OFFICIAL_TARGET -+ -+ convert( -+ reinterpret_cast(dst), -+ reinterpret_cast(src), -+ intsCount, -+ layout, -+ nullptr); -+} -+ -+void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) { -+#ifdef TDESKTOP_OFFICIAL_TARGET -+ const auto layout = &qPixelLayouts[QImage::Format_ARGB32]; -+ const auto convert = layout->convertToARGB32PM; -+#else // TDESKTOP_OFFICIAL_TARGET -+ const auto layout = nullptr; -+ const auto convert = []( -+ uint *dst, -+ const uint *src, -+ int count, -+ std::nullptr_t, -+ std::nullptr_t) { -+ for (auto i = 0; i != count; ++i) { -+ dst[i] = qPremultiply(src[i]); -+ } -+ }; -+#endif // TDESKTOP_OFFICIAL_TARGET -+ -+ convert( -+ reinterpret_cast(dst), -+ reinterpret_cast(src), -+ intsCount, -+ layout, -+ nullptr); -+} -+ - } // namespace - - IOPointer MakeIOPointer( -@@ -360,58 +415,35 @@ void UnPremultiply(QImage &to, const QImage &from) { - if (!GoodStorageForFrame(to, from.size())) { - to = CreateFrameStorage(from.size()); - } -- -- const auto layout = &qPixelLayouts[QImage::Format_ARGB32]; -- const auto convert = layout->convertFromARGB32PM; - const auto fromPerLine = from.bytesPerLine(); - const auto toPerLine = to.bytesPerLine(); - const auto width = from.width(); -+ const auto height = from.height(); -+ auto fromBytes = from.bits(); -+ auto toBytes = to.bits(); - if (fromPerLine != width * 4 || toPerLine != width * 4) { -- auto fromBytes = from.bits(); -- auto toBytes = to.bits(); -- for (auto i = 0; i != to.height(); ++i) { -- convert( -- reinterpret_cast(toBytes), -- reinterpret_cast(fromBytes), -- width, -- layout, -- nullptr); -+ for (auto i = 0; i != height; ++i) { -+ UnPremultiplyLine(toBytes, fromBytes, width); - fromBytes += fromPerLine; - toBytes += toPerLine; - } - } else { -- convert( -- reinterpret_cast(to.bits()), -- reinterpret_cast(from.bits()), -- from.width() * from.height(), -- layout, -- nullptr); -+ UnPremultiplyLine(toBytes, fromBytes, width * height); - } - } - - void PremultiplyInplace(QImage &image) { -- const auto layout = &qPixelLayouts[QImage::Format_ARGB32]; -- const auto convert = layout->convertToARGB32PM; - const auto perLine = image.bytesPerLine(); - const auto width = image.width(); -+ const auto height = image.height(); -+ auto bytes = image.bits(); - if (perLine != width * 4) { -- auto bytes = image.bits(); -- for (auto i = 0; i != image.height(); ++i) { -- convert( -- reinterpret_cast(bytes), -- reinterpret_cast(bytes), -- width, -- layout, -- nullptr); -+ for (auto i = 0; i != height; ++i) { -+ PremultiplyLine(bytes, bytes, width); - bytes += perLine; - } - } else { -- convert( -- reinterpret_cast(image.bits()), -- reinterpret_cast(image.bits()), -- image.width() * image.height(), -- layout, -- nullptr); -+ PremultiplyLine(bytes, bytes, width * height); - } - } - -diff --git Telegram/gyp/lib_ffmpeg.gyp Telegram/gyp/lib_ffmpeg.gyp -index 9971d76ae..b9ada5362 100644 ---- Telegram/gyp/lib_ffmpeg.gyp -+++ Telegram/gyp/lib_ffmpeg.gyp -@@ -46,7 +46,11 @@ - '<(src_loc)/ffmpeg/ffmpeg_utility.cpp', - '<(src_loc)/ffmpeg/ffmpeg_utility.h', - ], -- 'conditions': [[ 'build_macold', { -+ 'conditions': [[ '"<(official_build_target)" != ""', { -+ 'defines': [ -+ 'TDESKTOP_OFFICIAL_TARGET=<(official_build_target)', -+ ], -+ }], [ 'build_macold', { - 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ], - }, --- -2.22.0 - diff --git a/srcpkgs/telegram-desktop/patches/0002-remove-execinfo-include.patch b/srcpkgs/telegram-desktop/patches/0002-remove-execinfo-include.patch deleted file mode 100644 index 700f0e65cbd..00000000000 --- a/srcpkgs/telegram-desktop/patches/0002-remove-execinfo-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git Telegram/SourceFiles/platform/linux/specific_linux.h Telegram/SourceFiles/platform/linux/specific_linux.h -index 14485149e..9af2a64c0 100644 ---- Telegram/SourceFiles/platform/linux/specific_linux.h -+++ Telegram/SourceFiles/platform/linux/specific_linux.h -@@ -9,7 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - - #include "platform/platform_specific.h" - --#include - #include - - namespace Data { diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template index 38d2da354d8..fda94b6886f 100644 --- a/srcpkgs/telegram-desktop/template +++ b/srcpkgs/telegram-desktop/template @@ -1,11 +1,11 @@ # Template file for 'telegram-desktop' pkgname=telegram-desktop -version=1.7.14 -revision=2 -_libtgvoip_commit=0e92a22746d15157bea46faddd61b79e9964275a +version=1.8.1 +revision=1 +_libtgvoip_commit=d4a0f719ffd8d29e88474f67abc9fc862661c3b9 _GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec _variant_commit=550ac2f159ca883d360c196149b466955c77a573 -_crl_commit=9ea870038a2a667add7f621be6252db909068386 +_crl_commit=52baf11aaeb7f5ea6955a438abaa1aee4c4308d8 _Catch_commit=5ca44b68721833ae3731802ed99af67c6f38a53a wrksrc="tdesktop-${version}" build_wrksrc="Telegram" @@ -30,37 +30,30 @@ distfiles="https://github.com/telegramdesktop/tdesktop/archive/v${version}.tar.g https://github.com/mapbox/variant/archive/${_variant_commit}.tar.gz https://github.com/telegramdesktop/crl/archive/${_crl_commit}.tar.gz https://github.com/catchorg/Catch2/archive/${_Catch_commit}.tar.gz" -checksum="a52ab6efb4dc7579f05543df3fc3814baa09c0644e00ca30e37a9c6f99a5d164 - ee45011d0eda61f188d9f7f077efa64551913c2c7e7250b40f3c7c3a330cd5cc +checksum="4fa1f20d8b4e0a006067fd042b0e85b5df252e9142d2f9b020fa4013d547701e + bb75188b900907a5b00594ad3ddb78195c8d1fdc144e5a458b314dd666eba996 be81db4ab1b57102a0fa1cd0c4a6469294eb9daf24294347592245b754f65ff6 aa794dfefe0a90501587e36d977b958d0df888503117a8d9aa43dc14f8526d9d - 5844fbd5647c1605d8f7b1391e583e484054884cc1a71681e3abeb153b8ec5b4 + 9ab12f23916a66665dce9b3baf16594886322f426516d34e2166e7057d78e18e d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18" - -build_options="clang pulseaudio" +build_options="pulseaudio" build_options_default="pulseaudio" CXXFLAGS="-DTDESKTOP_API_ID=209235 -DTDESKTOP_API_HASH=169ee702e1df4b6e66d80311db36cc43" -if [ "$build_option_clang" ]; then - CFLAGS="-fPIE -fPIC -fstack-protector-strong" - CXXFLAGS+="-fPIE -fPIC -fstack-protector-strong" - LDFLAGS="-pie" - hostmakedepends+=" clang" - configure_args+=" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++" - nocross=yes -fi - case $XBPS_TARGET_MACHINE in - i686*) nodebug=yes;; # ENOMEM - mips*) broken="unsupported";; + mips*) + broken="unsupported" + ;; + armv[56]*) + makedepends+=" libatomic-devel" + configure_args+=" -DUSE_LIBATOMIC=ON" + ;; esac -case "$XBPS_TARGET_MACHINE" in - arm*|mips*) - makedepends+=" libatomic-devel" - configure_args+=" -DUSE_LIBATOMIC=ON" ;; -esac +if [ "$XBPS_WORDSIZE" -eq 32 ]; then + nodebug=yes +fi if [ "$CROSS_BUILD" ]; then hostmakedepends+=" qt5-devel"