diff options
Diffstat (limited to 'vcpkg/ports/libfido2')
| -rw-r--r-- | vcpkg/ports/libfido2/dependencies.diff | 58 | ||||
| -rw-r--r-- | vcpkg/ports/libfido2/flags.diff | 31 | ||||
| -rw-r--r-- | vcpkg/ports/libfido2/portfile.cmake | 44 | ||||
| -rw-r--r-- | vcpkg/ports/libfido2/vcpkg.json | 17 |
4 files changed, 150 insertions, 0 deletions
diff --git a/vcpkg/ports/libfido2/dependencies.diff b/vcpkg/ports/libfido2/dependencies.diff new file mode 100644 index 0000000..ce5eebc --- /dev/null +++ b/vcpkg/ports/libfido2/dependencies.diff @@ -0,0 +1,58 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0f8aa8b..1f5e651 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -170,7 +170,13 @@ if(UNIX) + endif() + + +-if(MSVC) ++find_package(libcbor CONFIG REQUIRED) ++set(CBOR_LIBRARIES libcbor::libcbor) ++find_package(ZLIB REQUIRED) ++set(ZLIB_LIBRARIES ZLIB::ZLIB) ++find_package(OpenSSL REQUIRED) ++set(CRYPTO_LIBRARIES OpenSSL::Crypto) ++if(0) + if((NOT CBOR_INCLUDE_DIRS) OR (NOT CBOR_LIBRARY_DIRS) OR + (NOT CRYPTO_INCLUDE_DIRS) OR (NOT CRYPTO_LIBRARY_DIRS) OR + (NOT ZLIB_INCLUDE_DIRS) OR (NOT ZLIB_LIBRARY_DIRS)) +@@ -195,7 +201,7 @@ if(MSVC) + if(NOT CRYPTO_DLL) + set(CRYPTO_DLL crypto) + endif() +- ++elseif(MSVC) + set(MSVC_DISABLED_WARNINGS_LIST + "C4152" # nonstandard extension used: function/data pointer + # conversion in expression; +@@ -221,7 +227,7 @@ if(MSVC) + add_definitions(-DUSE_WINHELLO) + endif() + set(NFC_LINUX OFF) +-else() ++elseif(0) + include(FindPkgConfig) + pkg_search_module(CBOR libcbor) + pkg_search_module(CRYPTO libcrypto) +@@ -243,7 +249,7 @@ else() + if(NOT CRYPTO_LIBRARIES) + set(CRYPTO_LIBRARIES "crypto") + endif() +- ++elseif(1) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + pkg_search_module(UDEV libudev REQUIRED) + set(UDEV_NAME "udev") +diff --git a/src/libfido2.pc.in b/src/libfido2.pc.in +index 03d0606..1a299ae 100644 +--- a/src/libfido2.pc.in ++++ b/src/libfido2.pc.in +@@ -7,6 +7,6 @@ Name: @PROJECT_NAME@ + Description: A FIDO2 library + URL: https://github.com/yubico/libfido2 + Version: @FIDO_VERSION@ +-Requires: libcrypto ++Requires.private: libcrypto libcbor zlib + Libs: -L${libdir} -lfido2 + Cflags: -I${includedir} diff --git a/vcpkg/ports/libfido2/flags.diff b/vcpkg/ports/libfido2/flags.diff new file mode 100644 index 0000000..7dd1f02 --- /dev/null +++ b/vcpkg/ports/libfido2/flags.diff @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c5b0f3..b8178fa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -219,6 +219,10 @@ elseif(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Od /Z7 /guard:cf /sdl /RTCcsu") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi /guard:cf /sdl") ++ add_definitions("-D_CRT_SECURE_NO_WARNINGS" "-D_CRT_NONSTDC_NO_DEPRECATE") ++ string(REPLACE " -WX" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") ++ string(REPLACE " /sdl" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") ++ string(REPLACE " /sdl" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + if(USE_WINHELLO) + add_definitions(-DUSE_WINHELLO) + endif() +@@ -303,7 +307,6 @@ elseif(1) + + add_compile_options(-Wall) + add_compile_options(-Wextra) +- add_compile_options(-Werror) + add_compile_options(-Wshadow) + add_compile_options(-Wcast-qual) + add_compile_options(-Wwrite-strings) +@@ -311,7 +314,6 @@ elseif(1) + add_compile_options(-Wbad-function-cast) + add_compile_options(-Wimplicit-fallthrough) + add_compile_options(-pedantic) +- add_compile_options(-pedantic-errors) + + set(EXTRA_CFLAGS "-Wconversion -Wsign-conversion") + diff --git a/vcpkg/ports/libfido2/portfile.cmake b/vcpkg/ports/libfido2/portfile.cmake new file mode 100644 index 0000000..9cf900f --- /dev/null +++ b/vcpkg/ports/libfido2/portfile.cmake @@ -0,0 +1,44 @@ +if(VCPKG_TARGET_IS_LINUX)
+ message(
+"${PORT} currently requires the following libraries from the system package manager:
+ libudev-dev
+These can be installed on Ubuntu systems via:
+ sudo apt install libudev-dev"
+ )
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO Yubico/libfido2
+ REF ${VERSION}
+ SHA512 46ef14d9215d13608eb511ea4d63494758eb2464e75a00411e1afa2546f06e4cd142a08a59f1ee78967c962290c54889014f58608d4b58d48ba590e5805d3b04
+ HEAD_REF main
+ PATCHES
+ dependencies.diff
+ flags.diff
+)
+
+vcpkg_find_acquire_program(PKGCONFIG)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_MANPAGES=OFF
+ -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
+ -DBUILD_TESTS=OFF
+ -DBUILD_TOOLS=OFF
+ "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
+ MAYBE_UNUSED_VARIABLES
+ PKG_CONFIG_EXECUTABLE
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/libfido2/vcpkg.json b/vcpkg/ports/libfido2/vcpkg.json new file mode 100644 index 0000000..d289df3 --- /dev/null +++ b/vcpkg/ports/libfido2/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "libfido2", + "version": "1.16.0", + "description": "Provides library functionality to communicate with a FIDO device over USB, and to verify attestation and assertion signatures.", + "homepage": "https://developers.yubico.com/libfido2/", + "license": "BSD-2-Clause", + "supports": "!android & !uwp", + "dependencies": [ + "libcbor", + "openssl", + { + "name": "vcpkg-cmake", + "host": true + }, + "zlib" + ] +} |