# Maintainer: Sven-Hendrik Haase # Contributor: hexchain pkgname=telegram-desktop pkgver=4.0.2 pkgrel=2 pkgdesc='Official Telegram Desktop client' arch=('x86_64') url="https://desktop.telegram.org/" license=('GPL3') depends=('hunspell' 'ffmpeg4.4' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' 'ttf-opensans' 'qt6-imageformats' 'qt6-svg' 'qt6-wayland' 'qt6-5compat' 'xxhash' 'glibmm' 'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'jemalloc' 'abseil-cpp' 'libdispatch') makedepends=('cmake' 'git' 'ninja' 'python' 'range-v3' 'tl-expected' 'microsoft-gsl' 'meson' 'extra-cmake-modules' 'wayland-protocols' 'plasma-wayland-protocols' 'libtg_owt') optdepends=('webkit2gtk: embedded browser features' 'xdg-desktop-portal: desktop integration') source=("https://github.com/telegramdesktop/tdesktop/releases/download/v${pkgver}/tdesktop-${pkgver}-full.tar.gz" fix-tgcalls-cstdint.patch ) sha512sums=('0078b627d06dd8e655bd2bcc222ecbb3b15b7d88f858810bccdca84793ad02a60f4a4bf3808838752d65d4f6cffa3ddb5f70c5afc8e94cb6edae52101362feeb' 'ba24a2f1524010b4891764aacee2e27a5ebae44cf7626ab2aaf9e6c48b0f8088bf920886ceeb497b3c463fa0c3b885dd63db273d4c29cab6c96c8193c0c5c888') prepare() { cd tdesktop-$pkgver-full patch -Np1 -i "$srcdir"/fix-tgcalls-cstdint.patch -d Telegram/ThirdParty/tgcalls } build() { cd tdesktop-$pkgver-full export PKG_CONFIG_PATH='/usr/lib/ffmpeg4.4/pkgconfig' #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 \ -G Ninja \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_BUILD_TYPE=Release \ -DTDESKTOP_API_ID=611335 \ -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c ninja -C build } package() { cd tdesktop-$pkgver-full DESTDIR="$pkgdir" ninja -C build install # They botched the release and put a lot of stuff here. rm -rf "$pkgdir/build" }