[marisa-trie] Add new port (#27922)

* [marisa] Add new port

* [marisa] Add new port

* add COPY_SOURCE to fix build

* fix ci

* test arm

* fix version

* !(windows & static)

* !arm

* !arm

* add vcpkg_fixup_pkgconfig to msbuild

* rename port

* fix license and change version to 2020-09-26

* static build on win

* use "version-semver"

* up supports

* up version

* add configure_file when msbuild

* fix empty bindir libdir includedir

* fix msvc build

Co-authored-by: Monica <v-liumonica@microsoft.com>
This commit is contained in:
day253 2022-12-14 11:26:59 +08:00 committed by GitHub
parent 17851654c9
commit 86cd6e0532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,53 @@
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO s-yata/marisa-trie
REF 006020c1df76d0d7dc6118dacc22da64da2e35c4
SHA512 05dd7cc81a6347d4528654c19617af16de8d7352ad9e38d5f1cd296d88527377ecbfed9dbe722362d64369cd792d1ae0410319854b546ce0b6081ac560a40c0f
HEAD_REF master
)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
vcpkg_install_msbuild(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH vs2019/vs2019.sln
INCLUDES_SUBPATH include
LICENSE_SUBPATH COPYING.md
PLATFORM ${TRIPLET_SYSTEM_ARCH}
ALLOW_ROOT_INCLUDES
)
vcpkg_clean_msbuild()
set(prefix "${CURRENT_INSTALLED_DIR}")
set(exec_prefix "\${prefix}")
set(bindir "\${prefix}/bin")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
configure_file("${SOURCE_PATH}/marisa.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/marisa.pc" @ONLY)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/marisa.pc" "-lmarisa" "-llibmarisa")
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(prefix "${CURRENT_INSTALLED_DIR}/debug")
set(exec_prefix "\${prefix}")
set(bindir "\${prefix}/bin")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
configure_file("${SOURCE_PATH}/marisa.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/marisa.pc" @ONLY)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/marisa.pc" "-lmarisa" "-llibmarisa")
endif()
else()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
COPY_SOURCE
)
vcpkg_install_make()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${SOURCE_PATH}/COPYING.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
endif()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

5
ports/marisa-trie/usage Normal file
View File

@ -0,0 +1,5 @@
The package marisa-trie can be imported via CMake FindPkgConfig module:
find_package(PkgConfig REQUIRED)
pkg_check_modules(marisa REQUIRED IMPORTED_TARGET marisa)
target_link_libraries(main PkgConfig::marisa)

View File

@ -0,0 +1,8 @@
{
"name": "marisa-trie",
"version": "0.2.6+20200926",
"description": "Matching Algorithm with Recursively Implemented StorAge (MARISA) is a space-efficient trie data structure. This is a C++ library for an implementation of MARISA.",
"homepage": "https://github.com/s-yata/marisa-trie",
"license": "BSD-2-Clause OR LGPL-2.1-or-later",
"supports": "!windows | mingw | ((x86 | x64) & !staticcrt)"
}

View File

@ -4752,6 +4752,10 @@
"baseline": "22.04.0",
"port-version": 1
},
"marisa-trie": {
"baseline": "0.2.6+20200926",
"port-version": 0
},
"marl": {
"baseline": "2022-03-02",
"port-version": 0

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "aec2055269a2ed80494b6cc8876c48787b65d265",
"version": "0.2.6+20200926",
"port-version": 0
}
]
}