1
0

Accepting request 505243 from home:badshah400:Telegram

Use gcc6 to fix building on Leap 42.2 and newer; add _constraints file to restrict building on hardware with at least 2 GB physical memory.

On Leap 42.2 gcc6 seems to be uninstallable from the main OSS repository, but the gcc6 = 6.2.1 from openSUSE:Leap:42.2:Update works, and telegram builds with it just fine

OBS-URL: https://build.opensuse.org/request/show/505243
OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=18
This commit is contained in:
Xu Zhao 2017-06-21 15:00:51 +00:00 committed by Git OBS Bridge
parent a03f364952
commit 02610a39cd
3 changed files with 31 additions and 0 deletions

7
_constraints Normal file
View File

@ -0,0 +1,7 @@
<constraints>
<hardware>
<physicalmemory>
<size unit="M">2048</size>
</physicalmemory>
</hardware>
</constraints>

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Jun 21 08:40:07 UTC 2017 - badshah400@gmail.com
- For openSUSE Leap, use gcc6 from the Update repository (gcc6
from OSS is uninstallable).
- Add a _constraints file to restrict building to hardware with at
2 GB of physical memory.
-------------------------------------------------------------------
Sun Jun 4 22:04:45 UTC 2017 - badshah400@gmail.com

View File

@ -37,7 +37,12 @@ BuildRequires: desktop-file-utils
BuildRequires: ffmpeg-devel
BuildRequires: fontconfig-devel
BuildRequires: freetype-devel
%if 0%{?suse_version} <= 1320
BuildRequires: gcc6-c++ >= 6.2
BuildRequires: libgcc_s1 >= 6.2
%else
BuildRequires: gcc-c++ >= 5.0
%endif
BuildRequires: libXfixes-devel
BuildRequires: libexpat-devel
BuildRequires: libjpeg-devel
@ -144,6 +149,10 @@ cd %{_builddir}/Libraries
ln -s %{_builddir}/breakpad ./breakpad
cd breakpad
ln -s %{_builddir}/breakpad-lss ./src/third_party/lss
%if 0%{?suse_version} <= 1320
export CXX='g++-6'
export GCC='gcc-6'
%endif
# FIXME: you should use the %%configure macro
./configure
make %{?_smp_mflags}
@ -157,6 +166,7 @@ patch -p1 < patch-%{version}.diff
cd %{_builddir}/tdesktop/Telegram/gyp
# patch qt.gypi to change libxkbcommon path
../../../Libraries/gyp/gyp \
-DCMAKE_CXX_COMPILER='g++-6' \
-Dlinux_path_qt="%{_builddir}/Libraries/QtStatic" \
-Dqt_version="5.6.0" \
-Dlinux_lib_ssl=-lssl \
@ -167,7 +177,13 @@ cd %{_builddir}/tdesktop/Telegram/gyp
# build Telegram
cd %{_builddir}/tdesktop/out/Release
# FIXME: you should use %%cmake macros
%if 0%{?suse_version} <= 1320
export CXX='g++-6'
export GCC='gcc-6'
CC=gcc-6 CXX=g++-6 cmake .
%else
cmake .
%endif
make %{?_smp_mflags}
chrpath --delete Telegram