aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2019-08-14 01:51:47 +0800
committerVictor Romero <romerosanchezv@gmail.com>2019-08-13 10:51:47 -0700
commited027d4956f34f874d3248cc74754128482eb24e (patch)
tree600918d489b780c328de6cc3c6b33805844b0134
parent886dad5911a54f70d9922c59453588637da0e0d6 (diff)
downloadvcpkg-ed027d4956f34f874d3248cc74754128482eb24e.tar.gz
vcpkg-ed027d4956f34f874d3248cc74754128482eb24e.zip
[tiny-regex-c] Add new port (#7626)
-rw-r--r--ports/tiny-regex-c/CMakeLists.txt24
-rw-r--r--ports/tiny-regex-c/CONTROL4
-rw-r--r--ports/tiny-regex-c/portfile.cmake30
3 files changed, 58 insertions, 0 deletions
diff --git a/ports/tiny-regex-c/CMakeLists.txt b/ports/tiny-regex-c/CMakeLists.txt
new file mode 100644
index 000000000..44c7ad710
--- /dev/null
+++ b/ports/tiny-regex-c/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 3.14)
+
+project(tiny-regex-c LANGUAGES C)
+
+include(GNUInstallDirs)
+
+add_library(tiny-regex-c re.c)
+
+target_include_directories(
+ tiny-regex-c
+ PUBLIC
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+)
+
+set_target_properties(tiny-regex-c PROPERTIES PUBLIC_HEADER re.h)
+
+install(TARGETS tiny-regex-c EXPORT unofficial-tiny-regex-c-config)
+
+install(
+ EXPORT unofficial-tiny-regex-c-config
+ NAMESPACE unofficial::tiny-regex-c::
+ DESTINATION share/unofficial-tiny-regex-c
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+)
diff --git a/ports/tiny-regex-c/CONTROL b/ports/tiny-regex-c/CONTROL
new file mode 100644
index 000000000..12b5ea0c5
--- /dev/null
+++ b/ports/tiny-regex-c/CONTROL
@@ -0,0 +1,4 @@
+Source: tiny-regex-c
+Version: 2019-07-31
+Description: A small regex implementation in C
+Homepage: https://github.com/kokke/tiny-regex-c
diff --git a/ports/tiny-regex-c/portfile.cmake b/ports/tiny-regex-c/portfile.cmake
new file mode 100644
index 000000000..2e21fb433
--- /dev/null
+++ b/ports/tiny-regex-c/portfile.cmake
@@ -0,0 +1,30 @@
+include(vcpkg_common_functions)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO kokke/tiny-regex-c
+ REF d3058f271f7a06ff298dff0a6a9a1e0753a5fa17
+ SHA512 bd524c63850b08f02fa5f7725fcde85cbd9c9c6ec8a804f2570df0e04518961a758c017cdb33ebaf72df1abca42ba3b82681655404bc26e6142b5a52a0534ab4
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT})
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
+
+# CMake integration test
+vcpkg_test_cmake(PACKAGE_NAME unofficial-${PORT})