aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegram-desktop/APKBUILD
blob: 9acb84229b12ebaa9e449ab508ef67735ac7e0d5 (plain) (blame)
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
# Maintainer: Leo <thinkabit.ukim@gmail.com>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# TODO(Leo): remove pulseaudio dep
pkgname=telegram-desktop
pkgver=1.9.3
pkgrel=0
_breakpad_commit=dbd454dbe47e584571388fc3533193416bdce67f
pkgdesc="Telegram Desktop messaging app"
options="!check" # Requires Catch2 to be packaged.
url="https://desktop.telegram.org/"
arch="all !s390x" # Need support on lib_base
license="GPL-3.0-or-later WITH OpenSSL"
depends="qt5-qtimageformats libappindicator"
makedepends="
	cmake
	zlib-dev
	opus-dev
	libva-dev
	libvdpau-dev
	ffmpeg-dev
	portaudio-dev
	openal-soft-dev
	openssl-dev
	libxkbcommon-dev
	qt5-qtbase-dev
	libexif-dev
	xz-dev
	minizip-dev
	alsa-lib-dev
	libexecinfo-dev
	rapidjson-dev
	lz4-dev
	pulseaudio-dev
	qtchooser
	libdbusmenu-glib-dev
	libappindicator-dev
	xxhash-dev
	enchant2-dev
	range-v3-dev
	python
	"
source="
	https://github.com/telegramdesktop/tdesktop/releases/download/v$pkgver/tdesktop-$pkgver-full.tar.gz
	breakpad-$_breakpad_commit.tar.gz::https://github.com/google/breakpad/archive/$_breakpad_commit.tar.gz
	xdg.patch
	lz4.patch
	zlib.patch
	opus.patch
	openal.patch
	openssl.patch
	ffmpeg.patch
	qt.patch
	range-v3.patch
	musl-basename.patch
	updater.patch
	default-shared.patch
	exotic-arch-compat.patch
	werror-o2.patch
	breakpad-loc.patch
	qt_functions.patch
	ppc.patch
	qt-plugin-path.patch
	qt_functions.cpp
	"
builddir="$srcdir/tdesktop-$pkgver-full"

prepare() {
	# we have these system-wide
	rm -rf Telegram/ThirdParty/minizip Telegram/ThirdParty/lz4

	mv "$srcdir"/breakpad-$_breakpad_commit "$builddir"/Telegram/ThirdParty/breakpad

	cp -L "$srcdir"/qt_functions.cpp "$builddir"/Telegram/SourceFiles

	default_prepare

	mkdir "$builddir"/build
}

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cd build

	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DDESKTOP_APP_DISABLE_CRASH_REPORTS=True \
		-DDESKTOP_APP_DISABLE_SPELLCHECK=OFF \
		-DDESKTOP_APP_LOTTIE_USE_CACHE=ON \
		-DDESKTOP_APP_USE_GLIBC_WRAPS=OFF \
		-DDESKTOP_APP_USE_PACKAGED=ON \
		-DTDESKTOP_API_ID=17349 \
		-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb \
		-DTDESKTOP_DISABLE_GTK_INTEGRATION=ON \
		${CMAKE_CROSSOPTS} ..
	make
}

package() {
	install -d "$pkgdir"/usr/bin \
				"$pkgdir"/usr/share/applications \
				"$pkgdir"/usr/share/appdata \
				"$pkgdir"/usr/share/kservices5 \

	strip -s build/bin/Telegram
	install -m755 build/bin/Telegram "$pkgdir"/usr/bin/telegram-desktop
	install -m644 lib/xdg/telegramdesktop.desktop -t "$pkgdir"/usr/share/applications
	install -m644 lib/xdg/telegramdesktop.appdata.xml -t "$pkgdir"/usr/share/appdata
	install -m644 lib/xdg/tg.protocol -t "$pkgdir"/usr/share/kservices5

	for icon_size in 16 32 48 64 128 256 512; do
		icon_dir="$pkgdir/usr/share/icons/hicolor/${icon_size}x$icon_size/apps"

		install -d "$icon_dir"
		install -m644 "$builddir/Telegram/Resources/art/icon$icon_size.png" \
			"$icon_dir/telegram.png"
	done
}

