Skip to content

Commit

Permalink
[opencc] update to 1.1.9 (microsoft#41539)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayuehua authored Oct 17, 2024
1 parent 1f4e8c6 commit b2a47d3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 39 deletions.
43 changes: 9 additions & 34 deletions ports/opencc/fix-dependencies.patch
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee08591..c8c6b61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,12 +185,14 @@ if(NOT USE_SYSTEM_MARISA)
message(STATUS "Use bundled marisa library.")
add_subdirectory(deps/marisa-0.2.6)
else()
- find_library(LIBMARISA NAMES marisa)
- if (LIBMARISA)
- message(STATUS "libmarisa found: ${LIBMARISA}")
- else()
- message(FATAL_ERROR "libmarisa not found.")
- endif()
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(marisa REQUIRED IMPORTED_TARGET marisa)
+ # find_library(LIBMARISA NAMES marisa)
+ # if (LIBMARISA)
+ # message(STATUS "libmarisa found: ${LIBMARISA}")
+ # else()
+ # message(FATAL_ERROR "libmarisa not found.")
+ # endif()
endif()

######## Subdirectories
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c0a0b10..91b4037 100644
index 7768c89..70292d6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -114,7 +114,7 @@ configure_file(
add_library(libopencc ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
@@ -115,7 +115,7 @@ add_library(libopencc ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
add_library(OpenCC::OpenCC ALIAS libopencc)
set_target_properties(libopencc PROPERTIES POSITION_INDEPENDENT_CODE ON)
source_group(libopencc FILES ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
-target_link_libraries(libopencc marisa)
+target_link_libraries(libopencc PkgConfig::marisa)

GENERATE_EXPORT_HEADER(
libopencc
@@ -137,6 +137,21 @@ set_target_properties(
+target_link_libraries(libopencc ${LIBMARISA})
target_include_directories(libopencc PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${DIR_INCLUDE}/opencc>
@@ -144,6 +144,21 @@ set_target_properties(
${OPENCC_VERSION_MAJOR}.${OPENCC_VERSION_MINOR}
)

Expand All @@ -57,4 +32,4 @@ index c0a0b10..91b4037 100644
+
# Installation

install(
if (USE_SYSTEM_MARISA)
4 changes: 3 additions & 1 deletion ports/opencc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO BYVoid/OpenCC
REF "ver.${VERSION}"
SHA512 bfc40bdf1348e6a265b3304ab1e8acee2f4b6ac9c377ff3d8c996435a92dee98c3758503186b4fd424653faf44db339f8a90300e3290c59942ccf04b1bbb2a30
SHA512 713cf00931d7616994eb455eef3bc893096b5cd6d42b346aa1130591752d9612891ea3ed035bd7bd4ec7df1c90425e86375f5b3337fac11663c656c79a8f33e9
HEAD_REF master
PATCHES
fix-dependencies.patch
Expand Down Expand Up @@ -30,6 +30,8 @@ vcpkg_cmake_install(

vcpkg_copy_pdbs()

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/opencc)

vcpkg_fixup_pkgconfig()

set(tool_names "opencc" "opencc_dict" "opencc_phrase_extract")
Expand Down
3 changes: 1 addition & 2 deletions ports/opencc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "opencc",
"version": "1.1.6",
"port-version": 1,
"version": "1.1.9",
"description": "A project for conversions between Traditional Chinese, Simplified Chinese and Japanese Kanji (Shinjitai)",
"homepage": "https://github.com/BYVoid/OpenCC",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6585,8 +6585,8 @@
"port-version": 1
},
"opencc": {
"baseline": "1.1.6",
"port-version": 1
"baseline": "1.1.9",
"port-version": 0
},
"opencensus-cpp": {
"baseline": "2021-08-26",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opencc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e6bdb1f36889a641312f0f0dc91e8be0d800dcd5",
"version": "1.1.9",
"port-version": 0
},
{
"git-tree": "85a9b30209f5cd7460d2be2c8e1cc206fab66aaa",
"version": "1.1.6",
Expand Down

0 comments on commit b2a47d3

Please sign in to comment.