Sisyphus repository
Last update: 21 october 2019 | SRPMs: 17508 | Visits: 15340938
en ru br
ALT Linux repos

Group :: Networking/Instant messaging
RPM: telegram-desktop

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# other variant: Debug
%define buildmode Release

# TODO: improve detection

BuildRequires(pre): rpm-build-ubt
%if %ubt_id == "M80P"
%def_with ffmpeg_static
%def_without ffmpeg_static

# Precompiled supports only for gcc

%def_without clang
%def_without libcxx

Name: telegram-desktop
Version: 1.6.7
Release: alt1

Summary: Telegram is a messaging app with a focus on speed and security

License: %gpl3only
Group: Networking/Instant messaging

# Source-url:

Source: %name-%version.tar

Source2: CMakeLists.txt

Patch1: 0001_add-cmake.patch
Patch3: 0003_qt-plugins.patch
Patch5: 0005_Downgrade-Qt-version.patch
Patch6: 0006_fix-static-qt-functions.patch
#Patch9: 0001-use-correct-executable-path.patch
Patch14: 0014-get-language-name-and-country-name-from-QLocale.patch
Patch15: 0015-disable-resource-fonts.patch
Patch16: 0016-fix-lzma.patch
#Patch17: 0017-ligsl-microsoft-fix.patch
Patch18: 0018-fix-linking.patch

# ix86 disabled due to memory limits for linker

#ExclusiveArch: %ix86 x86_64
ExclusiveArch: aarch64 x86_64

BuildRequires(pre): rpm-build-licenses rpm-macros-qt5 rpm-macros-cmake
BuildRequires(pre): rpm-macros-kde-common-devel

BuildRequires(pre): rpm-build-compat >= 2.1.5
BuildRequires(pre): rpm-build-intro >= 2.1.5
# use no more than system_memory/3000 build procs (see
%_tune_parallel_build_by_procsize 3000

BuildRequires: gcc-c++ libstdc++-devel gyp

# cmake 3.13 due to add_compiler_definitions

BuildRequires: cmake >= 3.13

BuildRequires: qt5-base-devel libqt5-core libqt5-network libqt5-gui qt5-imageformats
# needs for smiles and emojicons
Requires: qt5-imageformats

# for -lQt5PlatformSupport

BuildRequires: qt5-base-devel-static

# for autoupdater (included ever if disabled)

BuildRequires: liblzma-devel

# for SourceFiles/mtproto/connection.cpp

BuildRequires: libzip-devel

BuildRequires: zlib-devel >= 1.2.8

BuildRequires: libminizip-devel libpcre-devel libexpat-devel libssl-devel bison
#BuildRequires: libxkbcommon-devel libxkbcommon-x11-devel
#BuildRequires: libXi-devel libSM-devel libICE-devel libdbus-devel libXfixes-devel
BuildRequires: libX11-devel

# GTK 3.0 integration

BuildRequires: libgtk+3-devel libappindicator-gtk3-devel
# libdee-devel

BuildRequires: libopenal-devel >= 1.17.2
# libportaudio2-devel libxcb-devel
# used by qt imageformats: libwebp-devel
BuildRequires: libva-devel libdrm-devel

BuildRequires: libtgvoip-devel >= 2.4.4
BuildRequires: libcrl-devel >= 0.7

BuildRequires: libxxhash-devel

# C++ sugar

BuildRequires: libmicrosoft-gsl-devel >= 20180615
BuildRequires: libvariant-devel librange-v3-devel

# FIXME: libva need only for linking, extra deps?

Provides: tdesktop = %version-%release
Obsoletes: tdesktop

%if_with ffmpeg_static
BuildRequires: libffmpeg-devel-static
BuildRequires: libavcodec-devel libavformat-devel libavutil-devel libswscale-devel libswresample-devel

%if_with clang
BuildRequires: clang
%remove_optflags -frecord-gcc-switches
%if_with libcxx
%add_optflags -stdlib=libc++

Requires: dbus

# instead of internal fonts OpenSans

Requires: fonts-ttf-open-sans

# some problems with t_assert

%add_optflags -fpermissive

# disable some warnings

%add_optflags -Wno-strict-aliasing -Wno-unused-variable -Wno-sign-compare -Wno-switch

Telegram is a messaging app with a focus on speed and security, it's super-fast, simple and free.
You can use Telegram on all your devices at the same time - your messages
sync seamlessly across any number of your phones, tablets or computers.

With Telegram, you can send messages, photos, videos and files of any type (doc, zip, mp3, etc),
as well as create groups for up to 1000 people or channels for broadcasting to unlimited audiences.
You can write to your phone contacts and find people by their usernames.
As a result, Telegram is like SMS and email combined - and can take care of all your personal
or business messaging needs.

%patch1 -p1
%patch3 -p1
#patch5 -p1
%patch6 -p1
#patch9 -p1
%patch14 -p1
%patch15 -p1
#patch17 -p2
%patch18 -p2

cp %SOURCE2 Telegram/
# MacOS things will conflicts with binary name, so delete Telegram dir
rm -rf Telegram/Telegram/
# remove fonts from resources
rm -rf Telegram/Resources/fonts/
%__subst "s|.*fonts/OpenSans.*||" Telegram/Resources/qrc/telegram.qrc

%if_with ffmpeg_static
export PKG_CONFIG_PATH=%_libdir/ffmpeg-static/%_lib/pkgconfig/
cd Telegram
%if_with clang
export CC=clang
export CXX=clang++
%cmake_insource \
%if_with libcxx
# due precompiled headers
export CCACHE_SLOPPINESS=pch_defines,time_macros

# XDG files
install -m644 -D lib/xdg/telegramdesktop.desktop %buildroot%_desktopdir/%name.desktop
install -m644 -D lib/xdg/tg.protocol %buildroot%_Kservices/tg.protocol
install -m644 -D lib/xdg/telegramdesktop.appdata.xml %buildroot%_datadir/appdata/telegram-desktop.appdata.xml
for i in 16 32 48 64 128 256; do
   install -m644 -D Telegram/Resources/art/icon$i.png %buildroot%_iconsdir/hicolor/${i}x${i}/apps/telegram.png

#cd out/%buildmode

install -D Telegram/Telegram %buildroot%_bindir/%name
ln -s %name %buildroot%_bindir/Telegram
ln -s %name %buildroot%_bindir/telegram



Full changelog you can see here

design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin