From 308fbf38e7e222b708365eacf4e8cb907512f8c5 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 6 Oct 2019 15:45:12 +1000 Subject: [PATCH] Telegram: disable ASLR and set heap limit for build --- .../telegram_desktop-1.8.13-sonnet.patchset | 14 ++-- .../patches/telegram_desktop-1.8.13.patchset | 78 ++++++------------- .../telegram_desktop-1.8.13.recipe | 6 +- 3 files changed, 36 insertions(+), 62 deletions(-) diff --git a/net-im/telegram-desktop/patches/telegram_desktop-1.8.13-sonnet.patchset b/net-im/telegram-desktop/patches/telegram_desktop-1.8.13-sonnet.patchset index 18c1dd39d..0ebb54b65 100644 --- a/net-im/telegram-desktop/patches/telegram_desktop-1.8.13-sonnet.patchset +++ b/net-im/telegram-desktop/patches/telegram_desktop-1.8.13-sonnet.patchset @@ -1,6 +1,6 @@ -From df98777e9f9c0dabedcd773bd48aca2067f7b76f Mon Sep 17 00:00:00 2001 +From 7e56df8f6daa4f1960535050c130b86ee8d0026f Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Sat, 5 Oct 2019 18:16:54 +1000 +Date: Sun, 6 Oct 2019 15:25:59 +1000 Subject: Add Sonnet spell checking @@ -54,7 +54,7 @@ index ae480a0..fe65db1 100644 class MaskedInputField : public RpWidgetWrap { diff --git a/Telegram/gyp/common/haiku.gypi b/Telegram/gyp/common/haiku.gypi -index a1fe2c9..b6c57c3 100644 +index 0c55076..b077e62 100644 --- a/Telegram/gyp/common/haiku.gypi +++ b/Telegram/gyp/common/haiku.gypi @@ -35,7 +35,16 @@ @@ -71,11 +71,11 @@ index a1fe2c9..b6c57c3 100644 + '<(haiku_path_include)/KF5/SonnetUi/Sonnet', + '<(haiku_path_include)/KF5/SonnetUi/sonnet', + ], - 'conditions': [ - [ '" -Date: Sat, 5 Oct 2019 18:11:55 +1000 +Date: Sun, 6 Oct 2019 15:18:21 +1000 Subject: Add Haiku support @@ -44,22 +44,6 @@ index 3bcb595..b97d66a 100644 #define OS_POSIX 1 #endif // OS_MAC || OS_LINUX -diff --git a/Telegram/SourceFiles/base/flat_set_tests.cpp b/Telegram/SourceFiles/base/flat_set_tests.cpp -index a73f1d2..77d98a6 100644 ---- a/Telegram/SourceFiles/base/flat_set_tests.cpp -+++ b/Telegram/SourceFiles/base/flat_set_tests.cpp -@@ -5,7 +5,11 @@ the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ -+#if !defined(Q_OS_HAIKU) - #include "catch.hpp" -+#else -+#include "../ThirdParty/variant/test/include/catch.hpp" -+#endif - - #include "base/flat_set.h" - diff --git a/Telegram/SourceFiles/core/crash_reports.cpp b/Telegram/SourceFiles/core/crash_reports.cpp index ce938a3..02066c7 100644 --- a/Telegram/SourceFiles/core/crash_reports.cpp @@ -2379,10 +2363,10 @@ index 6531a7a..242f869 100644 'libs_loc%': '<(libs_loc)', diff --git a/Telegram/gyp/common/haiku.gypi b/Telegram/gyp/common/haiku.gypi new file mode 100644 -index 0000000..a1fe2c9 +index 0000000..0c55076 --- /dev/null +++ b/Telegram/gyp/common/haiku.gypi -@@ -0,0 +1,87 @@ +@@ -0,0 +1,67 @@ +# This file is part of Telegram Desktop, +# the official desktop version of Telegram messaging app, see https://telegram.org +# @@ -2400,7 +2384,7 @@ index 0000000..a1fe2c9 +# to link the code of portions of this program with the OpenSSL library. +# +# Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -+# Copyright (c) 2014 John Preston, https://desktop.telegram.org ++# Copyright (c) 2018-2019 Gerasim Troeglazov, 3dEyes@gmail.com + +{ + 'conditions': [ @@ -2421,46 +2405,26 @@ index 0000000..a1fe2c9 + '-Wno-sign-compare', + ], + }, -+ 'conditions': [ -+ [ '" /dev/null --libs <@(pkgconfig_libs))', + ], ++ 'cflags_cc': [ ++ '-Wno-strict-overflow', ++ '-Wno-maybe-uninitialized', ++ ], + 'configurations': { + 'Release': { + 'cflags': [ + '-Ofast', + '-fno-strict-aliasing', ++ '--param ggc-min-expand=10', ++ '--param ggc-min-heapsize=8192', + ], + 'cflags_cc': [ + '-Ofast', + '-fno-strict-aliasing', ++ '--param ggc-min-expand=10', ++ '--param ggc-min-heapsize=8192', + ], + 'ldflags': [ + '-Ofast', diff --git a/net-im/telegram-desktop/telegram_desktop-1.8.13.recipe b/net-im/telegram-desktop/telegram_desktop-1.8.13.recipe index aebc197b7..f77616522 100644 --- a/net-im/telegram-desktop/telegram_desktop-1.8.13.recipe +++ b/net-im/telegram-desktop/telegram_desktop-1.8.13.recipe @@ -3,7 +3,7 @@ DESCRIPTION="Unofficial build of the original Telegram client for Haiku." HOMEPAGE="https://www.telegram.org/" COPYRIGHT="2013-2019 Telegram" LICENSE="GNU GPL v3" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz" CHECKSUM_SHA256="3d5642d609415cbfe4ba72276947ec63b2ebeb6de2fdd0aa942e8a0f089f0f57" SOURCE_FILENAME="tdesktop-$portVersion.tar.gz" @@ -44,7 +44,8 @@ srcGitRev_10="9a2a9f2d0f38a39c5ec9b329042ca5f060b058e0" SOURCE_URI_10="https://github.com/lz4/lz4/archive/$srcGitRev_10.tar.gz" CHECKSUM_SHA256_10="fb17b28934ea7f85bd381dd183d765973f7e90a7e2ebc2415af61fe6848741cc" SOURCE_FILENAME_10="lz4-$srcGitRev_10.tar.gz" -SOURCE_URI_11="https://salsa.debian.org/debian/telegram-desktop/raw/debian/master/debian/rules#noarchive" +srcGitRev_11="0663103551379b958b2e79c51d51d163ec484300" +SOURCE_URI_11="https://salsa.debian.org/debian/telegram-desktop/raw/$srcGitRev_11/debian/rules#noarchive" CHECKSUM_SHA256_11="2b24fb808acee36b5a15824c4ff8bd8b8e83a326a9e4593d2b21922425c5ffb3" PATCHES=" @@ -165,6 +166,7 @@ BUILD() Telegram/gyp/refresh.sh --api-id $TELEGRAM_API_ID --api-hash $TELEGRAM_API_HASH cd out/Release # multi-job takes too much memory + export DISABLE_ASLR=1 make #build notify gate tool