Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions pkgs/development/libraries/libfido2/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
{ stdenv, fetchurl, cmake, pkgconfig, libcbor, libressl, udev }:
{ stdenv, fetchurl, cmake, pkgconfig, libcbor, libressl, udev, IOKit }:

stdenv.mkDerivation rec {
pname = "libfido2";
version = "1.3.0";
version = "1.3.1";
src = fetchurl {
url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
sha256 = "1izyl3as9rn7zcxpsvgngjwr55gli5gy822ac3ajzm65qiqkcbhb";
sha256 = "0hdgxbmjbnm9kjwc07nrl2zy87qclvb3rzvdwr5iw35n2qhf4dds";
};

nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ libcbor libressl ] ++ stdenv.lib.optionals stdenv.isLinux [ udev ];
buildInputs = [ libcbor libressl ]
++ stdenv.lib.optionals stdenv.isLinux [ udev ]
++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ];

cmakeFlags = [ "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d" ];
patches = [ ./detect_apple_ld.patch ];

cmakeFlags = [ "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d"
"-DCMAKE_INSTALL_LIBDIR=lib" ];

meta = with stdenv.lib; {
description = ''
Expand All @@ -20,6 +25,6 @@ stdenv.mkDerivation rec {
homepage = https://github.com/Yubico/libfido2;
license = licenses.bsd2;
maintainers = with maintainers; [ dtzWill ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
11 changes: 11 additions & 0 deletions pkgs/development/libraries/libfido2/detect_apple_ld.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/CMakeLists.txt 2020-02-19 17:21:59.000000000 +0000
+++ b/CMakeLists.txt 2020-02-23 15:57:34.241115306 +0000
@@ -296,7 +296,7 @@
endif()

# export list
-if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
# clang + lld
string(CONCAT CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}
" -exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/src/export.llvm")
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12468,7 +12468,9 @@ in

libfakekey = callPackage ../development/libraries/libfakekey { };

libfido2 = callPackage ../development/libraries/libfido2 { };
libfido2 = callPackage ../development/libraries/libfido2 {
inherit (darwin.apple_sdk.frameworks) IOKit;
};

libfilezilla = callPackage ../development/libraries/libfilezilla { };

Expand Down