[ctp] New port CTP library 6.3.15 (#10717)

* [ctp] New port CTP library 6.3.15

* [ctp] Minor changes
 - Update portfile to support custom triplets
 - disable CI due to downloading server availability

* Update ports/ctp/portfile.cmake

* Update ports/ctp/portfile.cmake

* Remove ${...} from if

Co-authored-by: Vincent Gao <xgao1023@outlook.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
This commit is contained in:
Vincent Gao 2020-05-19 01:43:53 +08:00 committed by GitHub
parent 9f051a093f
commit fb441358ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 88 additions and 0 deletions

7
ports/ctp/CONTROL Normal file
View File

@ -0,0 +1,7 @@
Source: ctp
Version: 6.3.15_20190220_se
Homepage: http://www.sfit.com.cn/index.htm
Description: The Comprehensive Transaction Platform (CTP) is a future brokerage management system developed specially for futures companies. CTP API client library allows users to connect to CTP gateway for algorithmic trading.
Feature: datacollect
Description: Data collect support of CTP

70
ports/ctp/portfile.cmake Normal file
View File

@ -0,0 +1,70 @@
message(STATUS "Note: the downloading server may only be avilable from 8:00AM-5:00PM (UTC+8), Mon-Fri (except public holidays in China)")
vcpkg_fail_port_install(ON_TARGET "OSX" "UWP" ON_ARCH "arm")
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_download_distfile(ARCHIVE
URLS "http://www.sfit.com.cn/DocumentDown/api_3/5_2_2/6.3.15_20190220.zip"
FILENAME "6.3.15_20190220.zip"
SHA512 e17bb9d7fdda85f944b241d7ecd6a3b6f7e145f1a9d39ad48b36aa015e7e8a1b599e0289c8c38ce0a84cc8426a374fd620b07815dc9b6083c562389867138577
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH UNPACK_PATH
ARCHIVE ${ARCHIVE}
NO_REMOVE_ONE_LEVEL
)
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(ARCH_ARCHIVE "6.3.15_20190220_tradeapi_se_windows.zip")
set(ARCH_ARCHIVE_DATACOLLECT "6.3.15_20190220_clientdll_windows.zip")
elseif(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(ARCH_ARCHIVE "6.3.15_20190220_tradeapi64_se_windows.zip")
set(ARCH_ARCHIVE_DATACOLLECT "6.3.15_20190220_clientdll64_windows.zip")
elseif(VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(ARCH_ARCHIVE "v6.3.15_20190220_api_clientdatacollectdll_linux64.tar")
set(ARCH_ARCHIVE_DATACOLLECT "6.3.15_20190220_clientdll_windows.zip")
else()
message(FATAL_ERROR "${TARGET_TRIPLET} is not a supported platform" )
endif()
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${UNPACK_PATH}/${ARCH_ARCHIVE}"
)
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h")
if(VCPKG_TARGET_IS_WINDOWS)
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib")
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll")
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.lib")
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/bin FILES_MATCHING PATTERN "*.dll")
elseif(VCPKG_TARGET_IS_LINUX)
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.so")
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.so")
endif()
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/share FILES_MATCHING PATTERN "*.xml")
file(INSTALL ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/share FILES_MATCHING PATTERN "*.dtd")
if("datacollect" IN_LIST FEATURES)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH_DATACOLLECT
ARCHIVE "${UNPACK_PATH}/${ARCH_ARCHIVE_DATACOLLECT}"
)
file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h")
if(VCPKG_TARGET_IS_WINDOWS)
file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib")
file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll")
file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.lib")
file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/bin FILES_MATCHING PATTERN "*.dll")
elseif(VCPKG_TARGET_IS_LINUX)
file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.so")
file(INSTALL ${SOURCE_PATH_DATACOLLECT}/ DESTINATION ${CURRENT_PACKAGES_DIR}/Debug/lib FILES_MATCHING PATTERN "*.so")
endif()
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "Copyright By Shanghai Futures Information Technology Co.,Ltd")

View File

@ -2015,3 +2015,14 @@ zkpp:arm-uwp=fail
c4core:arm-uwp=fail
c4core:arm64-windows=fail
c4core:x64-osx=fail
# Official downloading server of CTP library is only guaranteed to be available during trading hours of China futures market
# Skip CI to avoid random failures
ctp:arm64-windows=skip
ctp:arm-uwp=skip
ctp:x64-linux=skip
ctp:x64-osx=skip
ctp:x64-uwp=skip
ctp:x64-windows=skip
ctp:x64-windows-static=skip
ctp:x86-windows=skip