diff options
| author | myd7349 <myd7349@gmail.com> | 2019-02-28 03:49:56 +0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-02-27 11:49:56 -0800 |
| commit | 2dfa568d186e4f0d199040929f9b3e44f27c8943 (patch) | |
| tree | 8d65139de57995f43b44868999d2a4e1247f6e30 | |
| parent | 68039e4572bb161592809bbb1f01c359ff34ae99 (diff) | |
| download | vcpkg-2dfa568d186e4f0d199040929f9b3e44f27c8943.tar.gz vcpkg-2dfa568d186e4f0d199040929f9b3e44f27c8943.zip | |
[oniguruma] Add new port (#5432)
* [oniguruma] Add new port
* [oniguruma] Fix ONIG_EXTERN
* [oniguruma] Disable vcpkg_test_cmake (failed on x64-windows)
* [oniguruma] Update to 2019-02-26 to fix UWP sdl compile error
| -rw-r--r-- | ports/oniguruma/CONTROL | 6 | ||||
| -rw-r--r-- | ports/oniguruma/portfile.cmake | 50 |
2 files changed, 56 insertions, 0 deletions
diff --git a/ports/oniguruma/CONTROL b/ports/oniguruma/CONTROL new file mode 100644 index 000000000..bf7a481ab --- /dev/null +++ b/ports/oniguruma/CONTROL @@ -0,0 +1,6 @@ +Source: oniguruma
+Version: 2019-02-26
+Description: Modern and flexible regular expressions library
+
+Feature: non-posix
+Description: Disable POSIX API
diff --git a/ports/oniguruma/portfile.cmake b/ports/oniguruma/portfile.cmake new file mode 100644 index 000000000..40652b590 --- /dev/null +++ b/ports/oniguruma/portfile.cmake @@ -0,0 +1,50 @@ +include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO kkos/oniguruma
+ REF 502b1f416746ed8700498229bbfceb180e400fbc
+ SHA512 0faf12f415de59716d8faa4d3dc026874c3bd6a3624f75f2a184843025294eb885d57164ae6dcb916cba5c7d1a4da4bcb0dc23fce3ceae5b34b7320e8f0e2c02
+ HEAD_REF master
+)
+
+if("non-posix" IN_LIST FEATURES)
+ set(ENABLE_POSIX_API OFF)
+else()
+ set(ENABLE_POSIX_API ON)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DENABLE_POSIX_API=${ENABLE_POSIX_API}
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
+
+file(REMOVE_RECURSE
+ ${CURRENT_PACKAGES_DIR}/debug/include
+ ${CURRENT_PACKAGES_DIR}/debug/share
+)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/oniguruma.h
+ "#if defined(ONIGURUMA_EXPORT)"
+ "#if 0 // defined(ONIGURUMA_EXPORT)"
+ )
+else()
+ # oniguruma.h uses `\n` as line break.
+ vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/oniguruma.h
+ "#ifndef ONIG_EXTERN\n#if defined(_WIN32) && !defined(__GNUC__)"
+ "#if 0\n#if defined(_WIN32) && !defined(__GNUC__)"
+ )
+endif()
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
+
+# CMake integration test
+#vcpkg_test_cmake(PACKAGE_NAME ${PORT})
|
