summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgao_cai_sheng2022-03-12 21:31:05 +0800
committergao_cai_sheng2022-03-12 21:31:05 +0800
commit8ebe549b95c5fe4c80e3ed64a1ed3b601a35d4fc (patch)
tree2f8c9664c5ffd885991cd46723c148bdb331bc7e
parent9221b90b4d0358bd73e1b9867c517ae133697a09 (diff)
downloadaur-8ebe549b95c5fe4c80e3ed64a1ed3b601a35d4fc.tar.gz
misc: replace git am with patch
Signed-off-by: gao_cai_sheng <qwq233@qwq2333.top>
-rw-r--r--PKGBUILD21
-rw-r--r--fix-ffmpeg-build-for-tgcalls.patch129
-rw-r--r--remove-ad.patch93
3 files changed, 108 insertions, 135 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 8c5e2d9ba484..8a806988f33e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ pkgver=1.0.23
pkgrel=1
pkgdesc='Unofficial desktop version of Telegram messaging app (removed ad)'
arch=('x86_64')
-url="https://github.com/TDesktop-x64/tdesktop"
+url="https://github.com/qwq233/64gram-aur"
license=('GPL3')
depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal'
'qt5-imageformats' 'qt5-svg' 'xxhash' 'libdbusmenu-qt5' 'kwayland' 'glibmm'
@@ -20,13 +20,13 @@ provides=("64gram-desktop-no-ad")
conflicts=("telegram-desktop" "tdesktop-x64" "64gram-desktop")
replaces=("tdesktop-x64")
source=(
+ "https://github.com/TDesktop-x64/tdesktop/releases/download/v$pkgver/64Gram-$pkgver-full.tar.gz"
"fix-ffmpeg-build-for-tgcalls.patch"
"remove-ad.patch"
)
-sha512sums=(
- "6866bf7169210e7ce3fe91a9aab5940a56ab213a43283b50188368e03981881bae66e5aff1e28dba756325f8dcde58b3a69809fd09e5e2d68b882d13da2e309e"
- "23ef22dd165804b91b0eb357b98145c6fd29c8b82e9c93d0c0daf8f9ef6966bc44150a70e51bd9b978bd6e86f1cb6cd594a06215b6c3e83a74fecc4dd8250358"
- )
+sha512sums=('db552183d4c64ed9d1ee2911723cd49d80bc1b4cb8212497a6dc0e2595ae935a6b8375dd7cc2def45415d0f62196a5fd1b92375bfacc7e7cddee42f763532e67'
+ '5f87b047179b570846440dc0315c156438e6bdd1e95326a6e239e1e9f0d110af368f283c0c242438e06f8da7d0494cb5b46db61b0ae65c1a9d9242de27caf34c'
+ 'de0662d33062a8c169003095f73ce69f352c21873620841fd53c075ec18990d643fe0a88536aa3f5b9cca2d52a69c01d3e2ce0b279549f0c0ceb0a907e7e3ff7')
prepare() {
echo -e "Please enter the API ID and API HASH\nYou can get one from https://my.telegram.org/apps"
@@ -35,11 +35,10 @@ prepare() {
echo -n -e "API HASH: "
read _API_HASH
- git clone https://github.com/TDesktop-x64/tdesktop tdesktop-$pkgver -b v$pkgver --recurse-submodules
- cd tdesktop-$pkgver
- git am ../remove-ad.patch
+ cd $_pkgname-$pkgver-full
+ patch -p1 < ../remove-ad.patch
cd Telegram/ThirdParty/tgcalls
- git am ../../../../fix-ffmpeg-build-for-tgcalls.patch
+ patch -p1 < ../../../../fix-ffmpeg-build-for-tgcalls.patch
cd ../../../
cmake . \
@@ -55,11 +54,11 @@ prepare() {
}
build() {
- cd tdesktop-$pkgver
+ cd $_pkgname-$pkgver-full
ninja -C build
}
package() {
- cd tdesktop-$pkgver
+ cd $_pkgname-$pkgver-full
DESTDIR=$pkgdir ninja -C build install
}
diff --git a/fix-ffmpeg-build-for-tgcalls.patch b/fix-ffmpeg-build-for-tgcalls.patch
index c8c9ee5e3a15..866a56b67a2b 100644
--- a/fix-ffmpeg-build-for-tgcalls.patch
+++ b/fix-ffmpeg-build-for-tgcalls.patch
@@ -1,72 +1,57 @@
-From da288b3cf4f91937da5bb8de0570dfa64871f4d9 Mon Sep 17 00:00:00 2001
-From: Nicholas Guriev <nicholas@guriev.su>
-Date: Mon, 7 Mar 2022 11:52:01 +0300
-Subject: [PATCH] Fix build against FFmpeg v5.0
-
-It has been released on January 17th. This patch keeps source compatibility
-with older versions.
----
- tgcalls/group/AudioStreamingPartInternal.cpp | 5 ++++-
- tgcalls/group/AudioStreamingPartPersistentDecoder.cpp | 2 +-
- tgcalls/group/VideoStreamingPart.cpp | 5 ++++-
- 3 files changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/tgcalls/group/AudioStreamingPartInternal.cpp b/tgcalls/group/AudioStreamingPartInternal.cpp
-index 27a71cb..5639036 100644
---- a/tgcalls/group/AudioStreamingPartInternal.cpp
-+++ b/tgcalls/group/AudioStreamingPartInternal.cpp
-@@ -104,6 +104,9 @@ _avIoContext(std::move(fileData)) {
-
- _frame = av_frame_alloc();
-
-+#if LIBAVFORMAT_VERSION_MAJOR >= 59
-+ const
-+#endif
- AVInputFormat *inputFormat = av_find_input_format(container.c_str());
- if (!inputFormat) {
- _didReadToEnd = true;
-@@ -144,7 +147,7 @@ _avIoContext(std::move(fileData)) {
-
- _streamId = i;
-
-- _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000);
-+ _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000);
-
- if (inStream->metadata) {
- AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
-diff --git a/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp b/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
-index e79d430..63ef475 100644
---- a/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
-+++ b/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
-@@ -32,7 +32,7 @@ class AudioStreamingPartPersistentDecoderState {
- AudioStreamingPartPersistentDecoderState(AVCodecParameters const *codecParameters, AVRational timeBase) :
- _codecParameters(codecParameters),
- _timeBase(timeBase) {
-- AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
-+ const AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
- if (codec) {
- _codecContext = avcodec_alloc_context3(codec);
- int ret = avcodec_parameters_to_context(_codecContext, codecParameters);
-diff --git a/tgcalls/group/VideoStreamingPart.cpp b/tgcalls/group/VideoStreamingPart.cpp
-index a67514a..10457eb 100644
---- a/tgcalls/group/VideoStreamingPart.cpp
-+++ b/tgcalls/group/VideoStreamingPart.cpp
-@@ -280,6 +280,9 @@ class VideoStreamingPartInternal {
-
- int ret = 0;
-
-+#if LIBAVFORMAT_VERSION_MAJOR >= 59
-+ const
-+#endif
- AVInputFormat *inputFormat = av_find_input_format(container.c_str());
- if (!inputFormat) {
- _didReadToEnd = true;
-@@ -323,7 +326,7 @@ class VideoStreamingPartInternal {
- }
-
- if (videoCodecParameters && videoStream) {
-- AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
-+ const AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
- if (codec) {
- _codecContext = avcodec_alloc_context3(codec);
- ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters);
+diff --color --unified --recursive --text --color tgcalls-orig/tgcalls/group/AudioStreamingPartInternal.cpp tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp
+--- tgcalls-orig/tgcalls/group/AudioStreamingPartInternal.cpp 2022-03-12 21:25:28.361577625 +0800
++++ tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp 2022-03-12 21:27:38.658250834 +0800
+@@ -103,7 +103,9 @@
+ int ret = 0;
+
+ _frame = av_frame_alloc();
+-
++#if LIBAVFORMAT_VERSION_MAJOR >= 59
++ const
++#endif
+ AVInputFormat *inputFormat = av_find_input_format(container.c_str());
+ if (!inputFormat) {
+ _didReadToEnd = true;
+@@ -144,7 +146,7 @@
+
+ _streamId = i;
+
+- _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000);
++ _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000);
+
+ if (inStream->metadata) {
+ AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
+diff --color --unified --recursive --text --color tgcalls-orig/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
+--- tgcalls-orig/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp 2022-03-12 21:25:28.361577625 +0800
++++ tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp 2022-03-12 21:26:59.081582180 +0800
+@@ -32,7 +32,7 @@
+ AudioStreamingPartPersistentDecoderState(AVCodecParameters const *codecParameters, AVRational timeBase) :
+ _codecParameters(codecParameters),
+ _timeBase(timeBase) {
+- AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
++ const AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
+ if (codec) {
+ _codecContext = avcodec_alloc_context3(codec);
+ int ret = avcodec_parameters_to_context(_codecContext, codecParameters);
+diff --color --unified --recursive --text --color tgcalls-orig/tgcalls/group/VideoStreamingPart.cpp tgcalls/tgcalls/group/VideoStreamingPart.cpp
+--- tgcalls-orig/tgcalls/group/VideoStreamingPart.cpp 2022-03-12 21:25:28.361577625 +0800
++++ tgcalls/tgcalls/group/VideoStreamingPart.cpp 2022-03-12 21:26:34.978247636 +0800
+@@ -280,6 +280,9 @@
+
+ int ret = 0;
+
++#if LIBAVFORMAT_VERSION_MAJOR >= 59
++ const
++#endif
+ AVInputFormat *inputFormat = av_find_input_format(container.c_str());
+ if (!inputFormat) {
+ _didReadToEnd = true;
+@@ -323,7 +326,7 @@
+ }
+
+ if (videoCodecParameters && videoStream) {
+- AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
++ const AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
+ if (codec) {
+ _codecContext = avcodec_alloc_context3(codec);
+ ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters);
diff --git a/remove-ad.patch b/remove-ad.patch
index 38909f5716db..78ab5dd5b4de 100644
--- a/remove-ad.patch
+++ b/remove-ad.patch
@@ -1,52 +1,41 @@
-From 57dba085993b54ba162671f6cdaae6a795f2d9a2 Mon Sep 17 00:00:00 2001
-From: gao_cai_sheng <qwq233@qwq2333.top>
-Date: Thu, 10 Mar 2022 21:03:47 +0800
-Subject: [PATCH] remove ad
-
-Signed-off-by: gao_cai_sheng <qwq233@qwq2333.top>
----
- .../data/data_sponsored_messages.cpp | 31 +------------------
- 1 file changed, 1 insertion(+), 30 deletions(-)
-
-diff --git a/Telegram/SourceFiles/data/data_sponsored_messages.cpp b/Telegram/SourceFiles/data/data_sponsored_messages.cpp
-index c90dd3c53..42971a417 100644
---- a/Telegram/SourceFiles/data/data_sponsored_messages.cpp
-+++ b/Telegram/SourceFiles/data/data_sponsored_messages.cpp
-@@ -86,36 +86,7 @@ bool SponsoredMessages::canHaveFor(not_null<History*> history) const {
- }
-
- void SponsoredMessages::request(not_null<History*> history) {
-- if (!canHaveFor(history) || history->peer->isMegagroup()) {
-- return;
-- }
-- auto &request = _requests[history];
-- if (request.requestId || TooEarlyForRequest(request.lastReceived)) {
-- return;
-- }
-- {
-- const auto it = _data.find(history);
-- if (it != end(_data)) {
-- auto &list = it->second;
-- // Don't rebuild currently displayed messages.
-- const auto proj = [](const Entry &e) {
-- return e.item != nullptr;
-- };
-- if (ranges::any_of(list.entries, proj)) {
-- return;
-- }
-- }
-- }
-- const auto channel = history->peer->asChannel();
-- Assert(channel != nullptr);
-- request.requestId = _session->api().request(
-- MTPchannels_GetSponsoredMessages(
-- channel->inputChannel)
-- ).done([=](const MTPmessages_sponsoredMessages &result) {
-- parse(history, result);
-- }).fail([=] {
-- _requests.remove(history);
-- }).send();
-+ return;
- }
-
- void SponsoredMessages::parse(
+diff --color --unified --recursive --text 64Gram-1.0.23-full/Telegram/SourceFiles/data/data_sponsored_messages.cpp 64Gram-1.0.23-full-target/Telegram/SourceFiles/data/data_sponsored_messages.cpp
+--- 64Gram-1.0.23-full/Telegram/SourceFiles/data/data_sponsored_messages.cpp 2022-03-09 07:28:56.767215500 +0800
++++ 64Gram-1.0.23-full-target/Telegram/SourceFiles/data/data_sponsored_messages.cpp 2022-03-12 21:00:46.424836547 +0800
+@@ -86,36 +86,7 @@
+ }
+
+ void SponsoredMessages::request(not_null<History*> history) {
+- if (!canHaveFor(history) || history->peer->isMegagroup()) {
+- return;
+- }
+- auto &request = _requests[history];
+- if (request.requestId || TooEarlyForRequest(request.lastReceived)) {
+- return;
+- }
+- {
+- const auto it = _data.find(history);
+- if (it != end(_data)) {
+- auto &list = it->second;
+- // Don't rebuild currently displayed messages.
+- const auto proj = [](const Entry &e) {
+- return e.item != nullptr;
+- };
+- if (ranges::any_of(list.entries, proj)) {
+- return;
+- }
+- }
+- }
+- const auto channel = history->peer->asChannel();
+- Assert(channel != nullptr);
+- request.requestId = _session->api().request(
+- MTPchannels_GetSponsoredMessages(
+- channel->inputChannel)
+- ).done([=](const MTPmessages_sponsoredMessages &result) {
+- parse(history, result);
+- }).fail([=] {
+- _requests.remove(history);
+- }).send();
++ return;
+ }
+
+ void SponsoredMessages::parse(