git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #80909 from artemist/libfido2

libfido2: add macOS support

commitf5d2675512dbd267c7f026419f16b3c2e46ab4f9 authorMarek Mahut <marek.mahut@gmail.com> dateMon 24 Feb 2020, 18:44 (7 years ago) parent4080e79099359a
3 files changed+25−7
pkgs/development/libraries/libfido2/default.nix+11−6 pkgs/development/libraries/libfido2/detect_apple_ld.patch+11 pkgs/top-level/all-packages.nix+3−1
pkgs/development/libraries/libfido2/default.nix+11−6
@@ -1,17 +1,22 @@
1−{ stdenv, fetchurl, cmake, pkgconfig, libcbor, libressl, udev }:
1+{ stdenv, fetchurl, cmake, pkgconfig, libcbor, libressl, udev, IOKit }:
22
33stdenv.mkDerivation rec {
44 pname = "libfido2";
5− version = "1.3.0";
5+ version = "1.3.1";
66 src = fetchurl {
77 url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
8− sha256 = "1izyl3as9rn7zcxpsvgngjwr55gli5gy822ac3ajzm65qiqkcbhb";
8+ sha256 = "0hdgxbmjbnm9kjwc07nrl2zy87qclvb3rzvdwr5iw35n2qhf4dds";
99 };
1010
1111 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 ];
1315
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" ];
1520
1621 meta = with stdenv.lib; {
1722 description = ''
@@ -20,6 +25,6 @@ stdenv.mkDerivation rec {
2025 homepage = https://github.com/Yubico/libfido2;
2126 license = licenses.bsd2;
2227 maintainers = with maintainers; [ dtzWill ];
23− platforms = platforms.linux;
28+ platforms = platforms.unix;
2429 };
2530}
pkgs/development/libraries/libfido2/detect_apple_ld.patchnew file+11
@@ -0,0 +1,11 @@
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")
pkgs/top-level/all-packages.nix+3−1
@@ -12474,7 +12474,9 @@ in
1247412474
1247512475 libfakekey = callPackage ../development/libraries/libfakekey { };
1247612476
12477− libfido2 = callPackage ../development/libraries/libfido2 { };
12477+ libfido2 = callPackage ../development/libraries/libfido2 {
12478+ inherit (darwin.apple_sdk.frameworks) IOKit;
12479+ };
1247812480
1247912481 libfilezilla = callPackage ../development/libraries/libfilezilla { };
1248012482