diff --git a/srcpkgs/telegram-desktop/files/Telegram.cmake b/srcpkgs/telegram-desktop/files/Telegram.cmake index d5ec0447df1..f6333250d0c 100644 --- a/srcpkgs/telegram-desktop/files/Telegram.cmake +++ b/srcpkgs/telegram-desktop/files/Telegram.cmake @@ -18,7 +18,6 @@ list(APPEND CMAKE_MODULE_PATH option(BUILD_TESTS "Build all available test suites" OFF) option(ENABLE_CRASH_REPORTS "Enable crash reports" ON) option(ENABLE_GTK_INTEGRATION "Enable GTK integration" ON) -option(ENABLE_64BIT "Enable 64bit build" OFF) option(USE_LIBATOMIC "Link Statically against libatomic.a" OFF) find_package(LibLZMA REQUIRED) @@ -190,7 +189,7 @@ else() ) endif() -if(ENABLE_64BIT) +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") list(APPEND TELEGRAM_COMPILE_DEFINITIONS Q_OS_LINUX64 ) @@ -217,4 +216,4 @@ if(BUILD_TESTS) endif() install(TARGETS Telegram RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(FILES ${CMAKE_SOURCE_DIR}/../lib/xdg/telegram-desktop.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) +install(FILES ${CMAKE_SOURCE_DIR}/../lib/xdg/telegramdesktop.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) diff --git a/srcpkgs/telegram-desktop/patches/46946c73236285649950071632beb3f3e855b2ea.patch b/srcpkgs/telegram-desktop/patches/46946c73236285649950071632beb3f3e855b2ea.patch new file mode 100644 index 00000000000..39b14bcc534 --- /dev/null +++ b/srcpkgs/telegram-desktop/patches/46946c73236285649950071632beb3f3e855b2ea.patch @@ -0,0 +1,27 @@ +From 46946c73236285649950071632beb3f3e855b2ea Mon Sep 17 00:00:00 2001 +From: John Preston +Date: Mon, 27 Aug 2018 14:34:18 +0300 +Subject: [PATCH] Use correct SHA1_ functions. + +Fixes #5103. +--- + Telegram/SourceFiles/base/openssl_help.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git Telegram/SourceFiles/base/openssl_help.h Telegram/SourceFiles/base/openssl_help.h +index 0ad4916be..9d776b3da 100644 +--- Telegram/SourceFiles/base/openssl_help.h ++++ Telegram/SourceFiles/base/openssl_help.h +@@ -388,9 +388,9 @@ template < + inline bytes::vector Sha1(Args &&...args) { + return details::Sha( + SHA_CTX(), +- SHA_Init, +- SHA_Update, +- SHA_Final, ++ SHA1_Init, ++ SHA1_Update, ++ SHA1_Final, + args...); + } + diff --git a/srcpkgs/telegram-desktop/patches/fix-xdg.patch b/srcpkgs/telegram-desktop/patches/fix-xdg.patch index 17f57d8a082..68a2d00ec8b 100644 --- a/srcpkgs/telegram-desktop/patches/fix-xdg.patch +++ b/srcpkgs/telegram-desktop/patches/fix-xdg.patch @@ -23,7 +23,7 @@ index 0a80695..550b9f7 100644 Comment=Official desktop version of Telegram messaging app -Exec=telegram-desktop -- %u -Icon=telegram -+Exec=Telegram -externalupdater -- %u ++Exec=env SESSION_MANAGER= Telegram -externalupdater -- %u +Icon=telegram-desktop Terminal=false StartupWMClass=TelegramDesktop diff --git a/srcpkgs/telegram-desktop/patches/gcc-if-constexpr-tmpfix.patch b/srcpkgs/telegram-desktop/patches/gcc-if-constexpr-tmpfix.patch deleted file mode 100644 index 2585cfa6f96..00000000000 --- a/srcpkgs/telegram-desktop/patches/gcc-if-constexpr-tmpfix.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git Telegram/SourceFiles/export/data/export_data_types.cpp Telegram/SourceFiles/export/data/export_data_types.cpp -index f835dc2f9..188708ab8 100644 ---- Telegram/SourceFiles/export/data/export_data_types.cpp -+++ Telegram/SourceFiles/export/data/export_data_types.cpp -@@ -221,7 +221,8 @@ Image ParseMaxImage( - result.width = data.vw.v; - result.height = data.vh.v; - result.file.location = ParseLocation(data.vlocation); -- if constexpr (MTPDphotoCachedSize::Is()) { -+ constexpr bool is = MTPDphotoCachedSize::Is(); -+ if constexpr (is) { - result.file.content = data.vbytes.v; - result.file.size = result.file.content.size(); - } else { -@@ -409,7 +410,8 @@ Document ParseDocument( - result.width = data.vw.v; - result.height = data.vh.v; - result.file.location = ParseLocation(data.vlocation); -- if constexpr (MTPDphotoCachedSize::Is()) { -+ constexpr bool is = MTPDphotoCachedSize::Is(); -+ if constexpr (is) { - result.file.content = data.vbytes.v; - result.file.size = result.file.content.size(); - } else { -@@ -1017,7 +1019,8 @@ Message ParseMessage( - auto result = Message(); - data.match([&](const auto &data) { - result.id = data.vid.v; -- if constexpr (!MTPDmessageEmpty::Is()) { -+ constexpr bool is = (!MTPDmessageEmpty::Is()); -+ if constexpr (is) { - result.toId = ParsePeerId(data.vto_id); - const auto peerId = (!data.is_out() - && data.has_from_id() -diff --git Telegram/SourceFiles/export/export_api_wrap.cpp Telegram/SourceFiles/export/export_api_wrap.cpp -index b618937f6..528d61393 100644 ---- Telegram/SourceFiles/export/export_api_wrap.cpp -+++ Telegram/SourceFiles/export/export_api_wrap.cpp -@@ -709,7 +709,8 @@ void ApiWrap::handleUserpicsSlice(const MTPphotos_Photos &result) { - Expects(_userpicsProcess != nullptr); - - result.match([&](const auto &data) { -- if constexpr (MTPDphotos_photos::Is()) { -+ constexpr bool is = MTPDphotos_photos::Is(); -+ if constexpr (is) { - _userpicsProcess->lastSlice = true; - } - loadUserpicsFiles(Data::ParseUserpicsSlice( -@@ -1141,7 +1142,8 @@ void ApiWrap::requestMessagesSlice() { - result.match([&](const MTPDmessages_messagesNotModified &data) { - error("Unexpected messagesNotModified received."); - }, [&](const auto &data) { -- if constexpr (MTPDmessages_messages::Is()) { -+ constexpr bool is = MTPDmessages_messages::Is(); -+ if constexpr (is) { - _chatProcess->lastSlice = true; - } - loadMessagesFiles(Data::ParseMessagesSlice( diff --git a/srcpkgs/telegram-desktop/patches/musl.patch b/srcpkgs/telegram-desktop/patches/musl.patch new file mode 100644 index 00000000000..15413ba868a --- /dev/null +++ b/srcpkgs/telegram-desktop/patches/musl.patch @@ -0,0 +1,17 @@ +--- Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp 2018-08-17 18:31:40.000000000 +0200 ++++ - 2018-08-27 22:12:11.843668433 +0200 +@@ -6,6 +6,7 @@ + + #include "AudioPulse.h" + #include ++#include + #include "../../logging.h" + + #define DECLARE_DL_FUNCTION(name) typeof(name)* AudioPulse::_import_##name=NULL +@@ -283,4 +284,4 @@ + } + pa_mainloop_iterate(ml, 1, NULL); + } +-} +\ No newline at end of file ++} diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template index 34be1ca918d..c49cf612fb1 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.3.10 +version=1.3.13 revision=1 -_libtgvoip_commit=697eea96aa90205db4fc368df4127eef56b2a5c6 +_libtgvoip_commit=4b46bc08a1cdae05d78465e10063aa6596fbbd1c _GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec _variant_commit=550ac2f159ca883d360c196149b466955c77a573 -_crl_commit=9bc641f2d4ab140a84aea64c7f2d4669f7633246 +_crl_commit=527ad273b683d52c5adf5b45b73c6466aa0d0cf0 _Catch_commit=5ca44b68721833ae3731802ed99af67c6f38a53a build_style=cmake create_wrksrc=yes @@ -29,13 +29,25 @@ 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="2cdf89859be93196def45145fabbbbeff6c54743f84fe2a1809d66644aac243c - 1a7c7b7b3757a6eaec6ab283a0203426690775b2564b2ab5f5a26ab0518fe579 +checksum="40a3f1e8f8c94f827aa413e26a813e6918532ce81aff5a4af98d155a7116f9a3 + d0c870a784ef05d14909b8da30ac444917a8ba2d8dd290c0e5175bc9f879aac4 be81db4ab1b57102a0fa1cd0c4a6469294eb9daf24294347592245b754f65ff6 aa794dfefe0a90501587e36d977b958d0df888503117a8d9aa43dc14f8526d9d - d827499de19cd6a8ff922a88a700663f41eb49c3ac98a975bab55307cb662b95 + d7e64fc8a2e284a5be8c0b0c6e7bfbaf951751081919829cb3bb290544c732e8 d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18" +build_options=clang +build_options_default=clang + +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";; @@ -51,10 +63,6 @@ case "$XBPS_TARGET_MACHINE" in configure_args+=" -DUSE_LIBATOMIC=ON" ;; esac -case $XBPS_TARGET_MACHINE in - aarch64*|x86_64*) configure_args+=" -DENABLE_64BIT=ON";; -esac - if [ "$CROSS_BUILD" ]; then hostmakedepends+=" qt5-devel" fi @@ -85,8 +93,6 @@ post_extract() { } pre_configure() { - [ -f ../lib/xdg/telegram-desktop.desktop ] || mv ../lib/xdg/telegram{,-}desktop.desktop - cd native CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake . make ${makejobs}