Dominique Leuenberger 2022-07-03 16:27:09 +00:00 committed by Git OBS Bridge
commit 3603259369
3 changed files with 44 additions and 6 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Sun Jul 3 12:21:10 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Add nextcloud-remove-fortify-source-2.patch
* A more future-proof and distribution friendly fix for
boo#1201070
* Upstream issue: gh#nextcloud/desktop#4697
-------------------------------------------------------------------
Fri Jul 1 11:08:59 UTC 2022 - ecsos <ecsos@opensuse.org>

View File

@ -29,6 +29,8 @@ Source: https://github.com/nextcloud/desktop/archive/v%{version}/%{name}
Source1: sysctl-sync-inotify.conf
# PATCH-FIX-OPENSUSE nextcloud-desktop-remove-datetime.patch sor.alexei@meowr.ru -- Remove __TIME__ and __DATE__.
Patch1: nextcloud-desktop-remove-datetime.patch
# PATCH-FIX-OPENSUSE nextcloud-remove-fortify-source-2.patch code@bnavigator.de -- Remove hardcoding of _FORTIFY_SOURCE=2 in order to not conflict with distribtion presets, boo#1201070, gh#nextcloud/desktop#4697
Patch2: nextcloud-remove-fortify-source-2.patch
BuildRequires: AppStream
BuildRequires: cmake >= 3.2
BuildRequires: extra-cmake-modules
@ -175,16 +177,11 @@ Dolphin filemanager to display overlay icons.
%endif
%prep
%setup -q -n desktop-%{version}
%patch1 -p1
%autosetup -p1 -n desktop-%{version}
cp -a %{SOURCE1} sysctl-sync-inotify.conf
%build
%if %{?suse_version} > 1500
CFLAGS="-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type"
%endif
%cmake \
%if 0%{?is_opensuse}
-DWITH_DOC=ON \

View File

@ -0,0 +1,33 @@
Index: desktop-3.5.1/cmake/modules/DefineCompilerFlags.cmake
===================================================================
--- desktop-3.5.1.orig/cmake/modules/DefineCompilerFlags.cmake
+++ desktop-3.5.1/cmake/modules/DefineCompilerFlags.cmake
@@ -45,15 +45,6 @@ if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
endif (WITH_STACK_PROTECTOR AND NOT WIN32)
- if (CMAKE_BUILD_TYPE)
- string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
- if (CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)")
- check_c_compiler_flag("-Wp,-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
- if (WITH_FORTIFY_SOURCE)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wp,-D_FORTIFY_SOURCE=2")
- endif (WITH_FORTIFY_SOURCE)
- endif()
- endif()
endif (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
if (UNIX AND NOT WIN32)
Index: desktop-3.5.1/src/CMakeLists.txt
===================================================================
--- desktop-3.5.1.orig/src/CMakeLists.txt
+++ desktop-3.5.1/src/CMakeLists.txt
@@ -32,8 +32,6 @@ if(NOT MSVC)
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
if(CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2")
endif()
if (CMAKE_CXX_COMPILER MATCHES "Clang")