blob: 5767cc717929620adef8f50a1b27586405ba1b29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
# Maintainer: Giovanni 'ItachiSan' Santini <giovannisantini93@yahoo.it>
# Contributor: silentnoodle <lonnqvistben at gmail dot com>
# Contributor: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: hexchain <i@hexchain.org>
# Thanks Nicholas Guriev <guriev-ns@ya.ru> for the initial patches!
# https://github.com/mymedia2/tdesktop
# Updated using:
# https://gitlab.archlinux.org/archlinux/packaging/packages/telegram-desktop/-/raw/main/PKGBUILD?ref_type=heads&inline=false
# Thanks to the Arch maintainers :)
# You can pass parameters to make / ninja via MAKEFLAGS.
# You can use TMPDIR in $srcdir by exporting TMPDIR_FIX with some value.
pkgname=telegram-desktop-dev
pkgver=6.4.1
pkgrel=1
pkgdesc='Official Telegram Desktop client - development release'
arch=('x86_64')
url="https://desktop.telegram.org/"
license=('GPL-3.0-or-later WITH OpenSSL-exception')
# Although not in order, keeping them in the same order of the standard package
# for my mental sanity.
# libtg_owt-git for now until the official repo is updated.
depends=(
'abseil-cpp'
'ada'
'ffmpeg'
'glib2'
'hicolor-icon-theme'
'hunspell'
'kcoreaddons'
'libavif'
'libdispatch'
'libheif'
'libjxl'
'libxcomposite'
'libxdamage'
'libxrandr'
'libxtst'
'lz4'
'minizip'
'openal'
'openh264'
'openssl'
'pipewire'
'protobuf'
'qt6-imageformats'
'qt6-svg'
'qt6-wayland'
'rnnoise'
'xxhash'
)
makedepends=(
'boost'
'cmake'
'git'
'glib2-devel'
'gobject-introspection'
'gperf'
'libtg_owt'
'microsoft-gsl'
'ninja'
'python'
'range-v3'
'tl-expected'
)
optdepends=(
'geoclue: geoinformation support'
'geocode-glib-2: geocoding support'
'webkit2gtk-4.1: embedded browser features provided by webkit2gtk-4.1'
'webkitgtk-6.0: embedded browser features provided by webkitgtk-6.0 (Wayland only)'
'xdg-desktop-portal: desktop integration'
)
provides=(telegram-desktop)
conflicts=(telegram-desktop)
_td_commit=6d74326c5ce53aeb52496f157f0080d9b8515970
source=(
# Old approach, with many Git repos
#"tdesktop::git+https://github.com/telegramdesktop/tdesktop#$_commit"
# Here are all the submodule repos.
# Use the nearby Python script for generating the list
# ...
# New approach: source tarball, same as the stable Arch package
"https://github.com/telegramdesktop/tdesktop/releases/download/v${pkgver}/tdesktop-${pkgver}-full.tar.gz"
"git+https://github.com/tdlib/td.git#tag=${_td_commit}"
)
sha512sums=('fe66633997f2f9f9825fc48b9d669d983c9184ba826a62af84f937c81f387c4df214a35d60c0cf916c81827d0983c2858217fe90ff00ac4632232dd7c5dabd57'
'6dc6e684a0bf35bb83f6fa6579a0da82d604190b222f2cd2de9b8ef5b93f5f18ac9a8733e2c5cf2a64ed9933b346ea31e26a4bcc0039956280ec2deef9649457')
prepare() {
# Normal preparation here
cd "$srcdir/tdesktop-$pkgver-full"
# Cheating! Linking fixed patches to their usual place
#for fixed in $srcdir/*_fixed*
#do
# ln -s $fixed ${fixed/_fixed/}
#done
# Patch here, if needed!
# patch -Np1 -i "$srcdir/my_beautiful.patch"
# Official package patches
}
build() {
CXXFLAGS+=' -ffat-lto-objects'
# Ensure that we won't have issues with tmpfs.
# Available via TMPDIR_FIX
if [ -n "$TMPDIR_FIX" ]
then
export TMPDIR="$srcdir/build_tmp"
mkdir -p $TMPDIR
echo "Using \$TMPDIR = $TMPDIR ..."
fi
# Build tdlib from source
echo "--> Build tdlib"
cmake -S td -B td/build \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX="$PWD/td/install" \
-Wno-dev \
-DTD_E2E_ONLY=ON
cmake --build td/build -- $MAKEFLAGS
cmake --install td/build
# 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!
echo "--> Build Telegram Desktop"
cmake -B build -S tdesktop-$pkgver-full -G Ninja \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-Dtde2e_DIR="$PWD/td/install/lib/cmake/tde2e" \
-DCMAKE_BUILD_TYPE=Release \
-DTDESKTOP_API_ID=611335 \
-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
cmake --build build -- $MAKEFLAGS
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
|