aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegram-desktop/APKBUILD
blob: 77770120c5e78c55810ae170531afe3a9941b3c5 (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Maintainer:
# Contributor: Leo <thinkabit.ukim@gmail.com>
pkgname=telegram-desktop
pkgver=1.6.7
# https://github.com/telegramdesktop/tdesktop/blob/v$pkgver/docs/building-cmake.md
_libtgvoip_commit=e7010506210fbb3a6704d7ac1276b3334f9ab6c9
_GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec
_variant_commit=550ac2f159ca883d360c196149b466955c77a573
_crl_commit=84072fba75f14620935e5e91788ce603daeb1988
pkgrel=0
pkgdesc="Telegram Desktop messaging app"
options="!check" # Requires Catch2 to be packaged.
url="https://desktop.telegram.org/"
arch="all !s390x"
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"
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
	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
	PrecompiledHeader-cmake.patch
	add-private-qt-functions.patch
	fix-missing-use-of-pch.patch
	dynamic-linking-qt5.patch"
builddir="$srcdir/tdesktop-$pkgver"

prepare() {
	cd "$builddir"

	rmdir Telegram/ThirdParty/libtgvoip
	rmdir Telegram/ThirdParty/GSL
	rmdir Telegram/ThirdParty/variant
	rmdir Telegram/ThirdParty/crl

	# 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

	# 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

	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" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-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="1292b686e47c82f7670e1a528092222c8a61532a9ed64d0e4d3879fa95037b284aa40a956ac1c6739262c4fdf22fb5e9492f6747e971668297cca142a51c5b46  telegram-desktop-1.6.7.tar.gz
a8ef97da8ab50fdbb166933b8e8fd7b6d7db95a95dcdcd92f6882e1f1104e283a6dece5cf4c40bd8d56738efac3e3905bb403287ede2ec2dc5ace3815df4b097  libtgvoip-e7010506210fbb3a6704d7ac1276b3334f9ab6c9.tar.gz
83560cb0c39b6a4781e916c6081ad2728296e1b19760ca1b6426a8431fb6d7093760a882c539dd77152f5892fe081b1795af6366ea91385bb10aba6adf27170f  GSL-d846fe50a3f0bb7767c7e087a05f4be95f4da0ec.tar.gz
537ce0a1731274da63a5be063311f7113c1391081e43970663a994b82a7b2e860302406c2931184789661d86343b2c60064c7014b73dc42799573f5b93bc12ff  variant-550ac2f159ca883d360c196149b466955c77a573.tar.gz
a148b62500c2c735065a0612d7168ee671e9b251b822efea90d25718fe0f0fc2abb8f4c93360d6ac38242c669a2d4349ea917cdc63564ebc4a8825fde13666fb  crl-84072fba75f14620935e5e91788ce603daeb1988.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
485133c447b3414c60e94c074639404768798ec6993095ed108c3b927b6fd423dfee0b68c5c3e12e0d87cc1e53042ab1e76641290c2f71fb29db21245013d72f  Telegram.cmake
56aaf0e35ba1989d463ffa2699e7c0a7235168599f0720f66ff159f03541920e04e5944554b4d1b3a0893cf4581ff50ff00600b54522d24d59fa7192e4f80c0a  TelegramCodegen.cmake
f6e42004d36c69497fd635f1bbd9779027fef1b44fc506cba85ff19c5e49e6b41008782ffb65d59ef4acef78dc0a671c285789ae21cb7a67a9b215c28a2c2eeb  TelegramCodegenTools.cmake
4726ba77330d61f952c7e5af82454cc5536cd92634150406ea5dbc303acfd1d33093334b9b04cf06aa4adca84d97553f28b44dcc554d10af8052352f265c9505  TelegramTests.cmake
fe1a860184fc31888430d8efb5d12bcf57ef0ed7d64a9570159b906138e987e711e52ea87e3e0567bf749f0336d394aba8a7af9bae6b156c621a13f0aa301b6e  ThirdParty-crl.cmake
2282dedd3d6551893674272ea1308d0c36469711ecf52d1ac2cdc719ab0560a35abc968cc903678dd4e3c2454324e18bcb897b46c597a02013c6d75a7406fffe  ThirdParty-libtgvoip-webrtc.cmake
72b7e188c6787b05f68031f24d901194315243a8b8fb5c3e0c10f1e7c75554ae147810e4d47fa2a0fdf7323da07f48b1cd4a6b840cffd65af96ad9a997e4caff  ThirdParty-libtgvoip.cmake
4f6e4d73fe5774a2fe813b9424438d86e23cfb47483b9f2be56ff14bc471c6312e93549a3a712f1b4e51a0663dc6df086134f5b139536709234a31a695635677  PrecompiledHeader-cmake.patch
d7f8db23af250156b73b47ad4b1996b73643eb224c969cd1da2929eedfa23a3784ccf8a5728070f464891c621ec6f786e5da323f5bbb2a2cfba999cf80d9dec4  add-private-qt-functions.patch
6289d5a3eb224ebb05ab64e23ca3d081e617d905cec07edbba423265dc617548005eeb643ce5dfb2fcef9ac774e9f7b64150729bd894ca0e94af0e2aea9c823b  fix-missing-use-of-pch.patch
ad7f1b811b7907b24e0708c5b8f7531891e163b3edebebb159e47cbc24a9201a6ddb5f276f4d0968f84c6d928997f1e94fe9ca678b31e9aad90cdf28449ce39f  dynamic-linking-qt5.patch"