# Maintainer: Sven-Hendrik Haase # Contributor: hexchain pkgname=telegram-desktop-git pkgver=2.5.4.r1.gadc8d6a6d pkgrel=1 pkgdesc='Official Telegram Desktop client' arch=('x86_64') url="https://desktop.telegram.org/" license=('GPL3') depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' 'qt5-imageformats' 'xxhash' 'libdbusmenu-qt5' 'kwayland' 'gtk3') makedepends=('cmake' 'git' 'ninja' 'python' 'range-v3' 'tl-expected' 'microsoft-gsl' 'libtg_owt-git') optdepends=('ttf-opensans: default Open Sans font family') provides=("telegram-desktop") conflicts=("telegram-desktop") source=("tdesktop::git+https://github.com/telegramdesktop/tdesktop.git#tag=dev" "telegram-desktop-libtgvoip::git+https://github.com/telegramdesktop/libtgvoip" "telegram-desktop-GSL::git+https://github.com/Microsoft/GSL.git" "telegram-desktop-Catch::git+https://github.com/philsquared/Catch" "telegram-desktop-xxHash::git+https://github.com/Cyan4973/xxHash.git" "telegram-desktop-rlottie::git+https://github.com/desktop-app/rlottie.git" "telegram-desktop-lz4::git+https://github.com/lz4/lz4.git" "telegram-desktop-lib_crl::git+https://github.com/desktop-app/lib_crl.git" "telegram-desktop-lib_rpl::git+https://github.com/desktop-app/lib_rpl.git" "telegram-desktop-lib_base::git+https://github.com/desktop-app/lib_base.git" "telegram-desktop-codegen::git+https://github.com/desktop-app/codegen.git" "telegram-desktop-lib_ui::git+https://github.com/desktop-app/lib_ui.git" "telegram-desktop-lib_rlottie::git+https://github.com/desktop-app/lib_rlottie.git" "telegram-desktop-lib_lottie::git+https://github.com/desktop-app/lib_lottie.git" "telegram-desktop-lib_tl::git+https://github.com/desktop-app/lib_tl.git" "telegram-desktop-lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck" "telegram-desktop-lib_storage::git+https://github.com/desktop-app/lib_storage.git" "telegram-desktop-cmake_helpers::git+https://github.com/desktop-app/cmake_helpers.git" "telegram-desktop-expected::git+https://github.com/TartanLlama/expected" "telegram-desktop-QR-Code-generator::git+https://github.com/nayuki/QR-Code-generator" "telegram-desktop-lib_qr::git+https://github.com/desktop-app/lib_qr.git" "telegram-desktop-libdbusmenu-qt::git+https://github.com/desktop-app/libdbusmenu-qt.git" "telegram-desktop-hunspell::git+https://github.com/hunspell/hunspell" "telegram-desktop-materialdecoration::git+https://github.com/desktop-app/materialdecoration.git" "telegram-desktop-range-v3::git+https://github.com/ericniebler/range-v3.git" "telegram-desktop-fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git" "telegram-desktop-nimf::git+https://github.com/hamonikr/nimf.git" "telegram-desktop-hime::git+https://github.com/hime-ime/hime.git" "telegram-desktop-qt5ct::git+https://github.com/desktop-app/qt5ct.git" "telegram-desktop-fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git" "telegram-desktop-lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git" "telegram-desktop-tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git" ) sha512sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP') pkgver() { cd "$srcdir/tdesktop" git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { cd "$srcdir/tdesktop" git submodule init git config submodule.Telegram/ThirdParty/libtgvoip.url "$srcdir/telegram-desktop-libtgvoip" git config submodule.Telegram/ThirdParty/GSL.url "$srcdir/telegram-desktop-GSL" git config submodule.Telegram/ThirdParty/Catch.url "$srcdir/telegram-desktop-Catch" git config submodule.Telegram/ThirdParty/xxHash.url "$srcdir/telegram-desktop-xxHash" git config submodule.Telegram/ThirdParty/rlottie.url "$srcdir/telegram-desktop-rlottie" git config submodule.Telegram/ThirdParty/lz4.url "$srcdir/telegram-desktop-lz4" git config submodule.Telegram/lib_crl.url "$srcdir/telegram-desktop-lib_crl" git config submodule.Telegram/lib_rpl.url "$srcdir/telegram-desktop-lib_rpl" git config submodule.Telegram/lib_base.url "$srcdir/telegram-desktop-lib_base" git config submodule.Telegram/codegen.url "$srcdir/telegram-desktop-codegen" git config submodule.Telegram/lib_ui.url "$srcdir/telegram-desktop-lib_ui" git config submodule.Telegram/lib_rlottie.url "$srcdir/telegram-desktop-lib_rlottie" git config submodule.Telegram/lib_lottie.url "$srcdir/telegram-desktop-lib_lottie" git config submodule.Telegram/lib_tl.url "$srcdir/telegram-desktop-lib_tl" git config submodule.Telegram/lib_spellcheck.url "$srcdir/telegram-desktop-lib_spellcheck" git config submodule.Telegram/lib_storage.url "$srcdir/telegram-desktop-lib_storage" git config submodule.cmake.url "$srcdir/telegram-desktop-cmake_helpers" git config submodule.Telegram/ThirdParty/expected.url "$srcdir/telegram-desktop-expected" git config submodule.Telegram/ThirdParty/QR.url "$srcdir/telegram-desktop-QR-Code-generator" git config submodule.Telegram/lib_qr.url "$srcdir/telegram-desktop-lib_qr" git config submodule.Telegram/ThirdParty/libdbusmenu-qt.url "$srcdir/telegram-desktop-libdbusmenu-qt" git config sumbodule.Telegram/ThirdParty/hunspell.url "$srcdir/telegram-desktop-hunspell" git config sumbodule.Telegram/ThirdParty/materialdecoration.url "$srcdir/telegram-desktop-materialdecoration" git config sumbodule.Telegram/ThirdParty/range-v3.url "$srcdir/telegram-desktop-range-v3" git config sumbodule.Telegram/ThirdParty/fcitx-qt5.url "$srcdir/telegram-desktop-fcitx-qt5" git config sumbodule.Telegram/ThirdParty/nimf.url "$srcdir/telegram-desktop-nimf" git config sumbodule.Telegram/ThirdParty/hime.url "$srcdir/telegram-desktop-hime" git config sumbodule.Telegram/ThirdParty/qt5ct.url "$srcdir/telegram-desktop-qt5ct" git config sumbodule.Telegram/ThirdParty/fcitx5-qt.url "$srcdir/telegram-desktop-fcitx5-qt" git config sumbodule.Telegram/lib_webrtc.url "$srcdir/telegram-desktop-lib_webrtc" git config sumbodule.Telegram/ThirdParty/tgcalls.url "$srcdir/telegram-desktop-tgcalls" git submodule update cd cmake # force webrtc link to libjpeg echo "target_link_libraries(external_webrtc INTERFACE jpeg)" | tee -a external/webrtc/CMakeLists.txt } build() { cd "$srcdir/tdesktop" # 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 \ -DTDESKTOP_LAUNCHER_BASENAME="telegramdesktop" \ -DDESKTOP_APP_SPECIAL_TARGET="" ninja -C build } package() { cd "$srcdir/tdesktop" DESTDIR=$pkgdir ninja -C build install }