Add ctstraffic port (microsoft/ctsTraffic) (#35238)

* Initial port

* Add to baseline

* Usage

* update hash

* Update to fixed version

* Update json

* Disallow uwp

* rename to ctstraffic

* Only build release

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Remove copy_pdbs

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Add line at end

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Update hash

* Update ports/ctstraffic/portfile.cmake

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Update hash

---------

Co-authored-by: Sam Yun <samyun@microsoft.com>
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
This commit is contained in:
Sam Yun 2023-11-30 13:58:50 -08:00 committed by GitHub
parent bb588985e3
commit e85cafa30d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,29 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO microsoft/ctsTraffic
REF 88a415197951912fc70e440b31cad8d4ff4ea68a
SHA512 152ee25d1ba70c68c5bae61ee08d1d2905efd28a10c48672de852c8ee9d0964a9202814cdcc40bca712ef69f952630509810827226861dad16516f5e0827d879
HEAD_REF master
)
set(VCPKG_BUILD_TYPE release) # Windows port only includes tools.
include("${CURRENT_PORT_DIR}/prepare_for_build.cmake")
prepare_for_build("${SOURCE_PATH}")
vcpkg_list(SET MSBUILD_OPTIONS
"/p:UseVcpkg=yes"
)
vcpkg_msbuild_install(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH ctsTraffic/ctsTraffic.vcxproj
OPTIONS
${MSBUILD_OPTIONS}
)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -0,0 +1,19 @@
function(prepare_for_build CTSTRAFFIC_SOURCE_DIR)
message("-- Modifying hardcoded 'NuGet' directives in .vcxproj files")
file(GLOB_RECURSE PROJ_FILES "${CTSTRAFFIC_SOURCE_DIR}/*.vcxproj")
foreach(PROJ_FILE ${PROJ_FILES})
file(READ ${PROJ_FILE} PROJ_FILE_CONTENT)
STRING(REGEX
REPLACE
"<Target Name=\"EnsureNuGetPackageBuildImports\" BeforeTargets=\"PrepareForBuild\">"
"<Target Name=\"EnsureNuGetPackageBuildImports\" BeforeTargets=\"PrepareForBuild\" Condition=\"'$(UseVcpkg)' != 'yes'\">"
PROJ_FILE_CONTENT
"${PROJ_FILE_CONTENT}"
)
file(WRITE ${PROJ_FILE} "${PROJ_FILE_CONTENT}")
endforeach()
endfunction()

3
ports/ctstraffic/usage Normal file
View File

@ -0,0 +1,3 @@
See https://github.com/microsoft/ctsTraffic for usage instructions or
.\ctsTraffic.exe -help

View File

@ -0,0 +1,15 @@
{
"name": "ctstraffic",
"version": "2.0.3.2",
"description": "ctsTraffic is a highly scalable client/server networking tool giving detailed performance and reliability analytics.",
"homepage": "https://github.com/microsoft/ctsTraffic/",
"license": "Apache-2.0",
"supports": "windows & !uwp",
"dependencies": [
{
"name": "vcpkg-msbuild",
"host": true
},
"wil"
]
}

View File

@ -2008,6 +2008,10 @@
"baseline": "3.8",
"port-version": 0
},
"ctstraffic": {
"baseline": "2.0.3.2",
"port-version": 0
},
"cub": {
"baseline": "2.1.0",
"port-version": 0

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "e97cd84703f8c6e44d38be51561113c564590876",
"version": "2.0.3.2",
"port-version": 0
}
]
}