Skip to content

Commit

Permalink
KenLM port
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobkahn committed Sep 23, 2020
1 parent 5d33bd3 commit fdfcc2c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
52 changes: 52 additions & 0 deletions ports/kenlm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO kpu/kenlm
REF 689a25aae9171b3ea46bd80d4189f540f35f1a02
SHA512 a1d3521b3458c791eb1242451b4eaafda870f68b5baeb359549eba10ed69ca417eeaaac95fd0d48350852661af7688c6b640361e9f70af57ae24d261c4ac0b85
HEAD_REF master
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_build_cmake(ADD_BIN_TO_PATH)

# Headers
file(
INSTALL ${SOURCE_PATH}/util
DESTINATION ${CURRENT_PACKAGES_DIR}/include
FILES_MATCHING
PATTERN "*.hh"
PATTERN "*.h"
)
file(
INSTALL ${SOURCE_PATH}/lm
DESTINATION ${CURRENT_PACKAGES_DIR}/include
FILES_MATCHING
PATTERN "*.hh"
PATTERN "*.h"
PATTERN "*test_data*" EXCLUDE
)

# Lib
file(GLOB_RECURSE LIBS
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
)

file(GLOB_RECURSE DEBUG_LIBS
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
)

file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)

# Copyright and License
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/kenlm RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/kenlm RENAME license)

vcpkg_copy_pdbs()
17 changes: 17 additions & 0 deletions ports/kenlm/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "kenlm",
"version-string": "689a25aae9171b3ea46bd80d4189f540f35f1a02",
"description": "KenLM: Faster and Smaller Language Model Queries",
"port-version": 1,
"dependencies": [
"boost-system",
"boost-thread",
"boost-test",
"boost-interprocess",
"boost-program-options",
"boost-ptr-container",
"zlib",
"bzip2",
"liblzma"
]
}

0 comments on commit fdfcc2c

Please sign in to comment.