[libunibreak] Update to 5.0 (#24469)

* Updated libunibreak and added config.cmake file

* Updated version

* Updated the manifest file

* updated git-tree

* Remove vcpkg-cmake-config dependency

* updated version

Co-authored-by: Benjamin Oldenburg <benamin.oldenburg@ordis.co.th>
This commit is contained in:
Benjamin Oldenburg 2022-04-29 12:33:44 -07:00 committed by GitHub
parent 0051a1879c
commit 64d550b430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 16 deletions

View File

@ -3,22 +3,24 @@ cmake_minimum_required(VERSION 3.8.0)
project(libunibreak)
set(libunibreak_srcs
src/linebreak.c
src/linebreakdata.c
src/linebreakdef.c
src/linebreak.c
src/wordbreak.c
src/wordbreakdata.c
src/graphemebreak.c
src/graphemebreakdata.c
src/emojidef.c
src/unibreakbase.c
src/unibreakdef.c
)
include_directories(src)
add_library(libunibreak ${libunibreak_srcs})
add_library(unibreak ${libunibreak_srcs})
install(
TARGETS libunibreak
TARGETS unibreak
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
@ -27,12 +29,16 @@ install(
if(NOT DISABLE_INSTALL_HEADERS)
install(
FILES
src/emojidef.h
src/graphemebreak.h
src/graphemebreakdef.h
src/linebreak.h
src/linebreakdef.h
src/wordbreak.h
src/wordbreakdef.h
src/test_skips.h
src/unibreakbase.h
src/unibreakdef.h
src/wordbreak.h
src/wordbreakdef.h
DESTINATION include
)
endif()

View File

@ -0,0 +1,24 @@
# For old projects where the minimum CMake version is lower than 3.3.
cmake_policy(SET CMP0057 NEW)
include(CMakeFindDependencyMacro)
if(TARGET libunibreak)
return()
endif()
add_library(unibreak INTERFACE IMPORTED GLOBAL)
add_library(libunibreak::libunibreak ALIAS unibreak)
find_library(LIBUNIBREAK_LIBRARY_DEBUG NAMES unibreak PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
if(LIBUNIBREAK_LIBRARY_DEBUG)
target_link_libraries(unibreak INTERFACE $<$<CONFIG:DEBUG>:${LIBUNIBREAK_LIBRARY_DEBUG}>)
endif()
find_library(LIBUNIBREAK_LIBRARY_RELEASE NAMES unibreak PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH)
target_link_libraries(unibreak INTERFACE $<$<NOT:$<CONFIG:DEBUG>>:${LIBUNIBREAK_LIBRARY_RELEASE}>)
set(LIBUNIBREAK_LIBRARY libunibreak::libunibreak PARENT_SCOPE)
set(LIBUNIBREAK_LIBRARIES libunibreak::libunibreak PARENT_SCOPE)
set(LIBUNIBREAK_INCLUDE_DIR "${_INSTALL_DIR}/include" PARENT_SCOPE)
target_include_directories(unibreak INTERFACE ${_INSTALL_DIR}/include)

View File

@ -3,19 +3,21 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO adah1972/libunibreak
REF 8df6ef4ebe5dbd2a49539d05366337ab7fb57ae3 # libunibreak_4_3
SHA512 791e342dcc0e79e15f578ec93239d53a656f9e1804f9ec8b970cfac2b6c4f3456855513c36f18f8e72a91dac64060abc336e4716d584dbec86e1fb0c91eded69
REF libunibreak_5_0 # libunibreak_5_0
SHA512 909c12cf5df92f0374050fc7a0ef9e91bc1efe6a5dc5a80f4e2c81a507f1228ecaba417c3ee001e11b2422024bea68cc14eb66e08360ae69f830cdaa18764484
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
)
vcpkg_install_cmake()
vcpkg_cmake_install()
configure_file("${CMAKE_CURRENT_LIST_DIR}/libunibreak-config.cmake.in"
"${CURRENT_PACKAGES_DIR}/share/${PORT}/libunibreak-config.cmake" @ONLY)
file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libunibreak RENAME copyright)

View File

@ -1,7 +1,13 @@
{
"name": "libunibreak",
"version-string": "4.3",
"port-version": 1,
"version": "5.0",
"description": "an implementation of the line breaking and word breaking algorithms as described in [Unicode Standard Annex 14] 1 and [Unicode Standard Annex 29] 2. Check the project's [home page] 3 for up-to-date information.",
"homepage": "https://github.com/adah1972/libunibreak"
"homepage": "https://github.com/adah1972/libunibreak",
"license": "zlib-acknowledgement",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -4113,8 +4113,8 @@
"port-version": 2
},
"libunibreak": {
"baseline": "4.3",
"port-version": 1
"baseline": "5.0",
"port-version": 0
},
"libunifex": {
"baseline": "2021-12-07",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ab89a270477d6d97e3d70c4503ee573f1ca8e539",
"version": "5.0",
"port-version": 0
},
{
"git-tree": "f1fb2965625f4dc28c5ab3c4e0a8a128901a0f0e",
"version-string": "4.3",