aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegram-desktop/APKBUILD
blob: 723273c540a7884c6764f17e32b9268d0f36c071 (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Maintainer: Leo <thinkabit.ukim@gmail.com>
# Contributor: Leo <thinkabit.ukim@gmail.com>
pkgname=telegram-desktop
pkgver=1.7.10
# https://github.com/telegramdesktop/tdesktop/blob/v$pkgver/docs/building-cmake.md
_libtgvoip_commit=a19a0aff644127d8089f6a4ac18119ec5247dbd0
_GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec
_variant_commit=550ac2f159ca883d360c196149b466955c77a573
_crl_commit=d259aebc11df52cb6ff8c738580dc4d8f245d681
_qtlottie_commit=a3fac9db920b167a5f91d678ee7968f100f6fe51
pkgrel=0
pkgdesc="Telegram Desktop messaging app"
options="!check" # Requires Catch2 to be packaged.
url="https://desktop.telegram.org/"
arch="all !aarch64 !s390x" # ARM are failing due to range-v3
license="GPL-3.0-or-later WITH OpenSSL"
depends="qt5-qtimageformats"
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
	python2
	xxhash-dev
	range-v3-dev
	grep
	rapidjson-dev
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/telegramdesktop/tdesktop/archive/v${pkgver}.tar.gz
	libtgvoip-$_libtgvoip_commit.tar.gz::https://github.com/telegramdesktop/libtgvoip/archive/${_libtgvoip_commit}.tar.gz
	GSL-$_GSL_commit.tar.gz::https://github.com/Microsoft/GSL/archive/${_GSL_commit}.tar.gz
	variant-$_variant_commit.tar.gz::https://github.com/mapbox/variant/archive/${_variant_commit}.tar.gz
	crl-$_crl_commit.tar.gz::https://github.com/telegramdesktop/crl/archive/${_crl_commit}.tar.gz
	qtlottie-$_qtlottie_commit.tar.gz::https://github.com/telegramdesktop/qtlottie/archive/${_qtlottie_commit}.tar.gz
	musl.patch
	no-gtk2.patch
	no-pulse.patch
	xdg.patch
	ppc64le-enable-arch.patch
	system-wide-fonts.patch
	FindBreakpad.cmake
	Telegram.cmake
	TelegramCodegen.cmake
	TelegramCodegenTools.cmake
	TelegramTests.cmake
	ThirdParty-crl.cmake
	ThirdParty-libtgvoip-webrtc.cmake
	ThirdParty-libtgvoip.cmake
	ThirdParty-qtlottie.cmake
	PrecompiledHeader-cmake.patch
	add-private-qt-functions.patch
	fix-missing-use-of-pch.patch
	dynamic-linking-qt5.patch
	sourcefiles-lottie.patch
	submodule-lottie.patch
	"
builddir="$srcdir/tdesktop-$pkgver"

prepare() {
	rmdir Telegram/ThirdParty/libtgvoip
	rmdir Telegram/ThirdParty/GSL
	rmdir Telegram/ThirdParty/variant
	rmdir Telegram/ThirdParty/crl
	rmdir Telegram/ThirdParty/qtlottie

	# Copy fetched libraries to their appropriate locations
	mv ../libtgvoip-${_libtgvoip_commit} "${builddir}"/Telegram/ThirdParty/libtgvoip
	mv ../GSL-${_GSL_commit} "${builddir}"/Telegram/ThirdParty/GSL
	mv ../variant-${_variant_commit} "${builddir}"/Telegram/ThirdParty/variant
	mv ../crl-${_crl_commit} "${builddir}"/Telegram/ThirdParty/crl
	mv ../qtlottie-${_qtlottie_commit} "${builddir}"/Telegram/ThirdParty/qtlottie

	# Copy cmake files
	mv ../Telegram.cmake "${builddir}"/Telegram/CMakeLists.txt
	mv ../ThirdParty-crl.cmake "${builddir}"/Telegram/ThirdParty/crl/CMakeLists.txt
	mv ../ThirdParty-libtgvoip.cmake "${builddir}"/Telegram/ThirdParty/libtgvoip/CMakeLists.txt
	mv ../ThirdParty-libtgvoip-webrtc.cmake \
		"${builddir}"/Telegram/ThirdParty/libtgvoip/webrtc_dsp/CMakeLists.txt
	mv ../ThirdParty-qtlottie.cmake "${builddir}"/Telegram/ThirdParty/qtlottie/CMakeLists.txt

	mkdir -p "${builddir}"/Telegram/cmake
	mv ../FindBreakpad.cmake "${builddir}"/Telegram/cmake
	mv ../TelegramCodegen.cmake "${builddir}"/Telegram/cmake
	mv ../TelegramTests.cmake "${builddir}"/Telegram/cmake

	mkdir -p "${builddir}"/Telegram/native
	mv ../TelegramCodegenTools.cmake "${builddir}"/Telegram/native/CMakeLists.txt

	cd "$builddir/Telegram/ThirdParty"
	rm -rf minizip # we have this system-wide

	default_prepare
}

build() {
	cd "$builddir"/Telegram/native
	CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
	make

	mkdir "$builddir"/Telegram/telegram-build
	cd "$builddir"/Telegram/telegram-build
	export CPPFLAGS="$CPPFLAGS -Winvalid-pch"
	export CXXFLAGS="$CXXFLAGS -Winvalid-pch"
	export CXXFLAGS="$CXXFLAGS -DTDESKTOP_API_ID=17349"
	export CXXFLAGS="$CXXFLAGS -DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb"

	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS -O2" \
		-DCMAKE_C_FLAGS="$CFLAGS -O2" \
		-DENABLE_PULSEAUDIO=OFF \
		-DENABLE_CRASH_REPORTS=OFF \
		-DENABLE_GTK_INTEGRATION=OFF \
		-DBUILD_TESTS=OFF \
		${CMAKE_CROSSOPTS} ..
	make
}

package() {
	cd "$builddir"/Telegram/telegram-build
	mkdir -p "$pkgdir"/usr/bin
	make DESTDIR="$pkgdir" install

	# Fix name to be telegram-desktop
	mv "$pkgdir"/usr/bin/Telegram "$pkgdir"/usr/bin/telegram-desktop

	cd "${builddir}"/Telegram/Resources/art
	mkdir -p "$pkgdir"/usr/share/icons/hicolor
	for size in 16 32 48 64 128 256 512; do
		mkdir -p "$pkgdir"/usr/share/icons/hicolor/"$size"x"$size"/apps
		mv icon"$size".png "$pkgdir"/usr/share/icons/hicolor/"$size"x"$size"/apps/telegram.png
	done
}

sha512sums="f6e8849d344fd7f8af94d639900150ae87182e1e782f071d1f99aee29a366754eca74ed4062ee10d37348d1195da598a6ce77921fd480e5367b69913c443efe5  telegram-desktop-1.7.10.tar.gz
9d7826d0996d39dcaf1f56bdd418251b3bc39ebf9ec662280a01dea97deeb02b784b69de4e0421791cda7a18680d26437fbe9d0c965c13a2b0cb971a0b3f511f  libtgvoip-a19a0aff644127d8089f6a4ac18119ec5247dbd0.tar.gz
83560cb0c39b6a4781e916c6081ad2728296e1b19760ca1b6426a8431fb6d7093760a882c539dd77152f5892fe081b1795af6366ea91385bb10aba6adf27170f  GSL-d846fe50a3f0bb7767c7e087a05f4be95f4da0ec.tar.gz
537ce0a1731274da63a5be063311f7113c1391081e43970663a994b82a7b2e860302406c2931184789661d86343b2c60064c7014b73dc42799573f5b93bc12ff  variant-550ac2f159ca883d360c196149b466955c77a573.tar.gz
b2aac32e8964165dcf449ceb98dca9665ed9ababdd45c323252a8e39f08acac703dc14a17bafefc40f0a7e76a0c6eb7341a7581cc08e47d64a1f98c8cee50d29  crl-d259aebc11df52cb6ff8c738580dc4d8f245d681.tar.gz
9385cd7072b2258d8ca1ed9932d953bbdee104833573e15a19f2a824c760cd43e79cd0713385c63fa10648d6ae3d201df080f9da0135f9b338a86ea10cc8a867  qtlottie-a3fac9db920b167a5f91d678ee7968f100f6fe51.tar.gz
fc672d8168f6b2807e596570bc57f3b89296891b5d62b8e12b38193ed4919e4eb17efd72691c4086fb0ff4383de54695a9faf9874a0727a0980ef35e5ca4bee7  musl.patch
cb01655dd097b68e89b15e6e4b1f6da10c52e8bec681eeef9807ca376283b10cb3da34acc976c790f3c8dea05acbef1ba1967612920a2e4acb3b9da79e251a0d  no-gtk2.patch
90caf4e67f1fb8bcb26455553b90e35d247cbf67097508bd430f7f790aad9e2ae1646b0ea174013c87c331fb37e60633031187a24787e6a73ca73b706d741739  no-pulse.patch
8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5  xdg.patch
3647ad5fff6326ba9c75fa98189a08c0909af8d1c2b704c8c62fd9da6603f5162af3176c37daa67eb5896bebe3814bf1fd66b9e93c78cbd9b439e472d0db4b44  ppc64le-enable-arch.patch
ce6be003220267bac5483caf8302b492e1581892bc36d35a61236ebf9f9d766b8bd2159557a1c36256aa85f461797a38bfaae57b12da7a72101b21c0b17ed653  system-wide-fonts.patch
8b75da50a8212cd7c77e497ad5a49290e2656a2e01037d179cd6270105337a9adb238814f98bdf7a3e954ce8661dc3183a7400533067f9a21e38133a6628563a  FindBreakpad.cmake
53a95dfeabb3a923104132c657f228ed5ae689db86a541be3604c00eeecd3e18c20615111f3682d1355713d7005107a2f938a157bb0eb29948d11a709f2ea71e  Telegram.cmake
56aaf0e35ba1989d463ffa2699e7c0a7235168599f0720f66ff159f03541920e04e5944554b4d1b3a0893cf4581ff50ff00600b54522d24d59fa7192e4f80c0a  TelegramCodegen.cmake
f6e42004d36c69497fd635f1bbd9779027fef1b44fc506cba85ff19c5e49e6b41008782ffb65d59ef4acef78dc0a671c285789ae21cb7a67a9b215c28a2c2eeb  TelegramCodegenTools.cmake
4726ba77330d61f952c7e5af82454cc5536cd92634150406ea5dbc303acfd1d33093334b9b04cf06aa4adca84d97553f28b44dcc554d10af8052352f265c9505  TelegramTests.cmake
fe1a860184fc31888430d8efb5d12bcf57ef0ed7d64a9570159b906138e987e711e52ea87e3e0567bf749f0336d394aba8a7af9bae6b156c621a13f0aa301b6e  ThirdParty-crl.cmake
2282dedd3d6551893674272ea1308d0c36469711ecf52d1ac2cdc719ab0560a35abc968cc903678dd4e3c2454324e18bcb897b46c597a02013c6d75a7406fffe  ThirdParty-libtgvoip-webrtc.cmake
72b7e188c6787b05f68031f24d901194315243a8b8fb5c3e0c10f1e7c75554ae147810e4d47fa2a0fdf7323da07f48b1cd4a6b840cffd65af96ad9a997e4caff  ThirdParty-libtgvoip.cmake
c80e0c9f79e61b7b152e17ec69be087f1312ffadf38ea5d5eecf4f43a2eadc0cba9112e61f878d2d8eb0c44c6c33bb8338c87009c6f2d97c58357d73de1af080  ThirdParty-qtlottie.cmake
7ddeb1040e7bf707c13686861d289b3971381bed5c66a2d91b24d0d31c94c38634c0a08916219c51629cabdf33a386e4ad57f719054b0cc3ef1a85ea5d522994  PrecompiledHeader-cmake.patch
d7f8db23af250156b73b47ad4b1996b73643eb224c969cd1da2929eedfa23a3784ccf8a5728070f464891c621ec6f786e5da323f5bbb2a2cfba999cf80d9dec4  add-private-qt-functions.patch
6289d5a3eb224ebb05ab64e23ca3d081e617d905cec07edbba423265dc617548005eeb643ce5dfb2fcef9ac774e9f7b64150729bd894ca0e94af0e2aea9c823b  fix-missing-use-of-pch.patch
ad7f1b811b7907b24e0708c5b8f7531891e163b3edebebb159e47cbc24a9201a6ddb5f276f4d0968f84c6d928997f1e94fe9ca678b31e9aad90cdf28449ce39f  dynamic-linking-qt5.patch
3b6fabfb23ea82ae7eb42221dd07af6ad08e4ec2e4657697148159c7ebe46c3681857f16b5445b79d5b29de36101d394e2eb6b85a45145e109cfe63e14fed9b4  sourcefiles-lottie.patch
2aafc567e7ad4c5d7b5d3ccba3ee5c6998c0f2107ca63079471379fe27e822ccbd95c4a67cbcef77fbd2b0edca1b493ed19e80d3106f1d71cbe6fd9b05f91729  submodule-lottie.patch"