mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
[uchardet] Add new port (#8477)
* [uchardet] Add new port * [uchardet] Fix string no output variable error [uchardet] Update homepage * [uchardet] Fix tool build error on Windows * [uchardet] Update * [uchardet] Modernize * [uchardet] Update to 2020-04-26 * [uchardet] Fix static build * [uchardet] Fix UWP build
This commit is contained in:
parent
b9c3a26392
commit
be2f81f912
8
ports/uchardet/CONTROL
Normal file
8
ports/uchardet/CONTROL
Normal file
@ -0,0 +1,8 @@
|
||||
Source: uchardet
|
||||
Version: 2020-04-26
|
||||
Description: An encoding detector library ported from Mozilla
|
||||
Homepage: https://cgit.freedesktop.org/uchardet/uchardet/
|
||||
|
||||
Feature: tool
|
||||
Description: Build uchardet CLI tool
|
||||
Build-Depends: getopt
|
56
ports/uchardet/portfile.cmake
Normal file
56
ports/uchardet/portfile.cmake
Normal file
@ -0,0 +1,56 @@
|
||||
vcpkg_from_git(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
URL https://gitlab.freedesktop.org/uchardet/uchardet
|
||||
REF 8681fc060ea07f646434cd2d324e4a5aa7c495c4
|
||||
)
|
||||
|
||||
vcpkg_check_features(
|
||||
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
tool BUILD_BINARY
|
||||
)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
||||
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
# uchardet calls `fopen` and `strdup`, which makes UWP unhappy.
|
||||
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE")
|
||||
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE")
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG
|
||||
-DBUILD_BINARY=OFF
|
||||
OPTIONS_RELEASE
|
||||
${FEATURE_OPTIONS}
|
||||
OPTIONS
|
||||
-DBUILD_STATIC=${BUILD_STATIC}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if(tool IN_LIST FEATURES)
|
||||
file(COPY
|
||||
${CURRENT_PACKAGES_DIR}/bin/uchardet${VCPKG_TARGET_EXECUTABLE_SUFFIX}
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}
|
||||
)
|
||||
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
||||
else()
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/uchardet${VCPKG_TARGET_EXECUTABLE_SUFFIX})
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
${CURRENT_PACKAGES_DIR}/debug/include
|
||||
${CURRENT_PACKAGES_DIR}/debug/share
|
||||
${CURRENT_PACKAGES_DIR}/share/man
|
||||
)
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
Loading…
x
Reference in New Issue
Block a user