diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/nsync | |
Diffstat (limited to 'vcpkg/ports/nsync')
| -rw-r--r-- | vcpkg/ports/nsync/add-include-chrono.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/nsync/fix-install.patch | 32 | ||||
| -rw-r--r-- | vcpkg/ports/nsync/portfile.cmake | 29 | ||||
| -rw-r--r-- | vcpkg/ports/nsync/vcpkg.json | 17 |
4 files changed, 90 insertions, 0 deletions
diff --git a/vcpkg/ports/nsync/add-include-chrono.patch b/vcpkg/ports/nsync/add-include-chrono.patch new file mode 100644 index 0000000..69c6625 --- /dev/null +++ b/vcpkg/ports/nsync/add-include-chrono.patch @@ -0,0 +1,12 @@ +diff --git a/platform/c++11/platform.h b/platform/c++11/platform.h +index 2c80e0b..1468fab 100644 +--- a/platform/c++11/platform.h ++++ b/platform/c++11/platform.h +@@ -16,6 +16,7 @@ + #define NSYNC_PLATFORM_CPP11_PLATFORM_H_ + + /* These C header files are in "C compatibility headers" in C++11. */ ++#include <chrono> + #include <string.h> + #include <errno.h> + #include <stdlib.h> diff --git a/vcpkg/ports/nsync/fix-install.patch b/vcpkg/ports/nsync/fix-install.patch new file mode 100644 index 0000000..3d7917d --- /dev/null +++ b/vcpkg/ports/nsync/fix-install.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fcc3f41..18859e1 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 $<INSTALL_INTERFACE:include>) ++ + + target_compile_definitions ("${tgtname}" PRIVATE "${NSYNC_CPP_DEFINITIONS}") + +@@ -88,7 +91,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") + include_directories ("${PROJECT_SOURCE_DIR}/platform/win32") + set (NSYNC_CPP_FLAGS "/TP") + +@@ -232,7 +235,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") + include_directories ("${PROJECT_SOURCE_DIR}/platform/posix") + endif () + diff --git a/vcpkg/ports/nsync/portfile.cmake b/vcpkg/ports/nsync/portfile.cmake new file mode 100644 index 0000000..6fff6f4 --- /dev/null +++ b/vcpkg/ports/nsync/portfile.cmake @@ -0,0 +1,29 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/nsync + REF "${VERSION}" + SHA512 fdcd61eb686ca6d6804d82837fcd33ddee54d6b2aeb7bc20cdff8c5bd2a75f87b724f72c7e835459a1a82ee8bed3d6da5e4c111b3bca22545c6e037f129839f2 + HEAD_REF master + PATCHES + fix-install.patch + add-include-chrono.patch # https://github.com/google/nsync/pull/25 +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DNSYNC_ENABLE_TESTS=OFF +) +vcpkg_cmake_build() +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/nsync_cpp PACKAGE_NAME nsync_cpp DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/nsync) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/nsync/vcpkg.json b/vcpkg/ports/nsync/vcpkg.json new file mode 100644 index 0000000..d0c880d --- /dev/null +++ b/vcpkg/ports/nsync/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "nsync", + "version": "1.30.0", + "description": "nsync is a C library that exports various synchronization primitives, such as mutexes", + "homepage": "https://github.com/google/nsync", + "license": "Apache-2.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |