diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 769aab3..7f0e016 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -2,46 +2,70 @@ # Contributor: hexchain pkgname=telegram-desktop pkgver=4.5.3 -pkgrel=1 +_qtver=6.4.2 +pkgrel=2 pkgdesc='Official Telegram Desktop client' arch=('x86_64') url="https://desktop.telegram.org/" license=('GPL3') depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' 'ttf-opensans' - 'qt6-imageformats' 'qt6-svg' 'qt6-wayland' 'qt6-5compat' 'xxhash' 'glibmm-2.68' - 'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'jemalloc' 'abseil-cpp' 'libdispatch' - 'openssl-1.1' 'protobuf') + 'xxhash' 'glibmm-2.68' 'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'jemalloc' 'abseil-cpp' + 'libdispatch' 'openssl-1.1' 'protobuf' + 'xcb-util-keysyms' 'libxcomposite' 'libxkbcommon-x11' 'libxrender' 'xcb-util-cursor' 'xcb-util-wm' 'libinput') 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") -sha512sums=('58a9c5d096e236090347388e1ed480527f841045a80771079dc0c3e35e12ce8ac11753987e87bb57870d9bd8488fc6a4734114648ecec7823d8544744b06c6b1') +_pkgfn=qt-everywhere-src-$_qtver +source=("https://github.com/telegramdesktop/tdesktop/releases/download/v${pkgver}/tdesktop-${pkgver}-full.tar.gz" + https://download.qt.io/official_releases/qt/${_qtver%.*}/$_qtver/single/$_pkgfn.tar.xz + https://github.com/desktop-app/patches/archive/9aa30bc44248eb620a720459ef4c81ed0bb65065.tar.gz) +sha512sums=('58a9c5d096e236090347388e1ed480527f841045a80771079dc0c3e35e12ce8ac11753987e87bb57870d9bd8488fc6a4734114648ecec7823d8544744b06c6b1' + '1b41ad1bd3f4b0780e8cd32219a5f0b037dc2c500c491a9e4a5ad7f5844356a3553856eb8aef8d73528a26f9e2bf058318ac239f55962b3368a9539f6c5d1dbe' + '5c00d63bab64dda4f1ce85cbfe0a3ffba233dccf835ada3fb3e533cea9442731afdefd99505e95fdea8eed7cf63430e10c9b181c6049afc6c17dbc2dc63d73a5') prepare() { - cd tdesktop-$pkgver-full + cd $_pkgfn + for p in "$srcdir"/patches-*/qtbase_6_4_2/*.patch; do patch -Np1 -i "$p" -d qtbase; done + cd ../tdesktop-$pkgver-full + rm -rf Telegram/ThirdParty/libtgvoip/webrtc_dsp/absl } build() { - cd tdesktop-$pkgver-full + CXXFLAGS+=' -ffat-lto-objects' + # Telegram needs a specific and heavily patched version of Qt6 and so we + # can't use system dependencies. + QT_BUILD_SUBMODULES="qtdeclarative;qtwayland;qtimageformats;qtsvg;qt5compat;qtshadertools" \ + cmake -B build-qt6-base -S $_pkgfn -G Ninja \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ + -DCMAKE_MESSAGE_LOG_LEVEL=STATUS \ + -DCMAKE_SKIP_RPATH=ON \ + -DQT_FEATURE_openssl_linked=ON \ + -DQT_FEATURE_system_sqlite=ON \ + -DQT_FEATURE_system_xcb_xinput=ON + cmake --build build-qt6-base + DESTDIR=qt6-base cmake --install build-qt6-base - #Turns out we're allowed to use the official API key that telegram uses for their snap builds: + # 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! + export CMAKE_PREFIX_PATH="$srcdir"/qt6-base/usr cmake \ - -B build \ - -G Ninja \ + -B build -S tdesktop-$pkgver-full -G Ninja\ + -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_BUILD_TYPE=Release \ -DTDESKTOP_API_ID=611335 \ -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c - ninja -C build + cmake --build build } package() { - cd tdesktop-$pkgver-full - DESTDIR="$pkgdir" ninja -C build install + DESTDIR="$pkgdir" cmake --install build # They botched the release and put a lot of stuff here. - rm -rf "$pkgdir/build" + # rm -rf "$pkgdir/build" }