aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclvn <clvn@users.noreply.github.com>2018-01-12 12:24:02 +0100
committerclvn <clvn@users.noreply.github.com>2018-01-12 12:24:02 +0100
commitd7cd72e396446504c4a24fcfc2cd1660c26c30e1 (patch)
treee7ca0702979e50a84b26346ef4941d4a6fe88e04
parent6bdc3bf9eb5cc93e579cddcbb01c41e991082c8c (diff)
downloadvcpkg-d7cd72e396446504c4a24fcfc2cd1660c26c30e1.tar.gz
vcpkg-d7cd72e396446504c4a24fcfc2cd1660c26c30e1.zip
[tre] Initial port
-rw-r--r--ports/tre/CMakeLists.txt37
-rw-r--r--ports/tre/CONTROL3
-rw-r--r--ports/tre/portfile.cmake26
3 files changed, 66 insertions, 0 deletions
diff --git a/ports/tre/CMakeLists.txt b/ports/tre/CMakeLists.txt
new file mode 100644
index 000000000..09113fca1
--- /dev/null
+++ b/ports/tre/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required (VERSION 3.9)
+project (tre)
+
+set (HEADERS
+ lib/regex.h
+ include/tre/tre.h
+ include/tre/tre-config.h
+)
+
+set (SRCS
+ lib/regcomp.c
+ lib/regerror.c
+ lib/regexec.c
+ lib/tre-ast.c
+ lib/tre-compile.c
+ lib/tre-match-approx.c
+ lib/tre-match-backtrack.c
+ lib/tre-match-parallel.c
+ lib/tre-mem.c
+ lib/tre-parse.c
+ lib/tre-stack.c
+ lib/xmalloc.c
+ win32/tre.def
+)
+
+include_directories(win32 include/tre)
+add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -DHAVE_CONFIG_H)
+add_library(tre ${SRCS})
+
+install(
+ TARGETS tre
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
+install(FILES ${HEADERS} DESTINATION include/tre)
diff --git a/ports/tre/CONTROL b/ports/tre/CONTROL
new file mode 100644
index 000000000..a5df8cd11
--- /dev/null
+++ b/ports/tre/CONTROL
@@ -0,0 +1,3 @@
+Source: tre
+Version: 0.8.0-1
+Description: TRE is a lightweight, robust, and efficient POSIX compliant regexp matching library with some exciting features such as approximate (fuzzy) matching.
diff --git a/ports/tre/portfile.cmake b/ports/tre/portfile.cmake
new file mode 100644
index 000000000..0cf993082
--- /dev/null
+++ b/ports/tre/portfile.cmake
@@ -0,0 +1,26 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO laurikari/tre
+ REF 6fb7206b935b35814c5078c20046dbe065435363
+ SHA512 f1d664719eab23b665d71e34ca3d11f8ba49da23ff20dc28f46d4ce30fe155c12208ba7fd212dbeb20a7037e069909f0c2120ce1fc01074656399805e3289a90
+ HEAD_REF master
+)
+
+file(READ ${SOURCE_PATH}/win32/config.h CONFIG_H)
+string(REPLACE "#define snprintf sprintf_s" "" CONFIG_H ${CONFIG_H})
+file(WRITE ${SOURCE_PATH}/win32/config.h "${CONFIG_H}")
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tre RENAME copyright)