aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/oniguruma
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/oniguruma
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/oniguruma')
-rw-r--r--vcpkg/ports/oniguruma/fix-uwp.patch25
-rw-r--r--vcpkg/ports/oniguruma/portfile.cmake65
-rw-r--r--vcpkg/ports/oniguruma/vcpkg.json21
3 files changed, 111 insertions, 0 deletions
diff --git a/vcpkg/ports/oniguruma/fix-uwp.patch b/vcpkg/ports/oniguruma/fix-uwp.patch
new file mode 100644
index 0000000..5a2f801
--- /dev/null
+++ b/vcpkg/ports/oniguruma/fix-uwp.patch
@@ -0,0 +1,25 @@
+diff --git a/src/regcomp.c b/src/regcomp.c
+--- a/src/regcomp.c
++++ b/src/regcomp.c
+@@ -3880,7 +3880,7 @@ reduce_string_list(Node* node)
+ {
+ Node* prev;
+ Node* curr;
+- Node* prev_node;
++ Node* prev_node = NULL;
+ Node* next_node;
+
+ prev = NULL_NODE;
+diff --git a/src/regexec.c b/src/regexec.c
+index ce498c6..6848c0f 100644
+--- a/src/regexec.c
++++ b/src/regexec.c
+@@ -4216,7 +4216,7 @@ regset_search_body_position_lead(OnigRegSet* set,
+ {
+ int r, n, i;
+ UChar *s;
+- UChar *low, *high;
++ UChar *low, *high = NULL;
+ UChar* sch_range;
+ regex_t* reg;
+ OnigEncoding enc;
diff --git a/vcpkg/ports/oniguruma/portfile.cmake b/vcpkg/ports/oniguruma/portfile.cmake
new file mode 100644
index 0000000..5cf0cdf
--- /dev/null
+++ b/vcpkg/ports/oniguruma/portfile.cmake
@@ -0,0 +1,65 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO kkos/oniguruma
+ REF "v${VERSION}"
+ SHA512 60975b876662dec8701cca5d8d4027c0a36b8effe7dd32679395ed473e26b3d6b72d7f6eb63bd4dc96c3774b594e56808ce14f993f127a5d04363232586160e4
+ HEAD_REF master
+ PATCHES
+ fix-uwp.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ INVERTED_FEATURES
+ "non-posix" ENABLE_POSIX_API
+)
+
+if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ set(MSVC_STATIC_RUNTIME ON)
+else()
+ set(MSVC_STATIC_RUNTIME OFF)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DMSVC_STATIC_RUNTIME=${MSVC_STATIC_RUNTIME}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
+
+vcpkg_fixup_pkgconfig()
+
+# Note that onig-config is a shell script, not CMake configs, so
+# vcpkg_cmake_config_fixup would be inappropriate
+file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/onig-config")
+if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/onig-config")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/onig-config")
+endif()
+
+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()
+
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include/")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
diff --git a/vcpkg/ports/oniguruma/vcpkg.json b/vcpkg/ports/oniguruma/vcpkg.json
new file mode 100644
index 0000000..d5e2e02
--- /dev/null
+++ b/vcpkg/ports/oniguruma/vcpkg.json
@@ -0,0 +1,21 @@
+{
+ "name": "oniguruma",
+ "version": "6.9.10",
+ "description": "Modern and flexible regular expressions library",
+ "homepage": "https://github.com/kkos/oniguruma",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "non-posix": {
+ "description": "Disable POSIX API"
+ }
+ }
+}