void-packages/srcpkgs/telegram-desktop/template
John f0db49e3ad New package: telegram-desktop-1.2.8
Closes: #11729 [via git-merge-pr]
2018-03-03 00:05:39 +01:00

73 lines
3.1 KiB
Bash

# Template file for 'telegram-desktop'
pkgname=telegram-desktop
version=1.2.8
revision=1
_libtgvoip_commit=0b53884c8bf10a1d7df879baec839a1fab896c63
_GSL_commit=c5851a8161938798c5594a66420cb814fea92711
_variant_commit=550ac2f159ca883d360c196149b466955c77a573
_crl_commit=344cbde9ae8d89a6530408d3176d2754ae0ff0e2
_Catch_commit=5ca44b68721833ae3731802ed99af67c6f38a53a
wrksrc="tdesktop-${version}"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
build_style=cmake
build_wrksrc="out/Release"
hostmakedepends="gyp pkg-config"
makedepends="qt5-devel gtk+3-devel libappindicator-devel libdbusmenu-glib-devel
opus-devel alsa-lib-devel pulseaudio-devel range-v3 minizip-devel ffmpeg-devel
libopenal-devel"
short_desc="Telegram Desktop messaging app"
maintainer="John <johnz@posteo.net>"
license="GPL-3"
homepage="https://github.com/telegramdesktop/tdesktop"
distfiles="https://github.com/telegramdesktop/tdesktop/archive/v${version}.tar.gz
https://github.com/telegramdesktop/libtgvoip/archive/${_libtgvoip_commit}.tar.gz
https://github.com/Microsoft/GSL/archive/${_GSL_commit}.tar.gz
https://github.com/mapbox/variant/archive/${_variant_commit}.tar.gz
https://github.com/telegramdesktop/crl/archive/${_crl_commit}.tar.gz
https://github.com/catchorg/Catch2/archive/${_Catch_commit}.tar.gz"
checksum="cb8530041b5b742e641b0f3a98699a116b1677cb547de90a957b739c5d754386
ae88aee4075479de94afafe87892798cabeb44d4feb4a9fbe641a5300c8c7016
7e35ec47741fac58e7262ce0bfce118d79a7dec009d8425fa00ff04d3a4082a8
aa794dfefe0a90501587e36d977b958d0df888503117a8d9aa43dc14f8526d9d
c8ad2e354b13aa162a1f6104cfbf353bd6c2d19af7a439b55ffaa2b38e040ce5
d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18"
case $XBPS_TARGET_MACHINE in
*-musl) makedepends+=" libexecinfo-devel";;
esac
post_extract() {
mv ${wrksrc}/../libtgvoip-${_libtgvoip_commit}/* ${wrksrc}/Telegram/ThirdParty/libtgvoip
mv ${wrksrc}/../GSL-${_GSL_commit}/* ${wrksrc}/Telegram/ThirdParty/GSL
mv ${wrksrc}/../variant-${_variant_commit}/* ${wrksrc}/Telegram/ThirdParty/variant
mv ${wrksrc}/../crl-${_crl_commit}/* ${wrksrc}/Telegram/ThirdParty/crl
mv ${wrksrc}/../Catch2-${_Catch_commit}/* ${wrksrc}/Telegram/ThirdParty/Catch
mkdir out/Release -p
}
pre_configure() {
export GYP_DEFINES="TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME,TDESKTOP_DISABLE_UNITY_INTEGRATION"
cd ${wrksrc} && \
gyp2 \
-Dbuild_defines=${GYP_DEFINES} \
-Gconfig=Release \
--depth=Telegram/gyp --generator-output=../.. \
-Goutput_dir=out Telegram/gyp/Telegram.gyp --format=cmake
NUM=$((`wc -l < out/Release/CMakeLists.txt` - 2))
sed -i "$NUM r ${FILESDIR}/CMakeLists.inj" out/Release/CMakeLists.txt
export ASM=gcc
}
do_install() {
vbin build/Telegram telegram-desktop
for i in 16 32 48 64 128 256 512; do
vinstall ${wrksrc}/Telegram/Resources/art/icon$i.png 644 usr/share/icons/hicolor/${i}x${i} telegram-desktop.png
done
vinstall ${wrksrc}/lib/xdg/telegramdesktop.desktop 644 usr/share/applications/
vinstall ${wrksrc}/lib/xdg/tg.protocol 644 usr/share/kservice5/
vinstall ${wrksrc}/lib/xdg/telegramdesktop.appdata.xml 644 usr/share/metainfo
}