Skip to content

Commit

Permalink
[ntf-core] Update to 2.5.4 (microsoft#43733)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwang118 authored Feb 14, 2025
1 parent 8b903e1 commit 56cf249
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 39 deletions.
19 changes: 16 additions & 3 deletions ports/ntf-core/dont-use-lib64.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
diff --git a/repository.cmake b/repository.cmake
index 9b6c699..ed2ce32 100644
index f02ba90..4dbd81f 100644
--- a/repository.cmake
+++ b/repository.cmake
@@ -1737,11 +1737,7 @@ function (ntf_group_end)
@@ -3151,11 +3151,7 @@ function (ntf_adapter_end)
set(target_output_name "${target}")
endif()

ntf_ufid_string_has(UFID ${build_ufid} FLAG "64" OUTPUT is_64_bit)
- if (${is_64_bit} AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- set(lib_name "lib64" CACHE INTERNAL "")
- else()
- set(lib_name "lib" CACHE INTERNAL "")
- endif()
+ set(lib_name "lib" CACHE INTERNAL "")

# Set the relative path to the library directory under the prefix. For
# example: lib64
@@ -4028,11 +4024,7 @@ function (ntf_group_end)
set(target_output_name "${target}")
endif()

- if (${is_64_bit} AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- set(lib_name "lib64" CACHE INTERNAL "")
Expand Down
30 changes: 10 additions & 20 deletions ports/ntf-core/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO bloomberg/ntf-core
REF "${VERSION}"
SHA512 57662d2dd105b2781e580623c26cd7bde84fce8374bbd70c18595a5f6934869b7a570f0d3c2e17e115f6c7eb1067541f8d19523639815b285324061f807d3179
SHA512 f30ffc438c656e5bbababa87c8dfe40ac35ffd0962b6fba26c41246aeedc883a4949a3c19ee941cf9d7a54c504d8feb3dcd46b2eb9f4078dcb91e8cb4c60d614
HEAD_REF main
PATCHES dont-use-lib64.patch
)

# ntf-core requires debugger information to for dev tooling purposes, so we just fake it
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS "-DNTF_BUILD_WITH_USAGE_EXAMPLES=0"
"-DNTF_TOOLCHAIN_DEBUGGER_PATH=NOT-FOUND"
OPTIONS
"-DNTF_BUILD_WITH_USAGE_EXAMPLES=0"
"-DNTF_TOOLCHAIN_DEBUGGER_PATH=NOT-FOUND"
-DNTF_BUILD_SYSTEM=ON
)

vcpkg_cmake_build()
Expand All @@ -26,7 +28,7 @@ function(fix_pkgconfig_ufid lib_dir ufid pc_name)
set(build_mode "debug")
endif()

vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/${lib_dir}/cmake/${pc_name}Targets-${build_mode}.cmake" "/${ufid}" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/${lib_dir}/cmake/${pc_name}/${pc_name}-Targets-${build_mode}.cmake" "/${ufid}" "")
endfunction()

function(fix_install_dir lib_dir ufid)
Expand All @@ -42,23 +44,11 @@ endfunction()
fix_install_dir("lib" "opt_exc_mt")
fix_install_dir("debug/lib" "dbg_exc_mt")

# The ntf-core build installs CMake configs for both targets into share/ntf-core, which
# find_package will not be able to find on its own. We use vcpkg_cmake_config_fixup to install
# CMake configs into share/nts, and then move the ntc CMake configs into share/ntc with this
# function.
function(ntf_core_fixup_ntc_config)
set(nts_share "${CURRENT_PACKAGES_DIR}/share/nts")
set(ntc_share "${CURRENT_PACKAGES_DIR}/share/ntc")
file(GLOB ntc_configs "${nts_share}/ntc*.cmake")
file(MAKE_DIRECTORY "${ntc_share}")
foreach(ntc_config IN LISTS ntc_configs)
file(RELATIVE_PATH ntc_config_rel "${nts_share}" "${ntc_config}")
file(RENAME "${ntc_config}" "${ntc_share}/${ntc_config_rel}")
endforeach()
endfunction()

vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake" PACKAGE_NAME nts)
ntf_core_fixup_ntc_config()
file(RENAME "${CURRENT_PACKAGES_DIR}/share/nts" "${CURRENT_PACKAGES_DIR}/share/nts_original")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/nts_original/ntc" "${CURRENT_PACKAGES_DIR}/share/ntc")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/nts_original/nts" "${CURRENT_PACKAGES_DIR}/share/nts")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/nts_original")

# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
Expand Down
3 changes: 1 addition & 2 deletions ports/ntf-core/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "ntf-core",
"version": "2.1.0",
"port-version": 1,
"version": "2.5.4",
"description": "The Network Transport Framework: Core Libraries",
"license": "Apache-2.0",
"dependencies": [
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6481,8 +6481,8 @@
"port-version": 3
},
"ntf-core": {
"baseline": "2.1.0",
"port-version": 1
"baseline": "2.5.4",
"port-version": 0
},
"nu-book-zxing-cpp": {
"baseline": "2.3.0",
Expand Down
29 changes: 17 additions & 12 deletions versions/n-/ntf-core.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"versions": [
{
"version": "2.1.0",
"port-version": 1,
"git-tree": "1e517e2393650769e701f62317e905a3f1776367"
},
{
"version": "2.1.0",
"port-version": 0,
"git-tree": "eabeb2b30205bef45e72e4a069f21d71797f3f5d"
}
]
"versions": [
{
"git-tree": "d1e73e8c96422d0e07f45242bcdf38ed59215871",
"version": "2.5.4",
"port-version": 0
},
{
"git-tree": "1e517e2393650769e701f62317e905a3f1776367",
"version": "2.1.0",
"port-version": 1
},
{
"git-tree": "eabeb2b30205bef45e72e4a069f21d71797f3f5d",
"version": "2.1.0",
"port-version": 0
}
]
}

0 comments on commit 56cf249

Please sign in to comment.