2016-07-18 16:52:25 +02:00
|
|
|
#
|
|
|
|
# spec file for package telegram-desktop
|
|
|
|
#
|
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: telegram-desktop
|
|
|
|
Version: 0.9.56
|
|
|
|
Release: 0
|
|
|
|
Summary: A new era of messaging
|
|
|
|
License: GPL-3.0
|
|
|
|
Url: https://github.com/telegramdesktop/tdesktop
|
|
|
|
Source: https://github.com/telegramdesktop/tdesktop/archive/v%{version}.tar.gz
|
|
|
|
Source1: breakpad-refs-heads-master.tar.gz
|
|
|
|
Source2: linux-syscall-support-refs-heads-master.tar.gz
|
|
|
|
Source3: unity.h
|
|
|
|
BuildRequires: desktop-file-utils
|
|
|
|
BuildRequires: gcc5-c++
|
|
|
|
BuildRequires: hicolor-icon-theme
|
|
|
|
BuildRequires: libappindicator-devel
|
|
|
|
BuildRequires: libavdevice-devel
|
|
|
|
BuildRequires: libavfilter-devel
|
|
|
|
BuildRequires: libmng-devel
|
|
|
|
BuildRequires: libopus-devel
|
|
|
|
BuildRequires: libpng16-devel
|
|
|
|
BuildRequires: libtelegram-qt5-devel-static
|
|
|
|
BuildRequires: libtiff-devel
|
|
|
|
BuildRequires: libwebp-devel
|
|
|
|
BuildRequires: mtdev-devel
|
|
|
|
BuildRequires: openal-soft-devel
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: tslib-devel
|
|
|
|
BuildRequires: xcb-util-devel
|
|
|
|
BuildRequires: xcb-util-image-devel
|
|
|
|
BuildRequires: xcb-util-keysyms-devel
|
|
|
|
BuildRequires: xcb-util-renderutil-devel
|
|
|
|
BuildRequires: xcb-util-wm-devel
|
|
|
|
BuildRequires: xorg-x11-devel
|
|
|
|
BuildRequires: xz
|
|
|
|
BuildRequires: pkgconfig(dee-1.0)
|
|
|
|
BuildRequires: pkgconfig(glib-2.0)
|
|
|
|
BuildRequires: pkgconfig(gtk+-2.0)
|
|
|
|
BuildRequires: pkgconfig(libavcodec)
|
|
|
|
BuildRequires: pkgconfig(libavformat)
|
|
|
|
BuildRequires: pkgconfig(libavutil)
|
|
|
|
BuildRequires: pkgconfig(libcrypto)
|
|
|
|
BuildRequires: pkgconfig(liblzma)
|
|
|
|
BuildRequires: pkgconfig(libva)
|
|
|
|
BuildRequires: pkgconfig(libva-glx)
|
|
|
|
BuildRequires: pkgconfig(libva-x11)
|
|
|
|
BuildRequires: pkgconfig(libwebp)
|
|
|
|
BuildRequires: pkgconfig(openssl)
|
|
|
|
BuildRequires: pkgconfig(xkbcommon)
|
|
|
|
BuildRequires: pkgconfig(xkbcommon-x11)
|
2016-06-05 02:26:41 +02:00
|
|
|
# Runtime requirements
|
2016-07-18 16:52:25 +02:00
|
|
|
Requires: ffmpeg
|
|
|
|
Requires: hicolor-icon-theme
|
|
|
|
Requires: icu
|
|
|
|
Requires: jasper
|
|
|
|
Requires: openssl
|
|
|
|
Requires(post): desktop-file-utils
|
|
|
|
Requires(postun): desktop-file-utils
|
|
|
|
ExclusiveArch: x86_64
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Telegram Desktop app. A new era of messaging.
|
|
|
|
|
|
|
|
%prep
|
2016-07-18 16:52:25 +02:00
|
|
|
%setup -q -n tdesktop-%{version}
|
2016-06-05 02:26:41 +02:00
|
|
|
cp %{_sourcedir}/unity.h ./Telegram/SourceFiles/
|
|
|
|
sed -i 's/CUSTOM_API_ID//g' "./Telegram/Telegram.pro"
|
2016-07-18 16:52:25 +02:00
|
|
|
sed -i 's,LIBS += %{_prefix}/local/lib/libxkbcommon.a,,g' "./Telegram/Telegram.pro"
|
|
|
|
sed -i 's,LIBS += %{_prefix}/local/lib/libz.a,LIBS += -lz,g' "./Telegram/Telegram.pro"
|
2016-06-05 02:26:41 +02:00
|
|
|
sed -i 's,<unity/unity/unity\.h>,"unity.h",g' "./Telegram/SourceFiles/pspecific_linux.cpp"
|
2016-07-04 21:37:56 +02:00
|
|
|
sed -i 's,<unity/unity/unity\.h>,"unity.h",g' "./Telegram/SourceFiles/platform/linux/linux_libs.h"
|
2016-06-26 03:33:26 +02:00
|
|
|
sed -i 's/c++11/c++14/g' "./Telegram/Telegram.pro"
|
|
|
|
# sed -i "s,/usr/local/tdesktop/Qt-5.6.0,%{_builddir}/Libraries/QtStatic,g" "./Telegram/Telegram.pro"
|
|
|
|
# sed -i "s,5\.6\.0,5.6.0,g" "./Telegram/Telegram.pro"
|
|
|
|
|
2016-06-05 02:26:41 +02:00
|
|
|
(
|
|
|
|
echo "DEFINES += TDESKTOP_DISABLE_AUTOUPDATE"
|
|
|
|
echo "DEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
|
2016-07-18 16:52:25 +02:00
|
|
|
echo 'INCLUDEPATH += "%{_libdir}/glib-2.0/include"'
|
|
|
|
echo 'INCLUDEPATH += "%{_libdir}/gtk-2.0/include"'
|
|
|
|
echo 'INCLUDEPATH += "%{_includedir}/ffmpeg"'
|
|
|
|
echo 'INCLUDEPATH += "%{_includedir}/libdbusmenu-glib-0.4"'
|
|
|
|
echo 'INCLUDEPATH += "%{_includedir}/opus"'
|
2016-06-05 02:26:41 +02:00
|
|
|
echo 'LIBS += -lcrypto -lssl -lqwebp -lwebp'
|
|
|
|
) >> "./Telegram/Telegram.pro"
|
|
|
|
|
2016-07-18 16:52:25 +02:00
|
|
|
%setup -T -c -n breakpad -b 1
|
2016-06-05 02:26:41 +02:00
|
|
|
%setup -T -c -n breakpad-lss -b 2
|
|
|
|
|
|
|
|
%build
|
|
|
|
# Setup compiler variables
|
|
|
|
export CC="gcc-5"
|
|
|
|
export CXX="g++-5"
|
|
|
|
export AR="gcc-ar-5"
|
|
|
|
mv %{_builddir}/tdesktop-%{version} %{_builddir}/tdesktop
|
|
|
|
mkdir -p %{_builddir}/Libraries
|
|
|
|
|
|
|
|
# Link with patched Qt Static Library
|
|
|
|
cd %{_builddir}/Libraries
|
2016-07-18 16:52:25 +02:00
|
|
|
ln -s %{_libdir}/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
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
|
2016-07-18 16:52:25 +02:00
|
|
|
export PATH="%{_libdir}/libtelegram-qt5/bin/:$PATH"
|
2016-06-26 03:33:26 +02:00
|
|
|
|
2016-06-05 02:26:41 +02:00
|
|
|
# Build codegen_style
|
2016-07-04 21:37:56 +02:00
|
|
|
mkdir -p "%{_builddir}/tdesktop/Linux/obj/codegen_style/Release"
|
|
|
|
cd %{_builddir}/tdesktop/Linux/obj/codegen_style/Release
|
2016-06-05 02:26:41 +02:00
|
|
|
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \
|
2016-06-26 03:33:26 +02:00
|
|
|
QT_TDESKTOP_VERSION="5.6.0" \
|
|
|
|
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
|
2016-07-04 21:37:56 +02:00
|
|
|
CONFIG+=release ../../../../Telegram/build/qmake/codegen_style/codegen_style.pro
|
2016-06-05 02:26:41 +02:00
|
|
|
make
|
|
|
|
|
|
|
|
# Build codegen_numbers
|
2016-07-04 21:37:56 +02:00
|
|
|
mkdir -p "%{_builddir}/tdesktop/Linux/obj/codegen_numbers/Release"
|
|
|
|
cd %{_builddir}/tdesktop/Linux/obj/codegen_numbers/Release
|
2016-06-05 02:26:41 +02:00
|
|
|
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \
|
2016-06-26 03:33:26 +02:00
|
|
|
QT_TDESKTOP_VERSION="5.6.0" \
|
|
|
|
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
|
2016-07-04 21:37:56 +02:00
|
|
|
CONFIG+=release ../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro
|
2016-06-05 02:26:41 +02:00
|
|
|
make
|
|
|
|
|
|
|
|
# Build MetaLang
|
2016-07-04 21:37:56 +02:00
|
|
|
mkdir -p "%{_builddir}/tdesktop/Linux/ReleaseIntermediateLang"
|
|
|
|
cd %{_builddir}/tdesktop/Linux/ReleaseIntermediateLang
|
2016-06-05 02:26:41 +02:00
|
|
|
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \
|
2016-06-26 03:33:26 +02:00
|
|
|
QT_TDESKTOP_VERSION="5.6.0" \
|
|
|
|
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
|
2016-07-04 21:37:56 +02:00
|
|
|
CONFIG+=release "../../Telegram/MetaLang.pro"
|
2016-06-05 02:26:41 +02:00
|
|
|
make
|
|
|
|
|
|
|
|
# Build Telegram Desktop
|
|
|
|
mkdir -p "%{_builddir}/tdesktop/Linux/ReleaseIntermediate"
|
|
|
|
cd %{_builddir}/tdesktop/Linux/ReleaseIntermediate
|
2016-07-04 21:37:56 +02:00
|
|
|
./../codegen/Release/codegen_style "-I./../../Telegram/Resources" "-I./../../Telegram/SourceFiles" "-o./../../Telegram/GeneratedFiles/styles" all_files.style --rebuild
|
|
|
|
./../codegen/Release/codegen_numbers "-o./../../Telegram/GeneratedFiles" "./../../Telegram/Resources/numbers.txt"
|
|
|
|
./../ReleaseLang/MetaLang -lang_in ./../../Telegram/Resources/langs/lang.strings -lang_out ./../../Telegram/GeneratedFiles/lang_auto
|
2016-06-05 02:26:41 +02:00
|
|
|
|
2016-06-26 03:33:26 +02:00
|
|
|
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" CONFIG+=release \
|
|
|
|
QT_TDESKTOP_VERSION="5.6.0" \
|
|
|
|
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
|
|
|
|
"../../Telegram/Telegram.pro"
|
2016-06-05 02:26:41 +02:00
|
|
|
make
|
|
|
|
|
|
|
|
%install
|
|
|
|
# Install binary
|
2016-07-18 16:52:25 +02:00
|
|
|
install -dm755 %{buildroot}%{_prefix}/bin
|
2016-06-05 02:26:41 +02:00
|
|
|
install -m755 %{_builddir}/tdesktop/Linux/Release/Telegram \
|
2016-07-18 16:52:25 +02:00
|
|
|
%{buildroot}%{_bindir}/telegram-desktop
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
# Install desktop file
|
2016-07-18 16:52:25 +02:00
|
|
|
install -d %{buildroot}%{_datadir}/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
|
|
|
|
|
|
|
|
# Install protocol
|
2016-07-18 16:52:25 +02:00
|
|
|
install -d %{buildroot}%{_datadir}/kde4/services
|
2016-06-05 02:26:41 +02:00
|
|
|
install -m644 %{_builddir}/tdesktop/lib/xdg/tg.protocol \
|
2016-07-18 16:52:25 +02:00
|
|
|
%{buildroot}%{_datadir}/kde4/services/tg.protocol
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
# Install icons
|
|
|
|
for icon_size in 16 32 48 64 128 256 512; do
|
2016-07-18 16:52:25 +02:00
|
|
|
icon_dir="%{buildroot}%{_datadir}/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
|
|
|
|
|
2016-07-18 16:52:25 +02:00
|
|
|
%post
|
|
|
|
%desktop_database_post
|
|
|
|
%icon_theme_cache_post
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%desktop_database_postun
|
|
|
|
%icon_theme_cache_postun
|
2016-06-05 02:26:41 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr (-, root, root, -)
|
2016-07-18 16:52:25 +02:00
|
|
|
%{_bindir}/telegram-desktop
|
|
|
|
%{_datadir}/applications/telegramdesktop.desktop
|
|
|
|
%dir %{_datadir}/kde4
|
|
|
|
%dir %{_datadir}/kde4/services
|
|
|
|
%{_datadir}/kde4/services/tg.protocol
|
|
|
|
%{_datadir}/icons/hicolor/*/apps/telegram-desktop.png
|
|
|
|
|
|
|
|
%changelog
|