aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ntf-core
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ntf-core
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/ntf-core')
-rw-r--r--vcpkg/ports/ntf-core/dont-use-lib64.patch30
-rw-r--r--vcpkg/ports/ntf-core/portfile.cmake61
-rw-r--r--vcpkg/ports/ntf-core/usage9
-rw-r--r--vcpkg/ports/ntf-core/vcpkg.json17
4 files changed, 117 insertions, 0 deletions
diff --git a/vcpkg/ports/ntf-core/dont-use-lib64.patch b/vcpkg/ports/ntf-core/dont-use-lib64.patch
new file mode 100644
index 0000000..26c9104
--- /dev/null
+++ b/vcpkg/ports/ntf-core/dont-use-lib64.patch
@@ -0,0 +1,30 @@
+diff --git a/repository.cmake b/repository.cmake
+index f02ba90..4dbd81f 100644
+--- a/repository.cmake
++++ b/repository.cmake
+@@ -3151,11 +3151,7 @@ function (ntf_adapter_end)
+ set(target_output_name "${target}")
+ endif()
+
+- 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 "")
+- 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
diff --git a/vcpkg/ports/ntf-core/portfile.cmake b/vcpkg/ports/ntf-core/portfile.cmake
new file mode 100644
index 0000000..483b041
--- /dev/null
+++ b/vcpkg/ports/ntf-core/portfile.cmake
@@ -0,0 +1,61 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO bloomberg/ntf-core
+ REF "${VERSION}"
+ 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"
+ -DNTF_BUILD_SYSTEM=ON
+)
+
+vcpkg_cmake_build()
+
+vcpkg_cmake_install()
+
+function(fix_pkgconfig_ufid lib_dir ufid pc_name)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/${lib_dir}/pkgconfig/${pc_name}.pc" "/${ufid}" "")
+ if ("${ufid}" MATCHES opt)
+ set(build_mode "release")
+ else()
+ set(build_mode "debug")
+ endif()
+
+ 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)
+ message(STATUS "Fixing ufid layout for ${CURRENT_PACKAGES_DIR}/${lib_dir}/${ufid}")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/${lib_dir}/${ufid}" "${CURRENT_PACKAGES_DIR}/tmp")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/${lib_dir}")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/tmp" "${CURRENT_PACKAGES_DIR}/${lib_dir}")
+
+ fix_pkgconfig_ufid("${lib_dir}" "${ufid}" "nts")
+ fix_pkgconfig_ufid("${lib_dir}" "${ufid}" "ntc")
+endfunction()
+
+fix_install_dir("lib" "opt_exc_mt")
+fix_install_dir("debug/lib" "dbg_exc_mt")
+
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake" PACKAGE_NAME nts)
+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")
+vcpkg_fixup_pkgconfig()
+
+# Usage
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
diff --git a/vcpkg/ports/ntf-core/usage b/vcpkg/ports/ntf-core/usage
new file mode 100644
index 0000000..e20af2f
--- /dev/null
+++ b/vcpkg/ports/ntf-core/usage
@@ -0,0 +1,9 @@
+The package ntf-core provides the CMake targets:
+
+ # Blocking and non-blocking sockets for network programming
+ find_package(nts CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE nts)
+
+ # Asynchronous sockets, timers, event loops, and thread pools for network programming
+ find_package(ntc CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE ntc)
diff --git a/vcpkg/ports/ntf-core/vcpkg.json b/vcpkg/ports/ntf-core/vcpkg.json
new file mode 100644
index 0000000..a888b57
--- /dev/null
+++ b/vcpkg/ports/ntf-core/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "ntf-core",
+ "version": "2.5.4",
+ "description": "The Network Transport Framework: Core Libraries",
+ "license": "Apache-2.0",
+ "dependencies": [
+ "bde",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}