void-packages/srcpkgs/telegram-desktop/template

76 lines
3.2 KiB
Bash

# Template file for 'telegram-desktop'
pkgname=telegram-desktop
version=1.2.17
revision=2
_libtgvoip_commit=6e0e1026147364cfb1234489980a2625ab50b598
_GSL_commit=9d65e74400976b3509833f49b16d401600c7317d
_variant_commit=550ac2f159ca883d360c196149b466955c77a573
_crl_commit=344cbde9ae8d89a6530408d3176d2754ae0ff0e2
_Catch_commit=5ca44b68721833ae3731802ed99af67c6f38a53a
wrksrc="tdesktop-${version}"
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"
depends="qt5-imageformats"
short_desc="Telegram Desktop messaging app"
maintainer="John <johnz@posteo.net>"
license="GPL-3"
homepage="https://desktop.telegram.org/"
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="775614e70372b2e18ef1b2940fa043599240975597e4c5e4431c6deb041a613d
55569944e609bc817a454a43407bbbe1cd6dcfdbbb43579678e0d9e4340ddb14
1aab15abd08fd377524df9dc6a71c977f8617d4a2a8f8a2aa1ce07f3c3ff4371
aa794dfefe0a90501587e36d977b958d0df888503117a8d9aa43dc14f8526d9d
c8ad2e354b13aa162a1f6104cfbf353bd6c2d19af7a439b55ffaa2b38e040ce5
d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18"
nocross="gyp build script doesn't support cross compiling"
case $XBPS_TARGET_MACHINE in
i686*) nodebug=yes;; # ENOMEM
*-musl) makedepends+=" libexecinfo-devel";;
mips*) broken="unsuported";;
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
}