telegram/telegram.spec

214 lines
6.3 KiB
RPMSpec

%define qt_ver 5.6.2
%define qt_patchver %(echo %qt_ver | tr . _)
%define qt_majver %(echo %qt_ver | cut -d. -f1-2)
Name: telegram
Version: 1.1.23
Release: 1mamba
Summary: The official desktop client for the Telegram messenger
Group: Graphical Desktop/Applications/Internet
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://telegram.org/
## GITSOURCE https://github.com/telegramdesktop/tdesktop.git v0.9.32
Source: https://github.com/telegramdesktop/tdesktop.git/v%{version}/tdesktop-%{version}.tar.bz2
Source1: telegramdesktop.desktop
Source2: tg.protocol
Source3: http://download.qt-project.org/official_releases/qt/%{qt_majver}/%{qt_ver}/submodules/qtbase-opensource-src-%{qt_ver}.tar.xz
Source4: http://download.qt-project.org/official_releases/qt/%{qt_majver}/%{qt_ver}/submodules/qtimageformats-opensource-src-%{qt_ver}.tar.xz
Source5: http://download.qt-project.org/official_releases/qt/%{qt_majver}/%{qt_ver}/submodules/qtwayland-opensource-src-%{qt_ver}.tar.xz
Patch0: telegram-0.10.6-disable-unity.patch
Patch1: telegram-1.1.23-fix-build.patch
Patch2: telegram-1.1.23-libtgvoip-fixes.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libICE-devel
BuildRequires: libSM-devel
BuildRequires: libX11-devel
BuildRequires: libXext-devel
BuildRequires: libXi-devel
BuildRequires: libavcodec-ffmpeg-devel
BuildRequires: libavformat-ffmpeg-devel
BuildRequires: libavutil-ffmpeg-devel
BuildRequires: libdbus-devel
BuildRequires: libexpat-devel
BuildRequires: libfontconfig-devel
BuildRequires: libfreetype-devel
BuildRequires: libgcc
BuildRequires: libglib-devel
BuildRequires: libharfbuzz-devel
BuildRequires: libicu-devel
BuildRequires: libjpeg-devel
BuildRequires: liblzma-devel
BuildRequires: libopenal-devel
BuildRequires: libopenssl-devel
BuildRequires: libopus-devel
BuildRequires: libpcre-devel
BuildRequires: libpng-devel
BuildRequires: libproxy-devel
BuildRequires: libswresample-ffmpeg-devel
BuildRequires: libswscale-ffmpeg-devel
BuildRequires: libva-devel
BuildRequires: libwebp-devel
BuildRequires: libxcb-devel
BuildRequires: libxcb-image-devel
BuildRequires: libxcb-keysyms-devel
BuildRequires: libxcb-render-util-devel
BuildRequires: libxcb-util-wm-devel
BuildRequires: libxkbcommon-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
BuildRequires: libbreakpad-devel
BuildRequires: libunity-devel
Requires: kconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The official desktop client for the Telegram messenger.
%debug_package
%prep
%setup -q -c -a0 -a3 -a4 -a5
#% setup -q -c -D -T
#:<< _EOF
git clone https://chromium.googlesource.com/external/gyp gyp
mkdir -p Libraries/qt%{qt_ver}
mv qtbase-opensource-src-%{qt_ver} Libraries/qt%{qt_ver}/qtbase
mv qtimageformats-opensource-src-%{qt_ver} Libraries/qt%{qt_ver}/qtimageformats
mv qtwayland-opensource-src-%{qt_ver} Libraries/qt%{qt_ver}/qtwayland
cd Libraries/qt%{qt_ver}/qtbase
patch -p1 < ../../../tdesktop-%{version}/Telegram/Patches/qtbase_%{qt_patchver}.diff
cd ../../..
cd gyp
git apply ../tdesktop-%{version}/Telegram/Patches/gyp.diff
cd ..
ln -s ../gyp Libraries/gyp
mkdir -p Libraries/cmake-3.6.2/bin
ln -s %{_bindir}/cmake Libraries/cmake-3.6.2/bin/cmake
cd tdesktop-%{version}
%patch1 -p1
cd Telegram/ThirdParty
git clone https://github.com/telegramdesktop/libtgvoip.git
git clone https://github.com/Microsoft/GSL.git
git clone https://github.com/mapbox/variant.git
git clone https://github.com/philsquared/Catch.git
cd libtgvoip
%patch2 -p1
cd ../../..
%build
# Build patched Qt
cd Libraries/qt%{qt_ver}/qtbase
./configure \
-prefix "%{_builddir}/telegram-%{version}/qt" \
-release \
-force-debug-info \
-opensource \
-confirm-license \
-system-zlib \
-system-libpng \
-system-libjpeg \
-system-freetype \
-system-harfbuzz \
-system-pcre \
-system-xcb \
-system-xkbcommon-x11 \
-no-gtkstyle \
-static \
-nomake examples \
-nomake tests
#-no-opengl
%make
#module-qtbase module-qtimageformats
make install
# also add /usr/bin to disable icecc
export PATH="%{_builddir}/telegram-%{version}/qt/bin:/usr/bin:$PATH"
cd ../qtimageformats
qmake .
%make
make install
cd ../qtwayland
qmake .
%make
make install
cd ../../../tdesktop-%{version}/Telegram
gyp/refresh.sh
# Build Telegram Desktop
cd gyp
../../../Libraries/gyp/gyp \
-Dlinux_path_qt="%{_builddir}/%{name}-%{version}/qt" \
-Dlinux_lib_icu="-licuuc -licutu -licui18n" \
-Dlinux_lib_ssl='-L%{_libdir}/openssl-1.0.1 -lssl' \
-Dlinux_lib_crypto='-L%{_libdir}/openssl-1.0.1 -lcrypto' \
-Dlinux_path_opus_include="%{_includedir}/opus" \
--depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=cmake
cd %{_builddir}/%{name}-%{version}/tdesktop-%{version}/out/Release
cmake .
make
chrpath --delete Telegram
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
cd tdesktop-%{version}
install -D -m755 out/Release/Telegram %{buildroot}%{_bindir}/telegram-desktop
install -D -m644 %{SOURCE1} %{buildroot}%{_datadir}/applications/telegram-desktop.desktop
install -D -m644 %{SOURCE2} %{buildroot}%{_kde4_servicesdir}/tg.protocol
for icon_size in 16 32 48 64 128 256 512; do
icon_dir="%{buildroot}%{_datadir}/icons/hicolor/${icon_size}x${icon_size}/apps"
install -D -m644 Telegram/Resources/art/icon${icon_size}.png $icon_dir/telegram-desktop.png
done
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_kde4_servicesdir}/tg.protocol
%{_bindir}/telegram-desktop
%{_datadir}/applications/telegram-desktop.desktop
%{_datadir}/icons/hicolor/*/apps/telegram-desktop.png
%doc tdesktop-%{version}/LICENSE
%changelog
* Fri Oct 27 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.23-1mamba
- update to 1.1.23
* Tue Sep 13 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.10.6-1mamba
- update to 0.10.6
* Tue Mar 29 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-3mamba
- rebuilt (for latest ffmpeg deps on x86_64)
* Wed Mar 16 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-2mamba
- fix build tree organization
* Wed Mar 16 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-1mamba
- update to 0.9.33
* Tue Mar 15 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.32-1mamba
- package created using the webbuild interface