Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chimera] Add new port #10132

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a008fd6
add a port for chimera
ZMZ91 Feb 19, 2020
35a2f76
1. remove deprecated include 2. clear buildtrees/ before installing 3…
ZMZ91 Feb 20, 2020
74d0462
refine port file
ZMZ91 Feb 20, 2020
dda6223
1. add Build-Depends: pcre 2. add usage
ZMZ91 Feb 20, 2020
6c0760d
add other build depdents by hyperscan
ZMZ91 Feb 20, 2020
33d2618
remove debugging messages
ZMZ91 Feb 21, 2020
a2b0db5
note that not support windows so far
ZMZ91 Feb 24, 2020
e8a39aa
Merge branch 'master' into feature/port/chimera
Feb 29, 2020
3d056bf
1. add Supports: linux|osx; 2. add chimera:arm64-windows=fail
Mar 3, 2020
75559e4
Merge branch 'master' of github.com:microsoft/vcpkg into feature/port…
Apr 14, 2020
2d8b684
Merge branch 'master' of github.com:microsoft/vcpkg into feature/port…
Jun 29, 2020
a4b9263
resolve conflicts from master
Jul 9, 2020
dd4c62d
update baseline
Jul 10, 2020
883d4af
update baseline
Jul 10, 2020
66060c7
update baseline
Jul 10, 2020
95a3f3b
use function vcpkg_from_github
Jul 10, 2020
1e85c17
Merge branch 'feature/port/chimera' of github.com:ZMZ91/vcpkg into fe…
Jul 10, 2020
79e33af
update baseline
Jul 10, 2020
4f2ff77
update to latest hyperscan
Jul 10, 2020
b0d270c
remove baseline rules due to Supports added in CONTROL
Jul 10, 2020
be34193
Revert baseline changes.
Jul 10, 2020
90e7ada
Revert baseline changes.
Jul 10, 2020
babc9b9
update due to JackBoosY's change
Jul 22, 2020
1fd9412
Update ports/chimera/CONTROL
JackBoosY Jul 23, 2020
74bf3d0
Update ports/chimera/CONTROL
JackBoosY Jul 28, 2020
06a0ae1
Update ports/chimera/portfile.cmake
JackBoosY Jul 28, 2020
707800c
[chimera] Fix unix build
Jul 31, 2020
498b0a7
[chimera] Fix include path
Aug 5, 2020
cd48b8a
Disable osx build
JackBoosY Aug 5, 2020
e136f08
[hyperscan chimera] fix C++ standard, and remove -Werror
strega-nil Aug 10, 2020
2822f98
remove Supports: !osx
strega-nil Aug 10, 2020
6b0d52c
Merge branch 'master' of github.com:microsoft/vcpkg into feature/port…
Sep 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ports/chimera/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Source: chimera
Version: 5.2.1
Homepage: https://github.com/intel/hyperscan
Description: Chimera is a software regular expression matching engine that is a hybrid of Hyperscan and PCRE. The design goals of Chimera are to fully support PCRE syntax as well as to take advantage of the high performance nature of Hyperscan.
Build-Depends: python3, ragel, hyperscan
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
Supports: windows
47 changes: 47 additions & 0 deletions ports/chimera/fix-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt
index 1cd66a3..9caa366 100644
--- a/chimera/CMakeLists.txt
+++ b/chimera/CMakeLists.txt
@@ -1,7 +1,24 @@
# Chimera lib
+cmake_minimum_required (VERSION 2.8.11)
+project (chimera C CXX)

-include_directories(${PCRE_INCLUDE_DIRS})
+set (HS_MAJOR_VERSION 5)
+set (HS_MINOR_VERSION 3)
+set (HS_PATCH_VERSION 0)
+set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION})

+set(HS_INTERNAL_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../src)
+
+configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.h.in ${CMAKE_BINARY_DIR}/config.h)
+configure_file(${CMAKE_CURRENT_LIST_DIR}/../src/hs_version.h.in ${CMAKE_BINARY_DIR}/hs_version.h)
+
+find_path(HS_INCLUDE_DIRS hs_common.h PATH_SUFFIXES hs)
+find_library(hs hs REQUIRED)
+find_library(hs_rt hs_runtime REQUIRED)
+
+find_path(PCRE_INCLUDE_DIRS pcre.h)
+find_library(pcre pcre REQUIRED)
+include_directories(${PCRE_INCLUDE_DIRS} ${HS_INCLUDE_DIRS} ${HS_INTERNAL_INCLUDE_DIRS} ${CMAKE_BINARY_DIR})
# only set these after all tests are done
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}")
@@ -28,11 +45,14 @@ SET(chimera_SRCS
)

add_library(chimera STATIC ${chimera_SRCS})
-add_dependencies(chimera hs pcre)
-target_link_libraries(chimera hs pcre)
+target_link_libraries(chimera hs pcre hs_rt)
+target_compile_definitions(chimera PUBLIC -DUSE_INTRIN_H)

install(TARGETS chimera DESTINATION ${CMAKE_INSTALL_LIBDIR})

+file(GLOB CHIMERA_HEADERS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${CHIMERA_HEADERS} DESTINATION include)
+
if (NOT WIN32)
# expand out library names for pkgconfig static link info
foreach (LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
31 changes: 31 additions & 0 deletions ports/chimera/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

# checkout hyperscan source code which is required by and also contains chimera
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO intel/hyperscan
REF c00683d73916e39f01b0d418f686c8b5c379159c
SHA512 3c4d52706901acc9ef4c3d12b0e5b2956f4e6bce13f6828a4ba3b736c05ffacb1d733ef9c226988ca80220584525f9cb6dcfe4914ced6cc34ae6a0a45975afb5
HEAD_REF master
PATCHES fix-cmakelists.patch
)

vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR ${PYTHON3} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${PYTHON3_DIR}")
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved

ZMZ91 marked this conversation as resolved.
Show resolved Hide resolved
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/chimera
PREFER_NINJA
OPTIONS
-DPYTHON_EXECUTABLE=${PYTHON3}
)

vcpkg_install_cmake()

# remove debug dir
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
10 changes: 10 additions & 0 deletions ports/chimera/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

The package @PORT@:@TARGET_TRIPLET@ provides CMake targets:

find_library(CHIMERA_LIBRARY NAMES chimera)
find_library(HS_LIBRARY NAMES hs)
find_path(CHIMERA_INCLUDE_DIR hs)
find_library(PCRE_LIBRARY NAMES pcre)

target_include_directories(main PUBLIC ${CHIMERA_INCLUDE_DIR})
target_link_libraries(main ${CHIMERA_LIBRARY} ${HS_LIBRARY} ${PCRE_LIBRARY})