Skip to content

Commit 587cd22

Browse files
EfesXCheney-W
andauthored
[hdr-histogram] add new port (microsoft#38810)
- [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines. - [x] Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all `find_package` calls are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or disabled with [CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html). - [x] The versioning scheme in `vcpkg.json` matches what upstream says. - [x] The license declaration in `vcpkg.json` matches what upstream says. - [x] The installed as the "copyright" file matches what upstream says. - [x] The source code of the component installed comes from an authoritative source. - [x] The generated "usage text" is accurate. See [adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md) for context. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is in the new port's versions file. - [x] Only one version is added to each modified port's versions file. --------- Co-authored-by: Cheney Wang <[email protected]>
1 parent dbcf97b commit 587cd22

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

ports/hdr-histogram/portfile.cmake

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
2+
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
3+
endif()
4+
5+
vcpkg_from_github(
6+
OUT_SOURCE_PATH SOURCE_PATH
7+
REPO HdrHistogram/HdrHistogram_c
8+
REF ${VERSION}
9+
SHA512 2ede4b8412c4f0070d555515498e163397de5edebe7560eaea13adcb95a52b7fea99686aed06bbca0c6e8afdf65715483c3889d750f6b5b727bcf43c4fbe18d4
10+
HEAD_REF main
11+
)
12+
13+
if("log" IN_LIST FEATURES)
14+
list(APPEND FEATURE_OPTIONS "-DHDR_LOG_REQUIRED=ON")
15+
else()
16+
list(APPEND FEATURE_OPTIONS "-DHDR_LOG_REQUIRED=DISABLED")
17+
endif()
18+
19+
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
20+
list(APPEND FEATURE_OPTIONS "-DHDR_HISTOGRAM_BUILD_STATIC:BOOL=OFF")
21+
list(APPEND FEATURE_OPTIONS "-DHDR_HISTOGRAM_INSTALL_STATIC:BOOL=OFF")
22+
else()
23+
list(APPEND FEATURE_OPTIONS "-DHDR_HISTOGRAM_BUILD_SHARED:BOOL=OFF")
24+
list(APPEND FEATURE_OPTIONS "-DHDR_HISTOGRAM_INSTALL_SHARED:BOOL=OFF")
25+
endif()
26+
27+
# Do not build tests and examples
28+
list(APPEND FEATURE_OPTIONS "-DHDR_HISTOGRAM_BUILD_PROGRAMS:BOOL=OFF")
29+
30+
vcpkg_cmake_configure(
31+
SOURCE_PATH "${SOURCE_PATH}"
32+
OPTIONS
33+
${FEATURE_OPTIONS}
34+
)
35+
36+
vcpkg_cmake_install()
37+
38+
vcpkg_cmake_config_fixup(
39+
PACKAGE_NAME hdr_histogram
40+
CONFIG_PATH lib/cmake/hdr_histogram
41+
)
42+
43+
vcpkg_fixup_pkgconfig()
44+
45+
vcpkg_copy_pdbs()
46+
47+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
48+
49+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt" "${SOURCE_PATH}/COPYING.txt")
50+
51+
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

ports/hdr-histogram/usage

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
hdr_histogram provides CMake targets:
2+
3+
find_package(hdr_histogram CONFIG REQUIRED)
4+
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:hdr_histogram::hdr_histogram>,hdr_histogram::hdr_histogram,hdr_histogram::hdr_histogram_static>)

ports/hdr-histogram/vcpkg.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "hdr-histogram",
3+
"version-semver": "0.11.8",
4+
"description": "'C' port of High Dynamic Range (HDR) Histogram",
5+
"homepage": "https://github.com/HdrHistogram/HdrHistogram_c",
6+
"license": "CC0-1.0",
7+
"dependencies": [
8+
{
9+
"name": "vcpkg-cmake",
10+
"host": true
11+
},
12+
{
13+
"name": "vcpkg-cmake-config",
14+
"host": true
15+
},
16+
"zlib"
17+
],
18+
"features": {
19+
"log": {
20+
"description": "Logging support for HdrHistogram",
21+
"dependencies": [
22+
"zlib"
23+
]
24+
}
25+
}
26+
}

versions/baseline.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3376,6 +3376,10 @@
33763376
"baseline": "1.14.2",
33773377
"port-version": 0
33783378
},
3379+
"hdr-histogram": {
3380+
"baseline": "0.11.8",
3381+
"port-version": 0
3382+
},
33793383
"healpix": {
33803384
"baseline": "1.12.10",
33813385
"port-version": 9

versions/h-/hdr-histogram.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "e7c8179ec8d0d5a49010bea92f143f011de137da",
5+
"version-semver": "0.11.8",
6+
"port-version": 0
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)