early-access version 2853
This commit is contained in:
152
externals/vcpkg/ports/yara/CMakeLists.txt
vendored
Executable file
152
externals/vcpkg/ports/yara/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,152 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(yara C)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_path(JANSSON_INCLUDE_DIR NAMES jansson.h)
|
||||
find_library(JANSSON_LIBRARY NAMES jansson)
|
||||
|
||||
|
||||
include_directories(
|
||||
.
|
||||
libyara
|
||||
libyara/include
|
||||
)
|
||||
|
||||
set(PROC_PLATFORM_SOURCE "libyara/proc/none.c")
|
||||
set(PROC_PLATFORM_INTERFACE "USE_NO_PROC")
|
||||
|
||||
if(APPLE AND CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
set(PROC_PLATFORM_SOURCE "libyara/proc/mach.c")
|
||||
set(PROC_PLATFORM_INTERFACE "USE_MACH_PROC")
|
||||
elseif(WIN32 OR MINGW OR CYGWIN)
|
||||
set(PROC_PLATFORM_SOURCE "libyara/proc/windows.c")
|
||||
set(PROC_PLATFORM_INTERFACE "USE_WINDOWS_PROC")
|
||||
elseif(UNIX AND CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
set(PROC_PLATFORM_SOURCE "libyara/proc/linux.c")
|
||||
set(PROC_PLATFORM_INTERFACE "USE_LINUX_PROC")
|
||||
endif()
|
||||
|
||||
set(
|
||||
libyara_sources
|
||||
libyara/ahocorasick.c
|
||||
libyara/arena.c
|
||||
libyara/atoms.c
|
||||
libyara/base64.c
|
||||
libyara/bitmask.c
|
||||
libyara/compiler.c
|
||||
libyara/endian.c
|
||||
libyara/exec.c
|
||||
libyara/exefiles.c
|
||||
libyara/filemap.c
|
||||
libyara/grammar.c
|
||||
libyara/hash.c
|
||||
libyara/hex_grammar.c
|
||||
libyara/hex_lexer.c
|
||||
libyara/lexer.c
|
||||
libyara/libyara.c
|
||||
libyara/mem.c
|
||||
libyara/modules.c
|
||||
libyara/modules/console/console.c
|
||||
libyara/modules/cuckoo/cuckoo.c
|
||||
libyara/modules/dotnet/dotnet.c
|
||||
libyara/modules/elf/elf.c
|
||||
libyara/modules/hash/hash.c
|
||||
libyara/modules/math/math.c
|
||||
libyara/modules/macho/macho.c
|
||||
libyara/modules/pe/pe.c
|
||||
libyara/modules/pe/pe_utils.c
|
||||
libyara/modules/tests/tests.c
|
||||
libyara/modules/time/time.c
|
||||
libyara/notebook.c
|
||||
libyara/object.c
|
||||
libyara/parser.c
|
||||
libyara/proc.c
|
||||
${PROC_PLATFORM_SOURCE}
|
||||
libyara/re.c
|
||||
libyara/re_grammar.c
|
||||
libyara/re_lexer.c
|
||||
libyara/rules.c
|
||||
libyara/scan.c
|
||||
libyara/scanner.c
|
||||
libyara/sizedstr.c
|
||||
libyara/stack.c
|
||||
libyara/stopwatch.c
|
||||
libyara/stream.c
|
||||
libyara/strutils.c
|
||||
libyara/threading.c
|
||||
)
|
||||
|
||||
set(
|
||||
yara_sources
|
||||
cli/args.c
|
||||
cli/common.c
|
||||
cli/threading.c
|
||||
cli/yara.c
|
||||
)
|
||||
set( yarac_sources
|
||||
cli/args.c
|
||||
cli/common.c
|
||||
cli/yarac.c
|
||||
)
|
||||
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
set(
|
||||
libyara_dependencies
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto
|
||||
Threads::Threads
|
||||
${JANSSON_LIBRARY}
|
||||
)
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
list(APPEND libyara_dependencies Crypt32.lib Ws2_32.lib)
|
||||
endif()
|
||||
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
list(APPEND libyara_dependencies m)
|
||||
endif()
|
||||
|
||||
set(
|
||||
libyara_definitions
|
||||
-DHAVE_LIBCRYPTO
|
||||
-D${PROC_PLATFORM_INTERFACE}
|
||||
-DCUCKOO_MODULE
|
||||
-DHASH_MODULE
|
||||
-DDOTNET_MODULE
|
||||
)
|
||||
|
||||
add_library(libyara ${libyara_sources})
|
||||
target_link_libraries(libyara PRIVATE ${libyara_dependencies})
|
||||
target_compile_definitions(libyara PRIVATE ${libyara_definitions})
|
||||
|
||||
|
||||
add_executable(yara ${yara_sources})
|
||||
add_executable(yarac ${yarac_sources})
|
||||
|
||||
target_link_libraries(yarac PRIVATE libyara ${libyara_dependencies})
|
||||
target_link_libraries(yara PRIVATE libyara ${libyara_dependencies})
|
||||
|
||||
install(
|
||||
TARGETS libyara
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
if(NOT DISABLE_INSTALL_TOOLS)
|
||||
install (
|
||||
TARGETS yarac yara
|
||||
RUNTIME DESTINATION tools/yara
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(DIRECTORY libyara/include/ DESTINATION include)
|
||||
endif()
|
||||
23
externals/vcpkg/ports/yara/portfile.cmake
vendored
Executable file
23
externals/vcpkg/ports/yara/portfile.cmake
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO VirusTotal/yara
|
||||
REF 136794355c51242b595af42309a234846d534e8b #v4.2.0
|
||||
SHA512 b0aabbf4d0ba585e3adab7dbdb708264c4d4140179e69c8bc57a2ea85cdd6d97f61e67e2ce06c8436450b4e0add7f475ff76d7ca549a9b1168ac057a6cbae776
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS_DEBUG
|
||||
-DDISABLE_INSTALL_HEADERS=ON
|
||||
-DDISABLE_INSTALL_TOOLS=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
15
externals/vcpkg/ports/yara/vcpkg.json
vendored
Executable file
15
externals/vcpkg/ports/yara/vcpkg.json
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "yara",
|
||||
"version": "4.2.0",
|
||||
"description": "The pattern matching swiss knife",
|
||||
"homepage": "https://github.com/VirusTotal/yara",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
"jansson",
|
||||
"openssl",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user