Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

libfido2: add macOS support

* pass IOKit to libfido2
* Add a patch so that cmake uses lld flags when linking
* Upgrade from 1.3.0 to 1.3.1 (based off #80781)
* Specify CMAKE_INSTALL_LIBDIR so that the demo binaries link
correctly on macOS and libfido2.pc specifies correct arguments

(cherry picked from commit 099359afc72d34255b78cdcc6291b77b2e7ed2f9)

authored by

Artemis Tosini and committed by
Pavol Rusnak
9ea34a5b f06ab62d

+25 -7
+11 -6
pkgs/development/libraries/libfido2/default.nix
··· 1 - { stdenv, fetchurl, cmake, pkgconfig, libcbor, libressl, udev }: 1 + { stdenv, fetchurl, cmake, pkgconfig, libcbor, libressl, udev, IOKit }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "libfido2"; 5 - version = "1.3.0"; 5 + version = "1.3.1"; 6 6 src = fetchurl { 7 7 url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz"; 8 - sha256 = "1izyl3as9rn7zcxpsvgngjwr55gli5gy822ac3ajzm65qiqkcbhb"; 8 + sha256 = "0hdgxbmjbnm9kjwc07nrl2zy87qclvb3rzvdwr5iw35n2qhf4dds"; 9 9 }; 10 10 11 11 nativeBuildInputs = [ cmake pkgconfig ]; 12 - buildInputs = [ libcbor libressl ] ++ stdenv.lib.optionals stdenv.isLinux [ udev ]; 12 + buildInputs = [ libcbor libressl ] 13 + ++ stdenv.lib.optionals stdenv.isLinux [ udev ] 14 + ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ]; 13 15 14 - cmakeFlags = [ "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d" ]; 16 + patches = [ ./detect_apple_ld.patch ]; 17 + 18 + cmakeFlags = [ "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d" 19 + "-DCMAKE_INSTALL_LIBDIR=lib" ]; 15 20 16 21 meta = with stdenv.lib; { 17 22 description = '' ··· 20 25 homepage = https://github.com/Yubico/libfido2; 21 26 license = licenses.bsd2; 22 27 maintainers = with maintainers; [ dtzWill ]; 23 - platforms = platforms.linux; 28 + platforms = platforms.unix; 24 29 }; 25 30 }
+11
pkgs/development/libraries/libfido2/detect_apple_ld.patch
··· 1 + --- a/CMakeLists.txt 2020-02-19 17:21:59.000000000 +0000 2 + +++ b/CMakeLists.txt 2020-02-23 15:57:34.241115306 +0000 3 + @@ -296,7 +296,7 @@ 4 + endif() 5 + 6 + # export list 7 + -if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang") 8 + +if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") 9 + # clang + lld 10 + string(CONCAT CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} 11 + " -exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/src/export.llvm")
+3 -1
pkgs/top-level/all-packages.nix
··· 12414 12414 12415 12415 libfakekey = callPackage ../development/libraries/libfakekey { }; 12416 12416 12417 - libfido2 = callPackage ../development/libraries/libfido2 { }; 12417 + libfido2 = callPackage ../development/libraries/libfido2 { 12418 + inherit (darwin.apple_sdk.frameworks) IOKit; 12419 + }; 12418 12420 12419 12421 libfilezilla = callPackage ../development/libraries/libfilezilla { }; 12420 12422