summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-02-08 04:22:21 +0000
committerSam James <sam@gentoo.org>2023-02-08 04:22:22 +0000
commit992d3f3d35158fa1deaf87e928a030bcd1be6905 (patch)
tree9b4dc14e3df0e18a5bbbeaa32089eaa3ee965f3d /net-misc
parentdev-libs/rocr-runtime: NDEBUG by default; add debug use flag (diff)
downloadgentoo-992d3f3d35158fa1deaf87e928a030bcd1be6905.tar.gz
gentoo-992d3f3d35158fa1deaf87e928a030bcd1be6905.tar.bz2
gentoo-992d3f3d35158fa1deaf87e928a030bcd1be6905.zip
net-misc/nextcloud-client: don't redefine _FORTIFY_SOURCE
Fixes build on hardened. We already set F_S w/ level 2 as minimum even on non- hardened. Closes: https://bugs.gentoo.org/890072 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/nextcloud-client/files/nextcloud-client-3.6.6-no-redefine-fortify-source.patch31
-rw-r--r--net-misc/nextcloud-client/nextcloud-client-3.6.6.ebuild4
2 files changed, 35 insertions, 0 deletions
diff --git a/net-misc/nextcloud-client/files/nextcloud-client-3.6.6-no-redefine-fortify-source.patch b/net-misc/nextcloud-client/files/nextcloud-client-3.6.6-no-redefine-fortify-source.patch
new file mode 100644
index 000000000000..2c3d23c1ff35
--- /dev/null
+++ b/net-misc/nextcloud-client/files/nextcloud-client-3.6.6-no-redefine-fortify-source.patch
@@ -0,0 +1,31 @@
+Gentoo's toolchain always sets F_S (level 2 at minimum) by default.
+
+https://bugs.gentoo.org/890072
+--- a/cmake/modules/DefineCompilerFlags.cmake
++++ b/cmake/modules/DefineCompilerFlags.cmake
+@@ -47,12 +47,6 @@ if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
+
+ if (CMAKE_BUILD_TYPE)
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+- if (CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)" AND (NOT ${CMAKE_C_FLAGS} MATCHES "FORTIFY_SOURCE=[3-9]"))
+- 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)")
+
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -31,10 +31,6 @@ if(NOT MSVC)
+ endif()
+
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+- if(CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)" AND ((NOT ${CMAKE_C_FLAGS} MATCHES "FORTIFY_SOURCE=[3-9]") AND (NOT ${CMAKE_CXX_FLAGS} MATCHES "FORTIFY_SOURCE=[3-9]")))
+- 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")
+ # Calling Qt's qCWarning(category, ...) with no params for "..." is a GNU
diff --git a/net-misc/nextcloud-client/nextcloud-client-3.6.6.ebuild b/net-misc/nextcloud-client/nextcloud-client-3.6.6.ebuild
index 8496954d4804..943bb9b77797 100644
--- a/net-misc/nextcloud-client/nextcloud-client-3.6.6.ebuild
+++ b/net-misc/nextcloud-client/nextcloud-client-3.6.6.ebuild
@@ -61,6 +61,10 @@ BDEPEND="
dolphin? ( kde-frameworks/extra-cmake-modules )
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.6.6-no-redefine-fortify-source.patch
+)
+
src_prepare() {
# Keep tests in ${T}
sed -i -e "s#\"/tmp#\"${T}#g" test/test*.cpp || die