From 7bef7a9ca1114320b500f586ca578799e28f3ec7 Mon Sep 17 00:00:00 2001 From: Larry-Hu Date: Mon, 20 May 2019 00:58:10 -0700 Subject: [PATCH 1/2] [sentencepiece]Add new port --- ports/sentencepiece/CONTROL | 3 +++ ports/sentencepiece/portfile.cmake | 34 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ports/sentencepiece/CONTROL create mode 100644 ports/sentencepiece/portfile.cmake diff --git a/ports/sentencepiece/CONTROL b/ports/sentencepiece/CONTROL new file mode 100644 index 0000000000..41db3d5ff3 --- /dev/null +++ b/ports/sentencepiece/CONTROL @@ -0,0 +1,3 @@ +Source: sentencepiece +Version: v0.1.82 +Description: SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation systems where the vocabulary size is predetermined prior to the neural model training \ No newline at end of file diff --git a/ports/sentencepiece/portfile.cmake b/ports/sentencepiece/portfile.cmake new file mode 100644 index 0000000000..1c10dc74da --- /dev/null +++ b/ports/sentencepiece/portfile.cmake @@ -0,0 +1,34 @@ +include(vcpkg_common_functions) + +if(NOT VCPKG_CMAKE_SYSTEM_NAME) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_STATIC_CRT) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/sentencepiece + REF v0.1.82 + SHA512 669d6a1e86c44587d725b1e93f11b707e510a180dec08afb79268158f5de009cb20ffccc72c501c84f032360e52e53ae227504f3538f59978629433e0d6fcf65 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSPM_ENABLE_SHARED=OFF +) + +vcpkg_install_cmake() + +if((NOT VCPKG_CMAKE_SYSTEM_NAME) AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepiece.lib ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepieced.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepiece_train.lib ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepiece_traind.lib) +endif() + +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + +vcpkg_copy_pdbs() \ No newline at end of file From a37e5cf0a4c72d9bf729f4bb6e8dd662d646fb9b Mon Sep 17 00:00:00 2001 From: Larry-Hu Date: Mon, 20 May 2019 01:41:52 -0700 Subject: [PATCH 2/2] [sentencepiece]Add new port --- ports/sentencepiece/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/sentencepiece/portfile.cmake b/ports/sentencepiece/portfile.cmake index 1c10dc74da..2623acac19 100644 --- a/ports/sentencepiece/portfile.cmake +++ b/ports/sentencepiece/portfile.cmake @@ -21,10 +21,10 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if((NOT VCPKG_CMAKE_SYSTEM_NAME) AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +if(NOT VCPKG_CMAKE_SYSTEM_NAME) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepiece.lib ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepieced.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepiece_train.lib ${CURRENT_PACKAGES_DIR}/debug/lib/sentencepiece_traind.lib) endif()