2016-11-13 03:07:38 +01:00
|
|
|
Name: telegram-desktop
|
|
|
|
Summary: A new era of messaging
|
2017-03-20 20:53:42 +01:00
|
|
|
Version: 1.0.24
|
2016-11-13 03:07:38 +01:00
|
|
|
Release: 1
|
|
|
|
License: GPL-3.0
|
|
|
|
URL: https://github.com/telegramdesktop/tdesktop
|
|
|
|
Source: tdesktop-%{version}.tar.gz
|
2017-01-12 20:55:36 +01:00
|
|
|
Source1: breakpad-master.tar.gz
|
2016-11-13 03:07:38 +01:00
|
|
|
Source2: linux-syscall-support-refs-heads-master.tar.gz
|
2017-01-12 20:55:36 +01:00
|
|
|
Source3: gyp-master.tar.gz
|
|
|
|
Source4: patch-%{version}.diff
|
2017-03-20 20:53:42 +01:00
|
|
|
Source5: GSL-master.zip
|
|
|
|
Source6: variant-master.zip
|
2016-11-13 03:07:38 +01:00
|
|
|
|
2016-07-18 16:52:25 +02:00
|
|
|
ExclusiveArch: x86_64
|
2016-11-13 03:07:38 +01:00
|
|
|
BuildRequires: libtelegram-qt5-devel-static
|
|
|
|
BuildRequires: libappindicator-devel
|
2017-03-20 20:53:42 +01:00
|
|
|
BuildRequires: gcc-c++
|
2016-11-13 03:07:38 +01:00
|
|
|
BuildRequires: libtiff-devel
|
|
|
|
BuildRequires: libmng-devel
|
2016-11-28 17:55:02 +01:00
|
|
|
BuildRequires: pcre-devel
|
|
|
|
BuildRequires: ffmpeg-devel
|
|
|
|
BuildRequires: libopus-devel
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
BuildRequires: portaudio-devel
|
|
|
|
BuildRequires: desktop-file-utils
|
|
|
|
BuildRequires: chrpath
|
2016-11-13 03:07:38 +01:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: libopus-devel
|
|
|
|
BuildRequires: xorg-x11-devel
|
|
|
|
BuildRequires: xz
|
2017-03-20 20:53:42 +01:00
|
|
|
BuildRequires: unzip
|
2016-11-13 03:07:38 +01:00
|
|
|
BuildRequires: openal-soft-devel
|
|
|
|
BuildRequires: xcb-util-wm-devel
|
|
|
|
BuildRequires: xcb-util-image-devel
|
|
|
|
BuildRequires: xcb-util-renderutil-devel
|
|
|
|
BuildRequires: xcb-util-keysyms-devel
|
2016-11-28 17:55:02 +01:00
|
|
|
BuildRequires: libproxy-devel
|
2017-01-12 20:55:36 +01:00
|
|
|
BuildRequires: libXfixes-devel
|
|
|
|
BuildRequires: fontconfig-devel
|
|
|
|
BuildRequires: libexpat-devel
|
|
|
|
BuildRequires: freetype-devel
|
2016-11-28 17:55:02 +01:00
|
|
|
BuildRequires: libjpeg-devel
|
|
|
|
BuildRequires: pkgconfig(libpng)
|
|
|
|
BuildRequires: pkgconfig(xcb-util)
|
|
|
|
BuildRequires: pkgconfig(mtdev)
|
|
|
|
BuildRequires: pkgconfig(tslib)
|
|
|
|
BuildRequires: pkgconfig(harfbuzz)
|
|
|
|
BuildRequires: pkgconfig(libwebp)
|
2016-11-13 03:07:38 +01:00
|
|
|
BuildRequires: pkgconfig(xkbcommon)
|
|
|
|
BuildRequires: pkgconfig(xkbcommon-x11)
|
|
|
|
BuildRequires: pkgconfig(dee-1.0)
|
|
|
|
BuildRequires: pkgconfig(libavcodec)
|
|
|
|
BuildRequires: pkgconfig(libavformat)
|
|
|
|
BuildRequires: pkgconfig(libavutil)
|
|
|
|
BuildRequires: pkgconfig(liblzma)
|
2016-11-28 17:55:02 +01:00
|
|
|
BuildRequires: pkgconfig(libavfilter)
|
|
|
|
BuildRequires: pkgconfig(libavdevice)
|
2016-11-13 03:07:38 +01:00
|
|
|
BuildRequires: pkgconfig(libcrypto)
|
|
|
|
BuildRequires: pkgconfig(openssl)
|
|
|
|
BuildRequires: pkgconfig(libva)
|
|
|
|
BuildRequires: pkgconfig(fontconfig)
|
|
|
|
BuildRequires: pkgconfig(freetype2)
|
|
|
|
BuildRequires: pkgconfig(libva-glx)
|
|
|
|
BuildRequires: pkgconfig(libva-x11)
|
|
|
|
|
|
|
|
# Runtime requirements
|
|
|
|
Requires: ffmpeg
|
|
|
|
Requires: openssl
|
|
|
|
Requires: hicolor-icon-theme
|
|
|
|
Requires: icu
|
|
|
|
Requires: jasper
|
2016-11-13 05:46:56 +01:00
|
|
|
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Telegram Desktop app. A new era of messaging.
|
|
|
|
|
|
|
|
%prep
|
2017-03-20 20:53:42 +01:00
|
|
|
|
2016-11-13 03:07:38 +01:00
|
|
|
%setup -n tdesktop-%{version}
|
2017-01-12 20:55:36 +01:00
|
|
|
cp %{_sourcedir}/patch-%{version}.diff .
|
2016-11-13 03:07:38 +01:00
|
|
|
|
2017-03-20 20:53:42 +01:00
|
|
|
rm -rf %{_builddir}/tdesktop-%{version}/third_party/*
|
|
|
|
|
|
|
|
cp %{_sourcedir}/GSL-master.zip . && unzip GSL-master.zip
|
|
|
|
mv GSL-master GSL
|
|
|
|
mv GSL %{_builddir}/tdesktop-%{version}/third_party/
|
|
|
|
|
|
|
|
cp %{_sourcedir}/variant-master.zip . && unzip variant-master.zip
|
|
|
|
mv variant-master variant
|
|
|
|
mv variant %{_builddir}/tdesktop-%{version}/third_party/
|
|
|
|
|
2016-11-13 03:07:38 +01:00
|
|
|
%setup -T -c -n breakpad -b 1
|
2016-06-05 02:26:41 +02:00
|
|
|
%setup -T -c -n breakpad-lss -b 2
|
2016-11-13 03:07:38 +01:00
|
|
|
%setup -T -c -n gyp -b 3
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
%build
|
2017-03-20 20:53:42 +01:00
|
|
|
|
2016-11-13 04:26:16 +01:00
|
|
|
# generate patch
|
|
|
|
# git diff --relative-directory=./a a b
|
2016-06-05 02:26:41 +02:00
|
|
|
# Setup compiler variables
|
|
|
|
mv %{_builddir}/tdesktop-%{version} %{_builddir}/tdesktop
|
|
|
|
mkdir -p %{_builddir}/Libraries
|
|
|
|
|
2016-11-13 03:07:38 +01:00
|
|
|
# patch gyp
|
|
|
|
cd %{_builddir}/Libraries
|
|
|
|
ln -s %{_builddir}/gyp ./gyp
|
|
|
|
cp %{_builddir}/tdesktop/Telegram/Patches/gyp.diff ./gyp/
|
|
|
|
cd gyp
|
|
|
|
patch -p1 < ./gyp.diff
|
|
|
|
|
2016-06-05 02:26:41 +02:00
|
|
|
# Link with patched Qt Static Library
|
|
|
|
cd %{_builddir}/Libraries
|
2016-11-13 03:07:38 +01:00
|
|
|
ln -s /usr/lib64/libtelegram-qt5 ./QtStatic
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
# Build breakpad
|
|
|
|
cd %{_builddir}/Libraries
|
|
|
|
ln -s %{_builddir}/breakpad ./breakpad
|
|
|
|
cd breakpad
|
|
|
|
ln -s %{_builddir}/breakpad-lss ./src/third_party/lss
|
2016-11-13 06:34:30 +01:00
|
|
|
./configure
|
|
|
|
make
|
2016-06-05 02:26:41 +02:00
|
|
|
|
2016-11-13 05:46:56 +01:00
|
|
|
# patch with patch.diff
|
2016-11-13 03:07:38 +01:00
|
|
|
cd %{_builddir}/tdesktop
|
2017-01-12 20:55:36 +01:00
|
|
|
patch -p1 < patch-%{version}.diff
|
2016-11-13 03:07:38 +01:00
|
|
|
|
|
|
|
# use gyp to generate cmake files
|
|
|
|
cd %{_builddir}/tdesktop/Telegram/gyp
|
|
|
|
# patch qt.gypi to change libxkbcommon path
|
|
|
|
../../../Libraries/gyp/gyp \
|
|
|
|
-Dlinux_path_qt="%{_builddir}/Libraries/QtStatic" \
|
|
|
|
-Dqt_version="5.6.0" \
|
|
|
|
-Dlinux_lib_ssl=-lssl \
|
|
|
|
-Dlinux_lib_crypto=-lcrypto \
|
|
|
|
-Dlinux_lib_icu="-licuuc -licutu -licui18n" \
|
|
|
|
--depth=. --generator-output="../../" -Goutput_dir=out Telegram.gyp --format=cmake
|
|
|
|
|
|
|
|
# build Telegram
|
|
|
|
cd %{_builddir}/tdesktop/out/Release
|
2017-03-20 20:53:42 +01:00
|
|
|
cmake .
|
2016-06-05 02:26:41 +02:00
|
|
|
make
|
2016-11-13 03:07:38 +01:00
|
|
|
chrpath --delete Telegram
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
# Install binary
|
2016-11-13 03:07:38 +01:00
|
|
|
install -dm755 %{buildroot}/usr/bin
|
|
|
|
install -m755 %{_builddir}/tdesktop/out/Release/Telegram \
|
|
|
|
%{buildroot}/usr/bin/telegram-desktop
|
2016-06-05 02:26:41 +02:00
|
|
|
|
2016-11-13 05:46:56 +01:00
|
|
|
# Install desktop file
|
2016-11-13 03:07:38 +01:00
|
|
|
install -d %{buildroot}/usr/share/applications
|
2016-06-05 02:26:41 +02:00
|
|
|
desktop-file-install \
|
|
|
|
--dir %{buildroot}%{_datadir}/applications \
|
|
|
|
--add-category InstantMessaging \
|
|
|
|
%{_builddir}/tdesktop/lib/xdg/telegramdesktop.desktop
|
|
|
|
|
2016-11-13 05:46:56 +01:00
|
|
|
# Install protocol
|
2016-11-13 03:07:38 +01:00
|
|
|
install -d %{buildroot}/usr/share/kde4/services
|
2016-06-05 02:26:41 +02:00
|
|
|
install -m644 %{_builddir}/tdesktop/lib/xdg/tg.protocol \
|
2016-11-13 03:07:38 +01:00
|
|
|
%{buildroot}/usr/share/kde4/services/tg.protocol
|
2016-06-05 02:26:41 +02:00
|
|
|
|
2016-11-13 05:46:56 +01:00
|
|
|
# Install icons
|
2016-06-05 02:26:41 +02:00
|
|
|
for icon_size in 16 32 48 64 128 256 512; do
|
2016-11-13 03:07:38 +01:00
|
|
|
icon_dir="%{buildroot}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps"
|
2016-06-05 02:26:41 +02:00
|
|
|
install -d "${icon_dir}"
|
|
|
|
install -m644 "%{_builddir}/tdesktop/Telegram/Resources/art/icon${icon_size}.png" \
|
|
|
|
"${icon_dir}/telegram-desktop.png"
|
|
|
|
done
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr (-, root, root, -)
|
2016-11-13 03:07:38 +01:00
|
|
|
/usr/bin/telegram-desktop
|
|
|
|
/usr/share/applications/telegramdesktop.desktop
|
|
|
|
%dir /usr/share/kde4
|
|
|
|
%dir /usr/share/kde4/services
|
|
|
|
/usr/share/kde4/services/tg.protocol
|
|
|
|
/usr/share/icons/hicolor/*/apps/telegram-desktop.png
|