aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegram-desktop/APKBUILD
blob: 8cdf7424ff064ace65ad15982d40e9c8afc51573 (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
# Maintainer: Leo <thinkabit.ukim@gmail.com>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# TODO(Leo): remove pulseaudio dep
pkgname=telegram-desktop
pkgver=1.9.4
pkgrel=0
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
	ninja
	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
	qtchooser
	pulseaudio-dev
	libdbusmenu-glib-dev
	libappindicator-dev
	xxhash-dev
	enchant2-dev
	range-v3-dev
	python3
	"
source="
	https://github.com/telegramdesktop/tdesktop/releases/download/v$pkgver/tdesktop-$pkgver-full.tar.gz
	xdg.patch
	musl-basename.patch
	ppc.patch
	qt-plugin-path.patch
	"
builddir="$srcdir/tdesktop-$pkgver-full"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON \
		-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 \
		-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF \
		-DTDESKTOP_USE_PACKAGED_TGVOIP=OFF \
		${CMAKE_CROSSOPTS} .
	ninja -C build
}

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="0967f60dd978a5fc5ec2501a22e8865afd4ddeaacfd1b0acfb133cd511767ff1c6f03a099aef3de03b0f837c8eccac1caea14c395ee54c8d3ab5b35de7551745  tdesktop-1.9.4-full.tar.gz
8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5  xdg.patch
6062602d02e20917c06f17d12bb21bd4a94b23c2a6744a8a05c2c93d41747ba413e110edd344ecd130c28ebaf997ae46b347d239e69f5856ead42318bd5b01cd  musl-basename.patch
9a3e491e2b2a9ea3f15da3766a2d743bafead7ae1e6a6ca3e6e9c7352dc268221311acd73664e5452622e2bc91cc88a2a7d3b4ebe6634b4da74c54b3bde0bb7f  ppc.patch
183767e9a291dd605797cdc46382d8cb6a73a342348a40df7d52864ea27b3aa8709808cd51c46f5e611c247229ed336cb569bed1185c4c97b03171b56bbe5653  qt-plugin-path.patch"