[kenlm] Update port (#31863)

* [kenlm] Update port

* x-add-version

* remove unused patches

* Overwrite version

* Use imported targets for Boost to fix build issue on Windows

* Update ports/kenlm/vcpkg.json

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>

* Update version

* Update versions/k-/kenlm.json

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>

---------

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>
This commit is contained in:
Jacob Kahn 2023-06-07 09:34:22 -07:00 committed by GitHub
parent 4446d6e055
commit 120f81c4d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 38 deletions

View File

@ -0,0 +1,33 @@
diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
index 7a96ef5..0708d8a 100644
--- a/util/CMakeLists.txt
+++ b/util/CMakeLists.txt
@@ -85,7 +85,10 @@ set_target_properties(kenlm_util PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(kenlm_util
PUBLIC
# Boost is required for building binaries and tests
- "$<BUILD_INTERFACE:${Boost_LIBRARIES}>"
+ $<BUILD_INTERFACE:Boost::program_options>
+ $<BUILD_INTERFACE:Boost::system>
+ $<BUILD_INTERFACE:Boost::thread>
+ $<BUILD_INTERFACE:Boost::unit_test_framework>
PRIVATE
Threads::Threads
${RT})
diff --git a/util/stream/CMakeLists.txt b/util/stream/CMakeLists.txt
index be2fe00..a7e7df5 100644
--- a/util/stream/CMakeLists.txt
+++ b/util/stream/CMakeLists.txt
@@ -35,5 +35,11 @@ if(BUILD_TESTING)
)
AddTests(TESTS ${KENLM_BOOST_TESTS_LIST}
- LIBRARIES kenlm_util ${Boost_LIBRARIES} Threads::Threads)
+ LIBRARIES
+ kenlm_util
+ Boost::program_options
+ Boost::system
+ Boost::thread
+ Boost::unit_test_framework
+ Threads::Threads)
endif()

View File

@ -1,14 +0,0 @@
diff --git a/util/proxy_iterator.hh b/util/proxy_iterator.hh
index 8aa697b..9de2663 100644
--- a/util/proxy_iterator.hh
+++ b/util/proxy_iterator.hh
@@ -77,8 +77,7 @@ template <class Proxy> class ProxyIterator {
std::ptrdiff_t operator-(const S &other) const { return I() - other.I(); }
- Proxy operator*() { return p_; }
- const Proxy operator*() const { return p_; }
+ Proxy operator*() const { return p_; }
Proxy *operator->() { return &p_; }
const Proxy *operator->() const { return &p_; }
Proxy operator[](std::ptrdiff_t amount) const { return *(*this + amount); }

View File

@ -1,12 +0,0 @@
diff --git a/util/string_piece_hash.hh b/util/string_piece_hash.hh
index 6ff6f88..16808cd 100644
--- a/util/string_piece_hash.hh
+++ b/util/string_piece_hash.hh
@@ -1,6 +1,7 @@
#ifndef UTIL_STRING_PIECE_HASH_H
#define UTIL_STRING_PIECE_HASH_H
+#include <functional>
#include "util/have.hh"
#include "util/string_piece.hh"

View File

@ -3,13 +3,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO kpu/kenlm REPO kpu/kenlm
REF 1f054617eca14eae921e987b4b4eeb2b1d91de6b REF 5bf7b46558e1c5595bf3b8c9b0b1f9d8d257040a
SHA512 c18f9c22fbbb1f54ebe9c3b771fb2d7c09d502141d1b3645cff9db44cc51b3c976311ff0db79b60f410622579d043f185c56a4c7386e1b0ba8708e433238968b SHA512 04b645d09e60b65cb1e5065a1623ad01737f0dd9415cf620288ace0db10b1c424d72f304b34c52fa08684f3fecdaad9db91088134f34ed374cb1eb9d58c635b5
HEAD_REF master HEAD_REF master
PATCHES PATCHES
fix-boost.patch fix-boost.patch
fix-const-overloaded.patch fix-boost-imported-targets.patch
include_functional.patch # Upstream PR https://github.com/kpu/kenlm/pull/428, please remove this patch when updating this port.
) )
file(REMOVE "${SOURCE_PATH}/cmake/modules/FindEigen3.cmake") file(REMOVE "${SOURCE_PATH}/cmake/modules/FindEigen3.cmake")
@ -28,6 +27,7 @@ vcpkg_cmake_configure(
-DCOMPILE_TESTS=OFF -DCOMPILE_TESTS=OFF
) )
vcpkg_cmake_install() vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH share/${PORT}/cmake)
set(KENLM_TOOLS count_ngrams filter fragment kenlm_benchmark lmplz phrase_table_vocab query build_binary) set(KENLM_TOOLS count_ngrams filter fragment kenlm_benchmark lmplz phrase_table_vocab query build_binary)
if (NOT VCPKG_TARGET_IS_WINDOWS) if (NOT VCPKG_TARGET_IS_WINDOWS)
@ -41,6 +41,7 @@ vcpkg_copy_tools(TOOL_NAMES ${KENLM_TOOLS} AUTO_CLEAN)
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Copyright and License # Copyright and License
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/LICENSE") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/LICENSE")

View File

@ -1,8 +1,8 @@
{ {
"name": "kenlm", "name": "kenlm",
"version": "20200924", "version": "20230531",
"port-version": 4,
"description": "KenLM: Faster and Smaller Language Model Queries", "description": "KenLM: Faster and Smaller Language Model Queries",
"license": "LGPL-2.1",
"supports": "!(arm64 & windows)", "supports": "!(arm64 & windows)",
"dependencies": [ "dependencies": [
"boost-interprocess", "boost-interprocess",
@ -12,15 +12,15 @@
"boost-test", "boost-test",
"boost-thread", "boost-thread",
"bzip2", "bzip2",
{
"name": "eigen3",
"platform": "!windows"
},
"liblzma", "liblzma",
{ {
"name": "vcpkg-cmake", "name": "vcpkg-cmake",
"host": true "host": true
}, },
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib" "zlib"
], ],
"features": { "features": {

View File

@ -3529,8 +3529,8 @@
"port-version": 0 "port-version": 0
}, },
"kenlm": { "kenlm": {
"baseline": "20200924", "baseline": "20230531",
"port-version": 4 "port-version": 0
}, },
"keystone": { "keystone": {
"baseline": "0.9.2", "baseline": "0.9.2",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "bb9e0ae36b74ecd5bfb6a8855e761138eeda9185",
"version": "20230531",
"port-version": 0
},
{ {
"git-tree": "6f1bed68940353855027de67f5f6d33c5dbe8617", "git-tree": "6f1bed68940353855027de67f5f6d33c5dbe8617",
"version": "20200924", "version": "20200924",