diff options
author | Peter Jung | 2024-04-03 20:07:37 +0200 |
---|---|---|
committer | Peter Jung | 2024-04-03 20:07:37 +0200 |
commit | 27702f210ab9ca27c1830cf74c6c2509f66d2fb1 (patch) | |
tree | 279dc8c1958cee56e7693a37e50e8502b008c576 | |
parent | c61fc5ad9b569653fe8e594bb764e3abf3ffc35f (diff) | |
download | aur-27702f210ab9ca27c1830cf74c6c2509f66d2fb1.tar.gz |
forkgram: Update, rebase PKGBUILD on 64gram-desktop
Signed-off-by: Peter Jung <admin@ptr1337.dev>
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | block-sponsored_messages.patch | 13 | ||||
-rw-r--r-- | fix-lzma-link.patch | 58 |
3 files changed, 100 insertions, 24 deletions
@@ -4,47 +4,52 @@ pkgname=forkgram _pkgname=frk -pkgver=4.15.6 +pkgver=4.16 pkgrel=1 pkgdesc='Fork of Telegram Desktop messaging app.' arch=('x86_64' 'x86_64_v3') url="https://github.com/Forkgram/tdesktop" license=('GPL3') -depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' 'ttf-opensans' - 'qt6-imageformats' 'qt6-svg' 'qt6-wayland' 'xxhash' - 'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'jemalloc' 'abseil-cpp' 'libdispatch' - 'openssl' 'protobuf' 'glib2' 'libsigc++-3.0' 'glibmm-2.68' 'libvpx.so') +depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' + 'qt6-imageformats' 'qt6-svg' 'qt6-wayland' 'xxhash' + 'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'abseil-cpp' 'libdispatch' + 'openssl' 'protobuf' 'glib2' 'libsigc++-3.0' + 'libxcomposite' 'libvpx' 'libxdamage' 'kcoreaddons') makedepends=('cmake' 'git' 'ninja' 'python' 'range-v3' 'tl-expected' 'microsoft-gsl' 'meson' - 'extra-cmake-modules' 'wayland-protocols' 'plasma-wayland-protocols' 'libtg_owt' - 'gobject-introspection' 'boost' 'fmt' 'mm-common' 'perl-xml-parser' 'libsigc++-3.0' 'libxcomposite') + 'extra-cmake-modules' 'wayland-protocols' 'plasma-wayland-protocols' 'libtg_owt' + 'gobject-introspection' 'boost' 'fmt' 'mm-common' 'perl-xml-parser' 'python-packaging' 'dos2unix') optdepends=('webkit2gtk: embedded browser features' - 'xdg-desktop-portal: desktop integration') + 'xdg-desktop-portal: desktop integration') provides=(forkgram-bin) conflicts=(forkgram-bin telegram-desktop) options=(!debug) source=("https://github.com/Forkgram/tdesktop/releases/download/v${pkgver}/${_pkgname}-v${pkgver}-full.tar.gz" - "${pkgname}.desktop") + "${pkgname}.desktop" + "block-sponsored_messages.patch" + "fix-lzma-link.patch") sha512sums=('d7ba3192283c812e79bc9a1845bc685a22d86c82bc4fe11cc534c2415b8020ff28cd0a752852e51440bd460620bbffeb12ceffcefc2b07e53a707c5eaf1ec069' - 'd6d54a5a396c0a84645ca5f38cd2d0c774d1a00f081cdf6151228b581ff1c05234550d4829aab4fe2221dec8e0477199da5a0cb1bc3a60fa1fbfe0336db365dd') + 'd6d54a5a396c0a84645ca5f38cd2d0c774d1a00f081cdf6151228b581ff1c05234550d4829aab4fe2221dec8e0477199da5a0cb1bc3a60fa1fbfe0336db365dd') prepare() { - cd ${_pkgname}-v${pkgver}-full - rm -rf Telegram/ThirdParty/libtgvoip/webrtc_dsp/absl + cd ${_pkgname}-v${pkgver}-full + patch -Np1 --binary -i ../block-sponsored_messages.patch + patch -p1 --binary < ../fix-lzma-link.patch + find "${srcdir}"/ -type f -exec dos2unix {} \; } build() { - CXXFLAGS+=' -ffat-lto-objects' - # Turns out we're allowed to use the official API key that telegram uses for their snap builds: - # https://github.com/telegramdesktop/tdesktop/blob/8fab9167beb2407c1153930ed03a4badd0c2b59f/snap/snapcraft.yaml#L87-L88 - # Thanks @primeos! - cmake -B build $_pkgname-v$pkgver-full -G Ninja \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_INSTALL_PREFIX="/usr" \ - -DCMAKE_BUILD_TYPE=Release \ - -DDESKTOP_APP_DISABLE_AUTOUPDATE=ON \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DTDESKTOP_API_TEST=ON - cmake --build build + CXXFLAGS+=' -ffat-lto-objects' + + cmake \ + -B build \ + -S $_pkgname-$pkgver-full \ + -G Ninja \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_INSTALL_PREFIX="/usr" \ + -DCMAKE_BUILD_TYPE=Release \ + -DDESKTOP_APP_DISABLE_AUTOUPDATE=ON \ + -DTDESKTOP_API_TEST=ON + cmake --build build } package() { diff --git a/block-sponsored_messages.patch b/block-sponsored_messages.patch new file mode 100644 index 000000000000..8452a9a0cccd --- /dev/null +++ b/block-sponsored_messages.patch @@ -0,0 +1,13 @@ +diff --git a/Telegram/SourceFiles/data/data_sponsored_messages.cpp b/Telegram/SourceFiles/data/data_sponsored_messages.cpp
+index c90dd3c53..f8e0a096d 100644
+--- a/Telegram/SourceFiles/data/data_sponsored_messages.cpp
++++ b/Telegram/SourceFiles/data/data_sponsored_messages.cpp
+@@ -82,7 +82,7 @@ bool SponsoredMessages::append(not_null<History*> history) {
+ }
+
+ bool SponsoredMessages::canHaveFor(not_null<History*> history) const {
+- return history->peer->isChannel();
++ return false;
+ }
+
+ void SponsoredMessages::request(not_null<History*> history) {
diff --git a/fix-lzma-link.patch b/fix-lzma-link.patch new file mode 100644 index 000000000000..0910685cb26b --- /dev/null +++ b/fix-lzma-link.patch @@ -0,0 +1,58 @@ +c573b65a Fix linking with LZMA when auto update is disabled
+diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
+index 24c5909e..cb3ba61c 100644
+--- a/Telegram/CMakeLists.txt
++++ b/Telegram/CMakeLists.txt
+@@ -85,6 +85,7 @@ PRIVATE
+ desktop-app::external_qr_code_generator
+ desktop-app::external_crash_reports
+ desktop-app::external_auto_updates
++ desktop-app::external_lzma
+ desktop-app::external_openssl
+ desktop-app::external_openal
+ desktop-app::external_xxhash
+@@ -1710,6 +1711,7 @@ if ((NOT DESKTOP_APP_DISABLE_AUTOUPDATE OR APPLE) AND NOT build_macstore AND NOT
+ desktop-app::external_qt
+ desktop-app::external_zlib
+ desktop-app::external_auto_updates
++ desktop-app::external_lzma
+ desktop-app::external_openssl
+ )
+
+diff --git a/cmake/external/CMakeLists.txt b/cmake/external/CMakeLists.txt
+index 9be0e5a2..ed0b9aed 100644
+--- a/cmake/external/CMakeLists.txt
++++ b/cmake/external/CMakeLists.txt
+@@ -47,6 +47,7 @@ add_checked_subdirectory(jpeg)
+ add_checked_subdirectory(kcoreaddons)
+ add_checked_subdirectory(kimageformats)
+ add_checked_subdirectory(lz4)
++add_checked_subdirectory(lzma)
+ add_checked_subdirectory(minizip)
+ if (LINUX)
+ add_checked_subdirectory(nimf_qt5)
+diff --git a/cmake/external/lzma/CMakeLists.txt b/cmake/external/lzma/CMakeLists.txt
+new file mode 100644
+index 00000000..8e75394d
+--- /dev/null
++++ b/cmake/external/lzma/CMakeLists.txt
+@@ -0,0 +1,19 @@
++# This file is inspired by Desktop App Toolkit,
++# a set of libraries for developing nice desktop applications.
++#
++# For license and copyright information please follow this link:
++# https://github.com/desktop-app/legal/blob/master/LEGAL
++
++if (DESKTOP_APP_USE_PACKAGED)
++ if (DESKTOP_APP_DISABLE_AUTOUPDATE)
++ add_library(external_lzma INTERFACE IMPORTED GLOBAL)
++ add_library(desktop-app::external_lzma ALIAS external_lzma)
++ find_package(PkgConfig REQUIRED)
++ pkg_check_modules(LZMA REQUIRED IMPORTED_TARGET liblzma)
++ target_link_libraries(external_lzma INTERFACE PkgConfig::LZMA)
++ return()
++ else()
++ # See auto_update directory contents
++ endif()
++ message(FATAL_ERROR "DEKSTOP_APP_USE_PACKAGED expected to be TRUE")
++endif()
|