sha512sums="af8e5d2c74d0b990958edd75a01f40b70bc21c0f69074acfb943f44fdb1f1e84465b461765a1a584513e54ab30045817b42b6839ad16cb4c1043fda89ea600f7  tdesktop-1.9.3-full.tar.gz
af8c9e8cf151b6aaa94a11b1f3f4d73c117fa25d7ba3b603c25170278bb0a99a9da10facc3b140fa0e3c2c0747a1f5bdcfb1120dfd48913a0d84f78701abb9fc  breakpad-dbd454dbe47e584571388fc3533193416bdce67f.tar.gz
8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5  xdg.patch
438d8008a3513a182ba21aa2f008ee889ff5de24e0a722ea4d690ddba98fba4e781456095801cb4f8eebbce345e86d7a5fdaf1aa8e1f7697b77f1f87b4851d91  lz4.patch
c814f4b944c210cac34964d4261fc838fd3891892cb57d9d9c8ed09bbb317e8e8be9d635b73f720bd9a99cbb71c896b052da4851cec8e4e28ec25b586f4bb152  zlib.patch
f8a22d356dccaf9bfcca5566ecd90c9c6db1566af1f51878cd6239d4b0c893f3c2535e2144f69dd3e19744120b417ebc744a02de185de99e9ef12599de150414  opus.patch
0f714a1c0f0b2b83c39bd699f0b7995ee1bccd9bdf0f5b401bc92ff722837d0f500eb3a410b881ca7e3656256ee1f930c6f7a020e54119045c0539e377b8d63d  openal.patch
f808d3c3670415b75b9569276f51f5464ced5146535104826d5736f5febabd1c7587181bb30f6876ae753618fbffa3bf5013ecd4a6e2dadd9cc4ca6ee1957215  openssl.patch
b5ed0d2697491c1008431b596997b7c9b273772efae603d99c8539d8a678e339f9f8e01f63533ac3474c7e3a82619037a33bc25a760cf2204887caca4c521412  ffmpeg.patch
48a6460c24f6bda5b492d26fbff99f7a9ff953e43e856e2669b25cbd6a942ae009d4dbd07462e7fdbd431662bfbd6fd8414d052b78a93bb2cd02a912d88012c7  qt.patch
1852ac9326d73055118ab5cbbd3bf2af1d72523d12913a6378b797551d405d0f397b05d1918494a741864614c3f605bff8a5f595e8c286e46db9696b3220103e  range-v3.patch
6062602d02e20917c06f17d12bb21bd4a94b23c2a6744a8a05c2c93d41747ba413e110edd344ecd130c28ebaf997ae46b347d239e69f5856ead42318bd5b01cd  musl-basename.patch
3182d2da588fd50c771047550e0d4805cce404836ecc6a4f9ccc95b21c6915391ab3f4d75cd745737836d6c483eac84974659b97e9514384efd032ef33044125  updater.patch
4fb0f0a8c0a57436a10a79d7d1a45c1045d3ac30b9437e65025a4867400b52e52b38c61d447b1392bdf2bd6b241ed25a2c73851c67e08b9198a922c22a316345  default-shared.patch
b40c9948bab21253d54cbf6c609f82f97c80b064ddc2a5b8347b6322e26836c55a9c3eaab429a46f058bac1c7a7f57fd63979a318af13063ce9039fe29bcfd14  exotic-arch-compat.patch
d321da9c960641cd7d8159a0f076670b366afb847607a9f05525d17e3751ddcae2f3fa8b0d5f0f4780f7831033f48ce32373104ab35f8d2762e31e1097b20188  werror-o2.patch
838c5891084344b06fc1b140928e0fed804a8acbb8374147418094d164b5f42d84f72a0fd0941844366f5949ed73301915a78d09de7c309d128852f44cbcd8a9  breakpad-loc.patch
835f5735d6fc52ad0a3b99f21a0a06cb310f21981a6036f4c9b76312eb947af7fa065ef7f530bcd63ee9271d293778cc8ddf098764c2878a8500aa04ee05c2b1  qt_functions.patch
9a3e491e2b2a9ea3f15da3766a2d743bafead7ae1e6a6ca3e6e9c7352dc268221311acd73664e5452622e2bc91cc88a2a7d3b4ebe6634b4da74c54b3bde0bb7f  ppc.patch
183767e9a291dd605797cdc46382d8cb6a73a342348a40df7d52864ea27b3aa8709808cd51c46f5e611c247229ed336cb569bed1185c4c97b03171b56bbe5653  qt-plugin-path.patch
edb5e7b1492c4913d2669610c7666a90fd94a615b7e3fc0c84e82bfd56fc61515b0e8ce14b35232a2f60f69db02769b8a05a4d11ccffec771d767cb600c92340  qt_functions.cpp"