From c6dd96028a33d444d4215f7d9b80fabf4c6477ec Mon Sep 17 00:00:00 2001 From: luncliff Date: Sat, 10 Aug 2024 23:51:30 +0900 Subject: [PATCH 1/4] [nsync] update to 1.28.1 * https://github.com/google/nsync/releases/tag/1.28.1 --- ports/nsync/export-targets.patch | 36 ------------------- .../{fix-install.patch => fix-cmake.patch} | 19 +++++----- ports/nsync/portfile.cmake | 15 ++++---- ports/nsync/vcpkg.json | 2 +- 4 files changed, 17 insertions(+), 55 deletions(-) delete mode 100644 ports/nsync/export-targets.patch rename ports/nsync/{fix-install.patch => fix-cmake.patch} (54%) diff --git a/ports/nsync/export-targets.patch b/ports/nsync/export-targets.patch deleted file mode 100644 index b28f222d..00000000 --- a/ports/nsync/export-targets.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 328f9b6..6a71b5b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -41,6 +41,9 @@ function (set_cpp_target tgtname files) - "${PROJECT_SOURCE_DIR}/platform/c++11.futex" - ) - endif () -+ -+ target_include_directories("${tgtname}" PUBLIC $) -+ - - target_compile_definitions ("${tgtname}" PRIVATE "${NSYNC_CPP_DEFINITIONS}") - -@@ -399,14 +402,19 @@ endif () - # By default, install nsync always - # set (CMAKE_SKIP_INSTALL_ALL_DEPENDENCY ON) - --install (TARGETS nsync -+install (TARGETS nsync EXPORT nsyncConfig - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development) - --install (TARGETS nsync_cpp OPTIONAL -+install (TARGETS nsync_cpp OPTIONAL EXPORT nsyncConfig - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development) - -+install(EXPORT nsyncConfig -+ NAMESPACE nsync:: -+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nsync -+) -+ - set (NSYNC_INCLUDES - "public/nsync.h" - "public/nsync_atomic.h" diff --git a/ports/nsync/fix-install.patch b/ports/nsync/fix-cmake.patch similarity index 54% rename from ports/nsync/fix-install.patch rename to ports/nsync/fix-cmake.patch index efe560d1..3029ff15 100644 --- a/ports/nsync/fix-install.patch +++ b/ports/nsync/fix-cmake.patch @@ -1,32 +1,31 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6b1f1dc..328f9b6 100644 +index fcc3f41..610710f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -80,7 +80,7 @@ set (NSYNC_OS_CPP_SRC - # https://cmake.org/cmake/help/v3.1/policy/CMP0054.html +@@ -88,7 +88,7 @@ if ("${CMAKE_C_COMPILER_ID}X" STREQUAL "MSVCX") + endif () # Pick the include directory for the operating system. -if ("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsX") -+if ("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsX" OR "${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsStoreX") ++if (("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsX") OR ("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsStoreX")) include_directories ("${PROJECT_SOURCE_DIR}/platform/win32") set (NSYNC_CPP_FLAGS "/TP") -@@ -230,7 +230,7 @@ elseif (("${CMAKE_SYSTEM_PROCESSOR}X" STREQUAL "ppc64X")) +@@ -232,7 +232,7 @@ elseif (("${CMAKE_SYSTEM_PROCESSOR}X" STREQUAL "ppc64X")) endif () # Windows uses some include files from the posix directory also. -if ("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsX") -+if ("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsX" OR "${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsStoreX") ++if (("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsX") OR ("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsStoreX")) include_directories ("${PROJECT_SOURCE_DIR}/platform/posix") endif () -@@ -396,7 +396,8 @@ if (NSYNC_ENABLE_TESTS) +@@ -398,7 +398,7 @@ if (NSYNC_ENABLE_TESTS) endforeach (t) endif () -set (CMAKE_SKIP_INSTALL_ALL_DEPENDENCY ON) -+# By default, install nsync always -+# set (CMAKE_SKIP_INSTALL_ALL_DEPENDENCY ON) ++set (CMAKE_SKIP_INSTALL_ALL_DEPENDENCY FALSE) - install (TARGETS nsync + install (TARGETS nsync EXPORT nsync LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries diff --git a/ports/nsync/portfile.cmake b/ports/nsync/portfile.cmake index f6cc247c..e0a25a0c 100644 --- a/ports/nsync/portfile.cmake +++ b/ports/nsync/portfile.cmake @@ -5,12 +5,11 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/nsync - REF 1.26.0 - SHA512 8aa49997f100f161f0f32e99c9004ee845d7b16c1391e7eb62eea0897e2f91b7f9e5181055fdca637518751b6b26e16a1cd53e45adceda145285752c4b74f3bf + REF "${VERSION}" + SHA512 2706501a45396172b5b39716ba29ea3ef3d8f5fdd9b0e0b22e6217d93ed64eb3cce4e5610818867ae43ce5fc677581932e67507425299e8b6a8353369eb79ecf HEAD_REF master PATCHES - fix-install.patch - export-targets.patch + fix-cmake.patch ) vcpkg_cmake_configure( @@ -19,9 +18,9 @@ vcpkg_cmake_configure( -DNSYNC_ENABLE_TESTS=OFF ) vcpkg_cmake_install() -vcpkg_copy_pdbs() - -vcpkg_cmake_config_fixup(PACKAGE_NAME nsync CONFIG_PATH share/nsync) +vcpkg_cmake_config_fixup(PACKAGE_NAME nsync CONFIG_PATH lib/cmake/nsync DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(PACKAGE_NAME nsync_cpp CONFIG_PATH lib/cmake/nsync_cpp) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/nsync/vcpkg.json b/ports/nsync/vcpkg.json index 2ec424ee..8003f169 100644 --- a/ports/nsync/vcpkg.json +++ b/ports/nsync/vcpkg.json @@ -1,6 +1,6 @@ { "name": "nsync", - "version": "1.26.0", + "version": "1.28.1", "description": "nsync is a C library that exports various synchronization primitives, such as mutexes", "homepage": "https://github.com/google/nsync", "license": "Apache-2.0", From ebd17441e4832dc4fa03b7600072f3950c270d21 Mon Sep 17 00:00:00 2001 From: luncliff Date: Sat, 10 Aug 2024 23:51:44 +0900 Subject: [PATCH 2/4] [nsync] update baseline --- versions/baseline.json | 2 +- versions/n-/nsync.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 75184e12..824d35c3 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -101,7 +101,7 @@ "port-version": 0 }, "nsync": { - "baseline": "1.26.0", + "baseline": "1.28.1", "port-version": 0 }, "nvidia-cnmem": { diff --git a/versions/n-/nsync.json b/versions/n-/nsync.json index 2e91718c..d9600014 100644 --- a/versions/n-/nsync.json +++ b/versions/n-/nsync.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c5a83a6c92723488257cdac7a7752fc54d9298bc", + "version": "1.28.1", + "port-version": 0 + }, { "git-tree": "94bea01a643709904887893487309b35e962bbdd", "version": "1.26.0", From 33d32350c2ce3316afa4e23b0f5b18d1f148464c Mon Sep 17 00:00:00 2001 From: luncliff Date: Sun, 11 Aug 2024 02:11:05 +0900 Subject: [PATCH 3/4] [onnxruntime] try fix with `find_package(nsync_cpp)` --- ports/onnxruntime/onnxruntime_external_deps.cmake | 9 ++++++++- ports/onnxruntime/vcpkg.json | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/onnxruntime/onnxruntime_external_deps.cmake b/ports/onnxruntime/onnxruntime_external_deps.cmake index d6a1f16e..89cf02df 100644 --- a/ports/onnxruntime/onnxruntime_external_deps.cmake +++ b/ports/onnxruntime/onnxruntime_external_deps.cmake @@ -94,12 +94,19 @@ if (NOT WIN32) google_nsync URL ${DEP_URL_google_nsync} URL_HASH SHA1=${DEP_SHA1_google_nsync} - FIND_PACKAGE_ARGS NAMES nsync unofficial-nsync + FIND_PACKAGE_ARGS NAMES nsync_cpp nsync unofficial-nsync CONFIG ) #nsync tests failed on Mac Build set(NSYNC_ENABLE_TESTS OFF CACHE BOOL "" FORCE) onnxruntime_fetchcontent_makeavailable(google_nsync) + find_package(nsync_cpp CONFIG) + if(nsync_cpp_FOUND) + if(NOT TARGET nsync::nsync_cpp) + message(STATUS "Aliasing nsync_cpp to nsync::nsync_cpp") + add_library(nsync::nsync_cpp ALIAS nsync_cpp) + endif() + endif() if (google_nsync_SOURCE_DIR) add_library(nsync::nsync_cpp ALIAS nsync_cpp) target_include_directories(nsync_cpp PUBLIC ${google_nsync_SOURCE_DIR}/public) diff --git a/ports/onnxruntime/vcpkg.json b/ports/onnxruntime/vcpkg.json index cb2ae64f..1cddd2a3 100644 --- a/ports/onnxruntime/vcpkg.json +++ b/ports/onnxruntime/vcpkg.json @@ -1,6 +1,7 @@ { "name": "onnxruntime", "version-semver": "1.18.1", + "port-version": 1, "description": "ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator", "homepage": "https://onnxruntime.ai/", "license": "MIT", From a231df3d70eaee31f41e3326042124d0fc3a5e77 Mon Sep 17 00:00:00 2001 From: luncliff Date: Sun, 11 Aug 2024 20:23:04 +0900 Subject: [PATCH 4/4] [onnxruntime] correcting nsync_cpp search --- ports/onnxruntime/onnxruntime_external_deps.cmake | 3 ++- versions/baseline.json | 2 +- versions/o-/onnxruntime.json | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ports/onnxruntime/onnxruntime_external_deps.cmake b/ports/onnxruntime/onnxruntime_external_deps.cmake index 89cf02df..d6f7ac92 100644 --- a/ports/onnxruntime/onnxruntime_external_deps.cmake +++ b/ports/onnxruntime/onnxruntime_external_deps.cmake @@ -107,8 +107,9 @@ if (NOT WIN32) add_library(nsync::nsync_cpp ALIAS nsync_cpp) endif() endif() - if (google_nsync_SOURCE_DIR) + if (google_nsync_SOURCE_DIR AND NOT TARGET nsync::nsync_cpp) add_library(nsync::nsync_cpp ALIAS nsync_cpp) + message(STATUS "Aliasing nsync_cpp to nsync::nsync_cpp") target_include_directories(nsync_cpp PUBLIC ${google_nsync_SOURCE_DIR}/public) endif() if(TARGET unofficial::nsync::nsync_cpp AND NOT TARGET nsync::nsync_cpp) diff --git a/versions/baseline.json b/versions/baseline.json index 824d35c3..9850d42c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -138,7 +138,7 @@ }, "onnxruntime": { "baseline": "1.18.1", - "port-version": 0 + "port-version": 1 }, "opencl": { "baseline": "v2024.05.08", diff --git a/versions/o-/onnxruntime.json b/versions/o-/onnxruntime.json index cf70f771..6290e12c 100644 --- a/versions/o-/onnxruntime.json +++ b/versions/o-/onnxruntime.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8641a25170bba46fe4fc7c1cc873efa444ce5d04", + "version-semver": "1.18.1", + "port-version": 1 + }, { "git-tree": "afebd79a5253d8547428a61094a2a39e4b2f0a9a", "version-semver": "1.18.1",