diff --git a/ports/nsync/export-targets.patch b/ports/nsync/export-targets.patch new file mode 100644 index 0000000000..cbae3d366b --- /dev/null +++ b/ports/nsync/export-targets.patch @@ -0,0 +1,36 @@ +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 unofficial-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 unofficial-nsyncConfig + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development) + ++install(EXPORT unofficial-nsyncConfig ++ NAMESPACE unofficial::nsync:: ++ DESTINATION share/unofficial-nsync ++) ++ + set (NSYNC_INCLUDES + "public/nsync.h" + "public/nsync_atomic.h" diff --git a/ports/nsync/portfile.cmake b/ports/nsync/portfile.cmake index 65abd9c87f..fe2ff4d515 100644 --- a/ports/nsync/portfile.cmake +++ b/ports/nsync/portfile.cmake @@ -10,16 +10,18 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-install.patch + export-targets.patch ) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DNSYNC_ENABLE_TESTS=OFF ) -vcpkg_install_cmake() +vcpkg_cmake_install() vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-nsync CONFIG_PATH share/unofficial-nsync) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/nsync/vcpkg.json b/ports/nsync/vcpkg.json index 292da006c9..54c24f43f1 100644 --- a/ports/nsync/vcpkg.json +++ b/ports/nsync/vcpkg.json @@ -1,6 +1,18 @@ { "name": "nsync", "version": "1.24.0", + "port-version": 1, "description": "nsync is a C library that exports various synchronization primitives, such as mutexes", - "homepage": "https://github.com/google/nsync" + "homepage": "https://github.com/google/nsync", + "license": "Apache-2.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] } diff --git a/versions/baseline.json b/versions/baseline.json index ebb32b7506..ba5357f795 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4862,7 +4862,7 @@ }, "nsync": { "baseline": "1.24.0", - "port-version": 0 + "port-version": 1 }, "nt-wrapper": { "baseline": "2019-08-10", diff --git a/versions/n-/nsync.json b/versions/n-/nsync.json index 44af83133d..e88b93ba9e 100644 --- a/versions/n-/nsync.json +++ b/versions/n-/nsync.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f2333cb932309608aa164aadaacb8d4592c71068", + "version": "1.24.0", + "port-version": 1 + }, { "git-tree": "65f07dbc95a609c95de7befffbf37da598652cee", "version": "1.24.0",