From 60d15988f45fec1ea116d61c5c7c3d288c202d8f1cd7b29055ff812537c0303e Mon Sep 17 00:00:00 2001 From: Xu Zhao Date: Fri, 12 Apr 2024 16:01:20 +0000 Subject: [PATCH] Accepting request 1167068 from home:alarrosa:branches:openSUSE:Backports:SLE-15-SP6 - Rebase patch used in Backports: * 0002-use-bundled-rnnoise-expected-gsl-ranges-webrtc.patch - Fix duplicated Source3 when building in Backports - Define a use_system_rnnoise definition instead of checking the distribution version several times across the spec file. - Use the system rnnoise in 15.5 and 15.6 too since they have the same version as in Factory. - Use gcc12 when compiler_upgrade or compiler_downgrade are set - Set -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=ON only up to 15.5 . 15.6 should have recent libraries to enable dbus integration - Define BOOST_NO_STD_ALLOCATOR to fix a FTBFS in 15.6 OBS-URL: https://build.opensuse.org/request/show/1167068 OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=310 --- ...d-rnnoise-expected-gsl-ranges-webrtc.patch | 13 +++--- telegram-desktop.changes | 15 +++++++ telegram-desktop.spec | 42 +++++++++---------- 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/0002-use-bundled-rnnoise-expected-gsl-ranges-webrtc.patch b/0002-use-bundled-rnnoise-expected-gsl-ranges-webrtc.patch index 8b713a0..4116fbc 100644 --- a/0002-use-bundled-rnnoise-expected-gsl-ranges-webrtc.patch +++ b/0002-use-bundled-rnnoise-expected-gsl-ranges-webrtc.patch @@ -44,13 +44,14 @@ diff -rup a/cmake/external/rnnoise/CMakeLists.txt b/cmake/external/rnnoise/CMake if (WIN32) target_include_directories(external_rnnoise SYSTEM INTERFACE -@@ -40,9 +40,9 @@ elseif (APPLE) - else() - target_include_directories(external_rnnoise SYSTEM - INTERFACE -- /usr/local/include -+ ${libs_loc}/rnnoise/include +@@ -40,7 +40,11 @@ elseif (APPLE) + IMPORTED_LOCATION_DEBUG "${rnnoise_lib_loc}/Debug/librnnoise.a" ) + else() ++ target_include_directories(external_rnnoise SYSTEM ++ INTERFACE ++ ${libs_loc}/rnnoise/include ++ ) - find_library(DESKTOP_APP_RNNOISE_LIBRARIES librnnoise.a REQUIRED) + find_library(DESKTOP_APP_RNNOISE_LIBRARIES librnnoise.a HINTS "${rnnoise_lib_loc}" REQUIRED) set_target_properties(external_rnnoise PROPERTIES diff --git a/telegram-desktop.changes b/telegram-desktop.changes index 9d1e5fb..282c437 100644 --- a/telegram-desktop.changes +++ b/telegram-desktop.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Fri Apr 12 07:14:22 UTC 2024 - Antonio Larrosa + +- Rebase patch used in Backports: + * 0002-use-bundled-rnnoise-expected-gsl-ranges-webrtc.patch +- Fix duplicated Source3 when building in Backports +- Define a use_system_rnnoise definition instead of checking + the distribution version several times across the spec file. +- Use the system rnnoise in 15.5 and 15.6 too since they have + the same version as in Factory. +- Use gcc12 when compiler_upgrade or compiler_downgrade are set +- Set -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=ON only up to 15.5 . + 15.6 should have recent libraries to enable dbus integration +- Define BOOST_NO_STD_ALLOCATOR to fix a FTBFS in 15.6 + ------------------------------------------------------------------- Fri Apr 5 08:38:17 UTC 2024 - Manfred Hollstein diff --git a/telegram-desktop.spec b/telegram-desktop.spec index 19c5133..8be614e 100644 --- a/telegram-desktop.spec +++ b/telegram-desktop.spec @@ -23,11 +23,15 @@ %define __builder ninja -# gcc10 or higher is required +# gcc12 or higher is required %if 0%{?suse_version} && ( 0%{?suse_version} < 1500 || ( 0%{?is_opensuse} && 0%{?suse_version} == 1500 && 0%{?sle_version} && 0%{?sle_version} <= 150600 ) ) %bcond_without compiler_upgrade %endif +%if 0%{?suse_version} && 0%{?suse_version} > 01500 || (0%{?sle_version} && 0%{?sle_version} >= 150500) +%bcond_without use_system_rnnoise +%endif + %define _dwz_low_mem_die_limit 40000000 %define _dwz_max_die_limit 200000000 @@ -48,11 +52,11 @@ Source0: https://github.com/telegramdesktop/tdesktop/releases/download/v% Source1: tg_owt-packager.py Source2: tg_owt-packager.sh Source3: tg_owt-master.zip -%if 0%{?suse_version} > 01500 +%if %{with use_system_rnnoise} # PATCH-FIX-OPENSUSE Patch1: 0001-use-bundled-webrtc.patch %else -Source3: rnnoise-git20210122.tar.gz +Source4: rnnoise-git20210122.tar.gz # PATCH-FIX-OPENSUSE Patch1: 0002-use-bundled-rnnoise-expected-gsl-ranges-webrtc.patch %endif @@ -72,17 +76,12 @@ BuildRequires: cmake >= 3.16 BuildRequires: desktop-file-utils BuildRequires: enchant-devel BuildRequires: ffmpeg-devel -%if %{with compiler_upgrade} -BuildRequires: gcc10 -BuildRequires: gcc10-c++ -%else -%if %{with compiler_downgrade} +%if %{with compiler_upgrade} || %{with compiler_downgrade} BuildRequires: gcc12 BuildRequires: gcc12-c++ %else BuildRequires: gcc-c++ %endif -%endif BuildRequires: glibc-devel BuildRequires: libboost_program_options-devel BuildRequires: libboost_regex-devel @@ -171,7 +170,7 @@ BuildRequires: pkgconfig(portaudio-2.0) BuildRequires: pkgconfig(portaudiocpp) BuildRequires: pkgconfig(protobuf) # Use system rnnoise on TW, self-build on others -%if 0%{?suse_version} > 01500 +%if %{with use_system_rnnoise} BuildRequires: expect-devel BuildRequires: range-v3-devel BuildRequires: pkgconfig(gsl) @@ -225,8 +224,8 @@ The service also provides APIs to independent developers. mkdir ../Libraries # If not TW, unpack rnnoise source -%if 0%{?suse_version} <= 01500 -%setup -q -T -D -b 3 -n tdesktop-%{version}-full +%if %{without use_system_rnnoise} +%setup -q -T -D -b 4 -n tdesktop-%{version}-full mv ../rnnoise-git20210122 ../Libraries/rnnoise %endif @@ -235,21 +234,19 @@ unzip -q %{SOURCE3} mv tg_owt-master Libraries/tg_owt %build -%if %{with compiler_upgrade} -export CC=gcc-10 -export CXX=g++-10 -%else -%if %{with compiler_downgrade} +%if %{with compiler_upgrade} || %{with compiler_downgrade} export CC=gcc-12 export CXX=g++-12 %endif -%endif # Fix build failures due to not finding installed headers for xkbcommon and wayland-client -export CXXFLAGS+="`pkg-config --cflags xkbcommon wayland-client`" +export CXXFLAGS+="`pkg-config --cflags xkbcommon wayland-client` -DBOOST_NO_STD_ALLOCATOR" +%if 0%{?suse_version} == 1500 +export CXXFLAGS+=" -DBOOST_NO_STD_ALLOCATOR" +%endif # If not TW, build rnnoise -%if 0%{?suse_version} <= 01500 +%if %{without use_system_rnnoise} pushd %{_builddir}/Libraries/rnnoise ./autogen.sh %configure @@ -290,7 +287,7 @@ cd %{_builddir}/tdesktop-%{version}-full -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=ON \ -DDESKTOP_APP_USE_ENCHANT=ON \ %endif -%if 0%{?suse_version} && ( 0%{?suse_version} < 1500 || ( 0%{?is_opensuse} && 0%{?suse_version} == 1500 && 0%{?sle_version} && 0%{?sle_version} <= 150600 ) ) +%if 0%{?suse_version} && ( 0%{?suse_version} < 1500 || ( 0%{?is_opensuse} && 0%{?suse_version} == 1500 && 0%{?sle_version} && 0%{?sle_version} < 150600 ) ) -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=ON \ %endif -DTDESKTOP_API_ID=611335 \ @@ -302,13 +299,12 @@ cd %{_builddir}/tdesktop-%{version}-full -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON \ -DTDESKTOP_LAUNCHER_BASENAME=%{name} \ -DDESKTOP_APP_SPECIAL_TARGET="" - %cmake_build %install %cmake_install -%if 0%{?suse_version} > 01500 +%if 0%{?suse_version} > 01500 || ( 0%{?is_opensuse} && 0%{?suse_version} == 1500 && 0%{?sle_version} && 0%{?sle_version} >= 150600 ) appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.metainfo.xml %endif