You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
4.0 KiB

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit desktop optfeature xdg
DESCRIPTION="Official desktop client for Telegram (binary package)"
HOMEPAGE="https://desktop.telegram.org"
SRC_URI="
https://github.com/telegramdesktop/tdesktop/archive/v${PV}.tar.xz -> tsetup.${PV}.tar.xz
amd64? ( https://updates.tdesktop.com/tlinux/tsetup.${PV}.tar.xz )
https://github.com/telegramdesktop/tdesktop/raw/dev/lib/xdg/org.telegram.desktop.desktop
https://github.com/telegramdesktop/tdesktop/raw/dev/lib/xdg/org.telegram.desktop.metainfo.xml
https://github.com/telegramdesktop/tdesktop/raw/dev/lib/xdg/org.telegram.desktop.service
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon16.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon16%402x.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon32.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon32%402x.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon48.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon48%402x.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon64.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon64%402x.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon128.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon128%402x.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon256.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon256%402x.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon512.png
https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon512%402x.png
"
#https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon_round512%402x.png
#https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/icon_green.png
#https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/art/iconbig_green.png
LICENSE="GPL-3-with-openssl-exception"
SLOT="0"
KEYWORDS="-* ~amd64"
QA_PREBUILT="usr/bin/telegram-desktop"
RDEPEND="
!net-im/telegram-desktop
sys-libs/glibc
dev-libs/glib:2
>=media-libs/fontconfig-2.13
media-libs/freetype:2
virtual/opengl
x11-libs/libX11
>=x11-libs/libxcb-1.10[xkb]
"
RESTRICT="bindist mirror strip"
S="${WORKDIR}/Telegram"
src_unpack() {
unpack tsetup.${PV}.tar.xz
}
src_prepare() {
mkdir -p "${WORKDIR}/tdesktop-${PV}/lib/xdg/"
mkdir -p "${WORKDIR}/tdesktop-${PV}/Telegram/Resources/art/"
mkdir -p "${WORKDIR}/usr/share/mime/packages/"
cp -r ${DISTDIR}/*.desktop "${WORKDIR}/tdesktop-${PV}/lib/xdg/"
cp -r ${DISTDIR}/*.service "${WORKDIR}/tdesktop-${PV}/lib/xdg/"
cp -r ${DISTDIR}/*.xml "${WORKDIR}/usr/share/mime/packages/"
cp -r ${DISTDIR}/icon* "${WORKDIR}/tdesktop-${PV}/Telegram/Resources/art/"
sed -i -E -e 's/^Exec=.*telegram-desktop/Exec=\/usr\/bin\/telegram-desktop/' \
"${WORKDIR}/tdesktop-${PV}"/lib/xdg/org.telegram.desktop.service || die
default
}
src_install() {
newbin Telegram telegram-desktop
insinto /etc/tdesktop
newins - externalupdater <<<"${EPREFIX}/usr/bin/telegram-desktop"
for icon in "${WORKDIR}/tdesktop-${PV}/Telegram/Resources/art/"*.png; do
size=${icon##*/icon}
size=${size%.png}
size=${size%\%402x}
dodir "/usr/share/icons/hicolor/${size}/apps"
if [[ ${icon} =~ "%402x" ]] ; then
newicon -s ${size%%x*} "$icon" ${PN}@2x.png
else newicon -s ${size%%x*} "$icon" ${PN}.png
fi
done
dosym ../icons/hicolor/512x512/apps/${PN}.png \
/usr/share/pixmaps/${PN}.png
domenu "${WORKDIR}/tdesktop-${PV}"/lib/xdg/*.desktop
insinto /usr/share/dbus-1/services
doins "${WORKDIR}/tdesktop-${PV}"/lib/xdg/*.service
cp -Lr ${WORKDIR}/usr/* "${D}/usr/"
}
pkg_postinst() {
xdg_pkg_postinst
optfeature "spell checker support" app-text/enchant
}