From 4ea3456f214deb69d9070a7abec11040a7308b4a Mon Sep 17 00:00:00 2001 From: Mengna Li <95600143+Adela0814@users.noreply.github.com> Date: Sat, 13 Aug 2022 06:46:15 +0800 Subject: [PATCH] [opencc] De-vendor rapidjson (#26291) * update opencc to v1.1.4 and add feature rapidjson * update * convert feature to dependence * remove useless code --- ports/opencc/fix-dependencies.patch | 16 ++++++++++++++++ ports/opencc/portfile.cmake | 3 +++ ports/opencc/vcpkg.json | 2 ++ versions/baseline.json | 2 +- versions/o-/opencc.json | 5 +++++ 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ports/opencc/fix-dependencies.patch diff --git a/ports/opencc/fix-dependencies.patch b/ports/opencc/fix-dependencies.patch new file mode 100644 index 0000000000..401de51457 --- /dev/null +++ b/ports/opencc/fix-dependencies.patch @@ -0,0 +1,16 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 11d14e4..fde4b7b 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -137,6 +137,11 @@ set_target_properties( + 1.1 + ) + ++if(USE_SYSTEM_RAPIDJSON) ++ find_package(RapidJSON CONFIG REQUIRED) ++ target_link_libraries(libopencc PRIVATE rapidjson) ++endif() ++ + # Installation + + install( diff --git a/ports/opencc/portfile.cmake b/ports/opencc/portfile.cmake index 49f53782bf..7b34399f1d 100644 --- a/ports/opencc/portfile.cmake +++ b/ports/opencc/portfile.cmake @@ -4,6 +4,8 @@ vcpkg_from_github( REF ver.1.1.4 SHA512 ab8e7e6a0cc71106cf09eb32899fa8620b946a406f042d75a2444096e0b383cb1993d6c2d12cd7862e71854da4cd5893442bce51df84c32ed09fdfb4a2846f46 HEAD_REF master + PATCHES + fix-dependencies.patch ) vcpkg_find_acquire_program(PYTHON3) @@ -15,6 +17,7 @@ vcpkg_cmake_configure( OPTIONS -DBUILD_DOCUMENTATION=OFF -DENABLE_GTEST=OFF + -DUSE_SYSTEM_RAPIDJSON=ON ) vcpkg_cmake_install( diff --git a/ports/opencc/vcpkg.json b/ports/opencc/vcpkg.json index 2daaa6e6e9..e4a42458f1 100644 --- a/ports/opencc/vcpkg.json +++ b/ports/opencc/vcpkg.json @@ -1,11 +1,13 @@ { "name": "opencc", "version": "1.1.4", + "port-version": 1, "description": "A project for conversions between Traditional Chinese, Simplified Chinese and Japanese Kanji (Shinjitai)", "homepage": "https://github.com/BYVoid/OpenCC", "license": "Apache-2.0", "supports": "!(arm | uwp)", "dependencies": [ + "rapidjson", { "name": "vcpkg-cmake", "host": true diff --git a/versions/baseline.json b/versions/baseline.json index 1fc0dee43a..86227160bb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5166,7 +5166,7 @@ }, "opencc": { "baseline": "1.1.4", - "port-version": 0 + "port-version": 1 }, "opencensus-cpp": { "baseline": "2021-08-26", diff --git a/versions/o-/opencc.json b/versions/o-/opencc.json index 37d01d051c..b862717933 100644 --- a/versions/o-/opencc.json +++ b/versions/o-/opencc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bfa36e95a55659eb27edc3ba561b3c06b202ff76", + "version": "1.1.4", + "port-version": 1 + }, { "git-tree": "9c886059bbc8c7c14a7d7290b22e2036c3ff8fe6", "version": "1.1.4",