summaryrefslogtreecommitdiff
path: root/user/telegram/APKBUILD
blob: 1f36cb942347be6d06b13a2650e541370514f543 (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
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=telegram
pkgver=1.9.6
pkgrel=0
pkgdesc="Telegram messaging app"
url="https://telegram.org/"
arch="all"
options="!check"  # No test suite.
license="GPL-3.0-only WITH OpenSSL-exception"
depends=""
makedepends="cmake enchant-dev ffmpeg-dev lz4-dev minizip-dev openal-soft-dev openssl-dev opus-dev pulseaudio-dev python3 qt5-qtbase-dev range-v3 xxhash-dev xz-dev zlib-dev"
subpackages=""
source="https://github.com/telegramdesktop/tdesktop/releases/download/v1.9.6/tdesktop-$pkgver-full.tar.gz
	endian.patch
	headers.patch
	ppc.patch
	"
builddir="$srcdir/tdesktop-$pkgver-full"

build() {
	[ -f "$HOME/telegram_credentials.sh" ] || die "You need to have a Telegram API ID."

	. $HOME/telegram_credentials.sh

	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	# Can't use packaged rlottie, API mismatch.
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON \
		-DDESKTOP_APP_USE_GLIBC_WRAPS=OFF \
		-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF \
		-DTDESKTOP_API_ID="${TELEGRAM_API_ID}" \
		-DTDESKTOP_API_HASH="${TELEGRAM_API_HASH}" \
		-DTDESKTOP_DISABLE_GTK_INTEGRATION=ON \
		-DTDESKTOP_LAUNCHER_BASENAME=telegramdesktop \
		-DTDESKTOP_USE_PACKAGED_TGVOIP=OFF \
		-Ddisable_autoupdate=1 \
		${CMAKE_CROSSOPTS} \
		.
	make
}

package() {
	install -D -m755 "$builddir"/bin/Telegram "$pkgdir"/usr/bin/telegram-desktop
	install -D -m644 "$builddir"/lib/xdg/telegramdesktop.desktop "$pkgdir"/usr/share/applications/telegramdesktop.desktop
	install -D -m644 "$builddir"/lib/xdg/tg.protocol "$pkgdir"/usr/share/kservices5/tg.protocol
	for _icon in 16 32 48 64 128 256 512; do
		install -D -m644 "$builddir"/Telegram/Resources/art/icon$_icon.png \
			"$pkgdir"/usr/share/icons/hicolor/${_icon}x${_icon}/apps/telegram.png
	done
}

sha512sums="12446b8c467226b7ebfb96d3e8cdc77fbaeb9de6065e43e2de727564735f3047f2810d20bb12649eaffb41c09d2295a7918d041058ab1f96ba3dcdcf019d857e  tdesktop-1.9.6-full.tar.gz
f39b541c915830adf359d864e197f773822f9925817664a596b595ef31b0c2d0d7f073284c45fb1236b61565e2d7959e030783b7a8350399513ff13f9c27aa2a  endian.patch
9b9a9b623edcce37339e52e3e306a7106b6289749fca1b2dc7450c299da1a6f8d3f3f12b4973ecfbf3797f75ba88cf7f644adee896b053a683df4e4754d5d057  headers.patch
685142055710f5a499d1f7c72a57c9c979dedce91c078204a6880080473db989e690d1bd1cce916e0a2cebb285741570665b4940ca7a5a36eecdd54eb39e8003  ppc.patch"