diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/pcre2 | |
Diffstat (limited to 'vcpkg/ports/pcre2')
| -rw-r--r-- | vcpkg/ports/pcre2/no-static-suffix.patch | 33 | ||||
| -rw-r--r-- | vcpkg/ports/pcre2/pcre2-10.35_fix-uwp.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/pcre2/portfile.cmake | 88 | ||||
| -rw-r--r-- | vcpkg/ports/pcre2/usage | 6 | ||||
| -rw-r--r-- | vcpkg/ports/pcre2/vcpkg.json | 38 |
5 files changed, 177 insertions, 0 deletions
diff --git a/vcpkg/ports/pcre2/no-static-suffix.patch b/vcpkg/ports/pcre2/no-static-suffix.patch new file mode 100644 index 0000000..4c81e96 --- /dev/null +++ b/vcpkg/ports/pcre2/no-static-suffix.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 523bdcb..9d5d1a4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -942,8 +942,8 @@ if(PCRE2_BUILD_PCRE2_8) + list(APPEND TARGETS pcre2-posix-static) + + if(MSVC) +- set_target_properties(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8-static) +- set_target_properties(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix-static) ++ set_target_properties(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8) ++ set_target_properties(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix) + else() + set_target_properties(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8) + set_target_properties(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix) +@@ -1049,7 +1049,7 @@ if(PCRE2_BUILD_PCRE2_16) + list(APPEND TARGETS pcre2-16-static) + + if(MSVC) +- set_target_properties(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16-static) ++ set_target_properties(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16) + else() + set_target_properties(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16) + endif() +@@ -1127,7 +1127,7 @@ if(PCRE2_BUILD_PCRE2_32) + list(APPEND TARGETS pcre2-32-static) + + if(MSVC) +- set_target_properties(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32-static) ++ set_target_properties(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32) + else() + set_target_properties(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32) + endif() diff --git a/vcpkg/ports/pcre2/pcre2-10.35_fix-uwp.patch b/vcpkg/ports/pcre2/pcre2-10.35_fix-uwp.patch new file mode 100644 index 0000000..16d8d77 --- /dev/null +++ b/vcpkg/ports/pcre2/pcre2-10.35_fix-uwp.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c970996..523bdcb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -894,6 +894,7 @@ endif() + + if(MSVC) + add_compile_definitions(_CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS) ++ add_compile_options(/wd4146) + endif() + + set(TARGETS) diff --git a/vcpkg/ports/pcre2/portfile.cmake b/vcpkg/ports/pcre2/portfile.cmake new file mode 100644 index 0000000..f022ac6 --- /dev/null +++ b/vcpkg/ports/pcre2/portfile.cmake @@ -0,0 +1,88 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO PCRE2Project/pcre2 + REF "pcre2-${VERSION}" + SHA512 4deef8ce95711e65fe07624e6b2aace794594adb15e8363a0279a7b947bf5c75a5858fbdc5251d0a28a7ca97ae8bba561aa5f85805d5c07d417d3e7b3b3486a4 + HEAD_REF master + PATCHES + pcre2-10.35_fix-uwp.patch + no-static-suffix.patch +) + +vcpkg_from_github( + OUT_SOURCE_PATH SLJIT_SOURCE_PATH + REPO zherczeg/sljit + REF 45f910b78c6605ebf5b53d3ec7cb00f2312fe417 + SHA512 c05c83cc762f430c01e2aaf876aaac41a70b67ed8b91bc81102ad527c8921c5e75b41bab35bb8237dd5f53fecd7b8f31206865efffce2ea0a1aa9c87079fc643 + HEAD_REF main +) + +file(REMOVE_RECURSE "${SOURCE_PATH}/deps/sljit") +file(MAKE_DIRECTORY "${SOURCE_PATH}/deps") +file(RENAME "${SLJIT_SOURCE_PATH}" "${SOURCE_PATH}/deps/sljit") + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" INSTALL_PDB) +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_STATIC_CRT) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + jit PCRE2_SUPPORT_JIT +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DBUILD_STATIC_LIBS=${BUILD_STATIC} + -DPCRE2_STATIC_RUNTIME=${BUILD_STATIC_CRT} + -DPCRE2_BUILD_PCRE2_8=ON + -DPCRE2_BUILD_PCRE2_16=ON + -DPCRE2_BUILD_PCRE2_32=ON + -DPCRE2_SUPPORT_UNICODE=ON + -DPCRE2_BUILD_TESTS=OFF + -DPCRE2_BUILD_PCRE2GREP=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=ON + -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=ON + -DCMAKE_DISABLE_FIND_PACKAGE_Readline=ON + -DCMAKE_DISABLE_FIND_PACKAGE_Editline=ON + -DINSTALL_MSVC_PDB=${INSTALL_PDB} + ) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() + +file(READ "${CURRENT_PACKAGES_DIR}/include/pcre2.h" PCRE2_H) +if(BUILD_STATIC) + string(REPLACE "defined(PCRE2_STATIC)" "1" PCRE2_H "${PCRE2_H}") +else() + string(REPLACE "defined(PCRE2_STATIC)" "0" PCRE2_H "${PCRE2_H}") +endif() +file(WRITE "${CURRENT_PACKAGES_DIR}/include/pcre2.h" "${PCRE2_H}") + +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/man" + "${CURRENT_PACKAGES_DIR}/share/doc" + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/man" + "${CURRENT_PACKAGES_DIR}/debug/share") + +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/pcre2") +file(RENAME "${CURRENT_PACKAGES_DIR}/bin/pcre2-config" "${CURRENT_PACKAGES_DIR}/tools/pcre2/pcre2-config") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/pcre2/pcre2-config" "${CURRENT_PACKAGES_DIR}" [[$(cd "$(dirname "$0")/../.."; pwd -P)]]) +if(NOT VCPKG_BUILD_TYPE) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/pcre2/debug") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/pcre2-config" "${CURRENT_PACKAGES_DIR}/tools/pcre2/debug/pcre2-config") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/pcre2/debug/pcre2-config" "${CURRENT_PACKAGES_DIR}/debug" [[$(cd "$(dirname "$0")/../../../debug"; pwd -P)]]) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/pcre2/debug/pcre2-config" [[${prefix}/include]] [[${prefix}/../include]]) +endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin") +endif() + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/vcpkg/ports/pcre2/usage b/vcpkg/ports/pcre2/usage new file mode 100644 index 0000000..a23aadd --- /dev/null +++ b/vcpkg/ports/pcre2/usage @@ -0,0 +1,6 @@ +The package pcre2 is compatible with built-in CMake targets:
+
+ # Each component imports a target:
+ # TARGETS: PCRE2::8BIT PCRE2::16BIT PCRE2::32BIT PCRE2::POSIX
+ find_package(pcre2 CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE PCRE2::8BIT PCRE2::16BIT PCRE2::32BIT PCRE2::POSIX)
diff --git a/vcpkg/ports/pcre2/vcpkg.json b/vcpkg/ports/pcre2/vcpkg.json new file mode 100644 index 0000000..55e1d20 --- /dev/null +++ b/vcpkg/ports/pcre2/vcpkg.json @@ -0,0 +1,38 @@ +{ + "name": "pcre2", + "version": "10.47", + "description": "Regular Expression pattern matching using the same syntax and semantics as Perl 5.", + "homepage": "https://github.com/PCRE2Project/pcre2", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "platform-default-features" + ], + "features": { + "jit": { + "description": "Enable support for Just-In-Time compiling regex matchers", + "supports": "!emscripten & !ios" + }, + "platform-default-features": { + "description": "Enable default features", + "dependencies": [ + { + "name": "pcre2", + "features": [ + "jit" + ], + "platform": "!emscripten & !ios" + } + ] + } + } +} |