diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-09-14 11:10:11 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-09-14 11:10:11 +0100 |
commit | 81b8f20732954c4508baf2f77472b5435e3f851f (patch) | |
tree | 4180177cb7ba85eab50159ce96218c2419fb24a6 /app-antivirus/clamav/files | |
parent | 946859e0e36904cffb3e0ccbccb6b7b1347c1cc8 (diff) |
gentoo auto-resync : 14:09:2022 - 11:10:10
Diffstat (limited to 'app-antivirus/clamav/files')
-rw-r--r-- | app-antivirus/clamav/files/clamav-0.105.1-cmake-llvm-fix.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/app-antivirus/clamav/files/clamav-0.105.1-cmake-llvm-fix.patch b/app-antivirus/clamav/files/clamav-0.105.1-cmake-llvm-fix.patch new file mode 100644 index 000000000000..b73a2e066ef1 --- /dev/null +++ b/app-antivirus/clamav/files/clamav-0.105.1-cmake-llvm-fix.patch @@ -0,0 +1,73 @@ +clamav 0.105.1 doesn't support LLVM version detection + +See: https://github.com/Cisco-Talos/clamav/pull/692 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -480,39 +480,43 @@ find_package(JSONC REQUIRED) + # Set variable required by libclamav to use libjson-c + set(HAVE_JSON 1) + ++set(LLVM_MAX_VER "14.0.0") ++set(LLVM_MIN_VER "8.0.0") ++ + string (TOLOWER ${BYTECODE_RUNTIME} bytecodeRuntime) + if(${bytecodeRuntime} STREQUAL "llvm") +- set (LLVM_FIND_VERSION "8.0.0") +- find_package(LLVM REQUIRED) ++ if(DEFINED LLVM_ROOT_DIR AND DEFINED LLVM_FIND_VERSION) ++ find_package(LLVM EXACT ${LLVM_FIND_VERSION} REQUIRED HINTS ${LLVM_ROOT_DIR}) ++ elseif(DEFINED LLVM_ROOT_DIR) ++ find_package(LLVM REQUIRED HINTS ${LLVM_ROOT_DIR}) ++ elseif(DEFINED LLVM_FIND_VERSION) ++ find_package(LLVM EXACT ${LLVM_FIND_VERSION} REQUIRED) ++ else() ++ set (LLVM_FIND_VERSION ${LLVM_MIN_VER}) ++ find_package(LLVM REQUIRED) ++ endif() + if(LLVM_FOUND) + if (LLVM_AVAILABLE_LIBS) +- # Found using LLVMConfig.cmake +- message("LLVM found using LLVMConfig.cmake") +- set(LLVM_VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}) ++ message(STATUS "LLVM found using LLVMConfig.cmake") + set(LLVM_LIBRARIES ${LLVM_AVAILABLE_LIBS}) +- +- if (${LLVM_PACKAGE_VERSION} VERSION_LESS "8.0.0") +- message(FATAL "LLVM version ${LLVM_PACKAGE_VERSION} is too old") +- endif() +- + else() +- # Found using FindLLVM.cmake +- message("LLVM found using FindLLVM.cmake") +- +- # Set variable required by libclamav to use llvm instead of interpreter +- set(LLVM_VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}) +- message("LLVM_FOUND ${LLVM_FOUND}") ++ message(STATUS "LLVM found using FindLLVM.cmake") ++ set(LLVM_PACKAGE_VERSION ${LLVM_VERSION_STRING}) + +- if (${LLVM_VERSION_STRING} VERSION_GREATER_EQUAL "9.0.0") +- if (${LLVM_VERSION_STRING} VERSION_LESS "10.0.0") +- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG") +- endif() ++ if (${LLVM_VERSION_STRING} VERSION_GREATER_EQUAL "9.0.0" AND ${LLVM_VERSION_STRING} VERSION_LESS "10.0.0") ++ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG") + endif() ++ endif() + +- if (${LLVM_VERSION_STRING} VERSION_LESS "8.0.0") +- message(FATAL "LLVM version ${LLVM_VERSION_STRING} is too old") +- endif() ++ if (${LLVM_PACKAGE_VERSION} VERSION_LESS ${LLVM_MIN_VER}) ++ message(FATAL_ERROR "LLVM version ${LLVM_PACKAGE_VERSION} is too old") ++ elseif (${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL ${LLVM_MAX_VER} ) ++ message(FATAL_ERROR "LLVM version ${LLVM_PACKAGE_VERSION} is too new") ++ else() ++ message(STATUS "LLVM version ${LLVM_PACKAGE_VERSION} found") + endif() ++ # Set variable required by libclamav to use llvm instead of interpreter ++ set(LLVM_VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}) + endif() + endif() + |