Mageia Bugzilla – Attachment 12879 Details for
Bug 29043
nextcloud-client update to 3.3.3 (fixes CVE-2021-22895 and CVE-2021-32728)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
fix-build.patch
nextcloud-client-3.2.4-fix-build.patch (text/plain), 5.45 KB, created by
Sander Lepik
on 2021-07-30 17:45:15 CEST
(
hide
)
Description:
fix-build.patch
Filename:
MIME Type:
Creator:
Sander Lepik
Created:
2021-07-30 17:45:15 CEST
Size:
5.45 KB
patch
obsolete
>From 3bc66bea665e08d7e2efcdf15256a4dc135934a9 Mon Sep 17 00:00:00 2001 >From: Nicolas Fella <nicolas.fella@gmx.de> >Date: Thu, 1 Apr 2021 21:08:46 +0200 >Subject: [PATCH] Improve Inotify cmake code > >Use the FindInotify from ECM. It handles the case of Linux vs BSD >correctly automatically. > >Also only find Inotify on Linux and BSD > >Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de> >--- > CMakeLists.txt | 4 +- > cmake/modules/FindINotify.cmake | 84 +++++++++++++++++++++++---------- > src/libsync/CMakeLists.txt | 13 ++--- > 3 files changed, 62 insertions(+), 39 deletions(-) > >diff --git a/CMakeLists.txt b/CMakeLists.txt >index 062ebddd9c..edd14a1dc1 100644 >--- a/CMakeLists.txt >+++ b/CMakeLists.txt >@@ -187,10 +187,8 @@ if(BUILD_CLIENT) > find_package(Sparkle) > endif() > >- if(UNIX) >+ if(UNIX AND NOT APPLE) > find_package(INotify REQUIRED) >- else() >- find_package(INotify) > endif() > find_package(Sphinx) > find_package(PdfLatex) >diff --git a/cmake/modules/FindINotify.cmake b/cmake/modules/FindINotify.cmake >index 736e3dce42..8b0f8510c0 100644 >--- a/cmake/modules/FindINotify.cmake >+++ b/cmake/modules/FindINotify.cmake >@@ -1,30 +1,62 @@ >-# (c) 2014 Copyright ownCloud GmbH >-# Redistribution and use is allowed according to the terms of the BSD license. >-# For details see the accompanying COPYING* file. >+#.rst: >+# FindInotify >+# -------------- >+# >+# Try to find inotify on this system. This finds: >+# - libinotify on Unix like systems, or >+# - the kernel's inotify on Linux systems. >+# >+# This will define the following variables: >+# >+# ``Inotify_FOUND`` >+# True if inotify is available >+# ``Inotify_LIBRARIES`` >+# This has to be passed to target_link_libraries() >+# ``Inotify_INCLUDE_DIRS`` >+# This has to be passed to target_include_directories() >+# >+# On Linux, the libraries and include directories are empty, >+# even though ``Inotify_FOUND`` may be set to TRUE. This is because >+# no special includes or libraries are needed. On other systems >+# these may be needed to use inotify. >+# >+# Since 5.32.0. > >-# This module defines >-# INOTIFY_INCLUDE_DIR, where to find inotify.h, etc. >-# INOTIFY_LIBRARY_DIR, the directory holding the inotify library. >-# INOTIFY_FOUND, If false, do not try to use inotify. >-# also defined, but not for general use are >-# INOTIFY_LIBRARY, where to find the inotify library. >+#============================================================================= >+# SPDX-FileCopyrightText: 2016 Tobias C. Berner <tcberner@FreeBSD.org> >+# SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org> >+# >+# SPDX-License-Identifier: BSD-2-Clause >+#============================================================================= > >-find_path(INOTIFY_INCLUDE_DIR sys/inotify.h >- PATH_SUFFIXES inotify) >-mark_as_advanced(INOTIFY_INCLUDE_DIR) >+find_path(Inotify_INCLUDE_DIRS sys/inotify.h) > >-find_library(INOTIFY_LIBRARY inotify PATH_SUFFIXES lib/inotify) >- >-get_filename_component(INOTIFY_LIBRARY_DIR ${INOTIFY_LIBRARY} PATH) >-mark_as_advanced(INOTIFY_LIBRARY_DIR) >- >-# all listed variables are TRUE >-# handle the QUIETLY and REQUIRED arguments and set INOTIFY_FOUND to TRUE if >-include(FindPackageHandleStandardArgs) >-find_package_handle_standard_args(INOTIFY DEFAULT_MSG INOTIFY_INCLUDE_DIR INOTIFY_LIBRARY_DIR) >- >-IF(INOTIFY_FOUND) >- SET(INotify_INCLUDE_DIRS ${INOTIFY_INCLUDE_DIR}) >- SET(INotify_LIBRARY_DIRS ${INOTIFY_LIBRARY_DIR}) >-ENDIF(INOTIFY_FOUND) >+if(Inotify_INCLUDE_DIRS) >+# On Linux there is no library to link against, on the BSDs there is. >+# On the BSD's, inotify is implemented through a library, libinotify. >+ if( CMAKE_SYSTEM_NAME MATCHES "Linux") >+ set(Inotify_FOUND TRUE) >+ set(Inotify_LIBRARIES "") >+ set(Inotify_INCLUDE_DIRS "") >+ else() >+ find_library(Inotify_LIBRARIES NAMES inotify) >+ include(FindPackageHandleStandardArgs) >+ find_package_handle_standard_args(Inotify >+ FOUND_VAR >+ Inotify_FOUND >+ REQUIRED_VARS >+ Inotify_LIBRARIES >+ Inotify_INCLUDE_DIRS >+ ) >+ mark_as_advanced(Inotify_LIBRARIES Inotify_INCLUDE_DIRS) >+ include(FeatureSummary) >+ set_package_properties(Inotify PROPERTIES >+ URL "https://github.com/libinotify-kqueue/" >+ DESCRIPTION "inotify API on the *BSD family of operating systems." >+ ) >+ endif() >+else() >+ set(Inotify_FOUND FALSE) >+endif() > >+mark_as_advanced(Inotify_LIBRARIES Inotify_INCLUDE_DIRS) >diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt >index 32ebed87ce..dad4eba106 100644 >--- a/src/libsync/CMakeLists.txt >+++ b/src/libsync/CMakeLists.txt >@@ -11,12 +11,6 @@ if ( APPLE ) > ) > endif() > >-IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD") >- list(APPEND OS_SPECIFIC_LINK_LIBRARIES >- inotify >- ) >-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD") >- > set(libsync_SRCS > account.cpp > pushnotifications.cpp >@@ -135,10 +129,9 @@ if (NOT TOKEN_AUTH_ONLY) > target_link_libraries(${synclib_NAME} PUBLIC Qt5::Widgets Qt5::Svg qt5keychain) > endif() > >-if(INOTIFY_FOUND) >- target_include_directories(${synclib_NAME} PRIVATE ${INOTIFY_INCLUDE_DIR}) >- link_directories(${INOTIFY_LIBRARY_DIR}) >- target_link_libraries(${synclib_NAME} ${INOTIFY_LIBRARY} ) >+if(Inotify_FOUND) >+ target_include_directories(${synclib_NAME} PRIVATE ${Inotify_INCLUDE_DIRS}) >+ target_link_libraries(${synclib_NAME} PUBLIC ${Inotify_LIBRARIES}) > endif() > > GENERATE_EXPORT_HEADER( ${synclib_NAME}
From 3bc66bea665e08d7e2efcdf15256a4dc135934a9 Mon Sep 17 00:00:00 2001 From: Nicolas Fella <nicolas.fella@gmx.de> Date: Thu, 1 Apr 2021 21:08:46 +0200 Subject: [PATCH] Improve Inotify cmake code Use the FindInotify from ECM. It handles the case of Linux vs BSD correctly automatically. Also only find Inotify on Linux and BSD Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de> --- CMakeLists.txt | 4 +- cmake/modules/FindINotify.cmake | 84 +++++++++++++++++++++++---------- src/libsync/CMakeLists.txt | 13 ++--- 3 files changed, 62 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 062ebddd9c..edd14a1dc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,10 +187,8 @@ if(BUILD_CLIENT) find_package(Sparkle) endif() - if(UNIX) + if(UNIX AND NOT APPLE) find_package(INotify REQUIRED) - else() - find_package(INotify) endif() find_package(Sphinx) find_package(PdfLatex) diff --git a/cmake/modules/FindINotify.cmake b/cmake/modules/FindINotify.cmake index 736e3dce42..8b0f8510c0 100644 --- a/cmake/modules/FindINotify.cmake +++ b/cmake/modules/FindINotify.cmake @@ -1,30 +1,62 @@ -# (c) 2014 Copyright ownCloud GmbH -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING* file. +#.rst: +# FindInotify +# -------------- +# +# Try to find inotify on this system. This finds: +# - libinotify on Unix like systems, or +# - the kernel's inotify on Linux systems. +# +# This will define the following variables: +# +# ``Inotify_FOUND`` +# True if inotify is available +# ``Inotify_LIBRARIES`` +# This has to be passed to target_link_libraries() +# ``Inotify_INCLUDE_DIRS`` +# This has to be passed to target_include_directories() +# +# On Linux, the libraries and include directories are empty, +# even though ``Inotify_FOUND`` may be set to TRUE. This is because +# no special includes or libraries are needed. On other systems +# these may be needed to use inotify. +# +# Since 5.32.0. -# This module defines -# INOTIFY_INCLUDE_DIR, where to find inotify.h, etc. -# INOTIFY_LIBRARY_DIR, the directory holding the inotify library. -# INOTIFY_FOUND, If false, do not try to use inotify. -# also defined, but not for general use are -# INOTIFY_LIBRARY, where to find the inotify library. +#============================================================================= +# SPDX-FileCopyrightText: 2016 Tobias C. Berner <tcberner@FreeBSD.org> +# SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org> +# +# SPDX-License-Identifier: BSD-2-Clause +#============================================================================= -find_path(INOTIFY_INCLUDE_DIR sys/inotify.h - PATH_SUFFIXES inotify) -mark_as_advanced(INOTIFY_INCLUDE_DIR) +find_path(Inotify_INCLUDE_DIRS sys/inotify.h) -find_library(INOTIFY_LIBRARY inotify PATH_SUFFIXES lib/inotify) - -get_filename_component(INOTIFY_LIBRARY_DIR ${INOTIFY_LIBRARY} PATH) -mark_as_advanced(INOTIFY_LIBRARY_DIR) - -# all listed variables are TRUE -# handle the QUIETLY and REQUIRED arguments and set INOTIFY_FOUND to TRUE if -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(INOTIFY DEFAULT_MSG INOTIFY_INCLUDE_DIR INOTIFY_LIBRARY_DIR) - -IF(INOTIFY_FOUND) - SET(INotify_INCLUDE_DIRS ${INOTIFY_INCLUDE_DIR}) - SET(INotify_LIBRARY_DIRS ${INOTIFY_LIBRARY_DIR}) -ENDIF(INOTIFY_FOUND) +if(Inotify_INCLUDE_DIRS) +# On Linux there is no library to link against, on the BSDs there is. +# On the BSD's, inotify is implemented through a library, libinotify. + if( CMAKE_SYSTEM_NAME MATCHES "Linux") + set(Inotify_FOUND TRUE) + set(Inotify_LIBRARIES "") + set(Inotify_INCLUDE_DIRS "") + else() + find_library(Inotify_LIBRARIES NAMES inotify) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Inotify + FOUND_VAR + Inotify_FOUND + REQUIRED_VARS + Inotify_LIBRARIES + Inotify_INCLUDE_DIRS + ) + mark_as_advanced(Inotify_LIBRARIES Inotify_INCLUDE_DIRS) + include(FeatureSummary) + set_package_properties(Inotify PROPERTIES + URL "https://github.com/libinotify-kqueue/" + DESCRIPTION "inotify API on the *BSD family of operating systems." + ) + endif() +else() + set(Inotify_FOUND FALSE) +endif() +mark_as_advanced(Inotify_LIBRARIES Inotify_INCLUDE_DIRS) diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index 32ebed87ce..dad4eba106 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -11,12 +11,6 @@ if ( APPLE ) ) endif() -IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD") - list(APPEND OS_SPECIFIC_LINK_LIBRARIES - inotify - ) -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD") - set(libsync_SRCS account.cpp pushnotifications.cpp @@ -135,10 +129,9 @@ if (NOT TOKEN_AUTH_ONLY) target_link_libraries(${synclib_NAME} PUBLIC Qt5::Widgets Qt5::Svg qt5keychain) endif() -if(INOTIFY_FOUND) - target_include_directories(${synclib_NAME} PRIVATE ${INOTIFY_INCLUDE_DIR}) - link_directories(${INOTIFY_LIBRARY_DIR}) - target_link_libraries(${synclib_NAME} ${INOTIFY_LIBRARY} ) +if(Inotify_FOUND) + target_include_directories(${synclib_NAME} PRIVATE ${Inotify_INCLUDE_DIRS}) + target_link_libraries(${synclib_NAME} PUBLIC ${Inotify_LIBRARIES}) endif() GENERATE_EXPORT_HEADER( ${synclib_NAME}
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 29043
: 12879 |
12880