Name: telegram-desktop Summary: A new era of messaging Version: 0.9.56 Release: 1 License: GPL-3.0 URL: https://github.com/telegramdesktop/tdesktop Source: tdesktop-%{version}.tar.gz Source1: breakpad-refs-heads-master.tar.gz Source2: linux-syscall-support-refs-heads-master.tar.gz Source3: unity.h ExclusiveArch: x86_64 BuildRequires: libtelegram-qt5-devel-static BuildRequires: gcc5-c++ BuildRequires: libappindicator-devel BuildRequires: libpng16-devel BuildRequires: libtiff-devel BuildRequires: libmng-devel BuildRequires: libwebp-devel BuildRequires: pkgconfig(libwebp) BuildRequires: libopus-devel BuildRequires: xorg-x11-devel BuildRequires: xz BuildRequires: openal-soft-devel BuildRequires: xcb-util-wm-devel BuildRequires: xcb-util-devel BuildRequires: xcb-util-image-devel BuildRequires: xcb-util-renderutil-devel BuildRequires: xcb-util-keysyms-devel BuildRequires: mtdev-devel BuildRequires: tslib-devel BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(xkbcommon-x11) BuildRequires: pkgconfig(dee-1.0) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavformat) BuildRequires: pkgconfig(libavutil) BuildRequires: pkgconfig(liblzma) BuildRequires: libavfilter-devel BuildRequires: libavdevice-devel BuildRequires: pkgconfig(libcrypto) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(libva) BuildRequires: pkgconfig(libva-glx) BuildRequires: pkgconfig(libva-x11) BuildRequires: desktop-file-utils # Runtime requirements Requires: ffmpeg Requires: openssl Requires: hicolor-icon-theme Requires: icu Requires: jasper %description Telegram Desktop app. A new era of messaging. %prep %setup -n tdesktop-%{version} cp %{_sourcedir}/unity.h ./Telegram/SourceFiles/ sed -i 's/CUSTOM_API_ID//g' "./Telegram/Telegram.pro" sed -i 's,LIBS += /usr/local/lib/libxkbcommon.a,,g' "./Telegram/Telegram.pro" sed -i 's,LIBS += /usr/local/lib/libz.a,LIBS += -lz,g' "./Telegram/Telegram.pro" sed -i 's,,"unity.h",g' "./Telegram/SourceFiles/pspecific_linux.cpp" sed -i 's,,"unity.h",g' "./Telegram/SourceFiles/platform/linux/linux_libs.h" 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" ( echo "DEFINES += TDESKTOP_DISABLE_AUTOUPDATE" echo "DEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" echo 'INCLUDEPATH += "/usr/lib64/glib-2.0/include"' echo 'INCLUDEPATH += "/usr/lib64/gtk-2.0/include"' echo 'INCLUDEPATH += "/usr/include/ffmpeg"' echo 'INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4"' echo 'INCLUDEPATH += "/usr/include/opus"' echo 'LIBS += -lcrypto -lssl -lqwebp -lwebp' ) >> "./Telegram/Telegram.pro" %setup -T -c -n breakpad -b 1 %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 ln -s /usr/lib64/libtelegram-qt5 ./QtStatic # Build breakpad cd %{_builddir}/Libraries ln -s %{_builddir}/breakpad ./breakpad cd breakpad ln -s %{_builddir}/breakpad-lss ./src/third_party/lss ./configure make export PATH="/usr/lib64/libtelegram-qt5/bin/:$PATH" # Build codegen_style mkdir -p "%{_builddir}/tdesktop/Linux/obj/codegen_style/Release" cd %{_builddir}/tdesktop/Linux/obj/codegen_style/Release qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \ QT_TDESKTOP_VERSION="5.6.0" \ QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \ CONFIG+=release ../../../../Telegram/build/qmake/codegen_style/codegen_style.pro make # Build codegen_numbers mkdir -p "%{_builddir}/tdesktop/Linux/obj/codegen_numbers/Release" cd %{_builddir}/tdesktop/Linux/obj/codegen_numbers/Release qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \ QT_TDESKTOP_VERSION="5.6.0" \ QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \ CONFIG+=release ../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro make # Build MetaLang mkdir -p "%{_builddir}/tdesktop/Linux/ReleaseIntermediateLang" cd %{_builddir}/tdesktop/Linux/ReleaseIntermediateLang qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \ QT_TDESKTOP_VERSION="5.6.0" \ QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \ CONFIG+=release "../../Telegram/MetaLang.pro" make # Build Telegram Desktop mkdir -p "%{_builddir}/tdesktop/Linux/ReleaseIntermediate" cd %{_builddir}/tdesktop/Linux/ReleaseIntermediate ./../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 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" make %install # Install binary install -dm755 %{buildroot}/usr/bin install -m755 %{_builddir}/tdesktop/Linux/Release/Telegram \ %{buildroot}/usr/bin/telegram-desktop # Install desktop file install -d %{buildroot}/usr/share/applications desktop-file-install \ --dir %{buildroot}%{_datadir}/applications \ --add-category InstantMessaging \ %{_builddir}/tdesktop/lib/xdg/telegramdesktop.desktop # Install protocol install -d %{buildroot}/usr/share/kde4/services install -m644 %{_builddir}/tdesktop/lib/xdg/tg.protocol \ %{buildroot}/usr/share/kde4/services/tg.protocol # Install icons for icon_size in 16 32 48 64 128 256 512; do icon_dir="%{buildroot}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps" install -d "${icon_dir}" install -m644 "%{_builddir}/tdesktop/Telegram/Resources/art/icon${icon_size}.png" \ "${icon_dir}/telegram-desktop.png" done %clean rm -rf %{buildroot} %files %defattr (-, root, root, -) /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