Merge pull request #179472 from bootstrap-prime/staging

libfido2: 1.10.0 -> 1.11.0 and refactor to enable NFC support via pcsc
This commit is contained in:
Jan Tojnar 2022-08-05 22:08:02 +02:00 committed by GitHub
commit 29d0b1735f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 17 deletions

View file

@ -5,7 +5,7 @@
, pkg-config , pkg-config
, expat , expat
, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic , enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic
, systemd , systemdMinimal
, audit , audit
, libapparmor , libapparmor
, dbus , dbus
@ -75,7 +75,7 @@ stdenv.mkDerivation rec {
libX11 libX11
libICE libICE
libSM libSM
]) ++ lib.optional enableSystemd systemd ]) ++ lib.optional enableSystemd systemdMinimal
++ lib.optionals stdenv.isLinux [ audit libapparmor ]; ++ lib.optionals stdenv.isLinux [ audit libapparmor ];
# ToDo: optional selinux? # ToDo: optional selinux?
@ -94,7 +94,7 @@ stdenv.mkDerivation rec {
"--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user" "--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user"
] ++ lib.optional (!x11Support) "--without-x" ] ++ lib.optional (!x11Support) "--without-x"
++ lib.optionals stdenv.isLinux [ "--enable-apparmor" "--enable-libaudit" ] ++ lib.optionals stdenv.isLinux [ "--enable-apparmor" "--enable-libaudit" ]
++ lib.optionals enableSystemd [ "SYSTEMCTL=${systemd}/bin/systemctl" ]; ++ lib.optionals enableSystemd [ "SYSTEMCTL=${systemdMinimal}/bin/systemctl" ];
NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed"; NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";

View file

@ -8,23 +8,24 @@
, openssl , openssl
, udev , udev
, zlib , zlib
, pcsclite
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "libfido2"; pname = "libfido2";
version = "1.10.0"; version = "1.11.0";
# releases on https://developers.yubico.com/libfido2/Releases/ are signed # releases on https://developers.yubico.com/libfido2/Releases/ are signed
src = fetchurl { src = fetchurl {
url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz"; url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
sha256 = "sha256-Um79PVavcGwF0J89IfGO47CxWsDB9cXaGsvCfCcwuZs="; sha256 = "sha256-CDDFhT47RAmalxZuDOxUpltUt/qqwHBxhy93uOTXswI=";
}; };
nativeBuildInputs = [ cmake pkg-config ]; nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ libcbor zlib ] buildInputs = [ libcbor zlib ]
++ lib.optionals stdenv.isDarwin [ hidapi ] ++ lib.optionals stdenv.isDarwin [ hidapi ]
++ lib.optionals stdenv.isLinux [ udev ]; ++ lib.optionals stdenv.isLinux [ udev pcsclite ];
propagatedBuildInputs = [ openssl ]; propagatedBuildInputs = [ openssl ];
@ -35,6 +36,7 @@ stdenv.mkDerivation rec {
"-DUSE_HIDAPI=1" "-DUSE_HIDAPI=1"
] ++ lib.optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
"-DNFC_LINUX=1" "-DNFC_LINUX=1"
"-DUSE_PCSC=1"
]; ];
meta = with lib; { meta = with lib; {

View file

@ -22,7 +22,7 @@
, gtk-doc , gtk-doc
, coreutils , coreutils
, useSystemd ? stdenv.isLinux , useSystemd ? stdenv.isLinux
, systemd , systemdMinimal
, elogind , elogind
# A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault). # A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault).
# Not yet investigated; it may be due to the "Make netgroup support optional" # Not yet investigated; it may be due to the "Make netgroup support optional"
@ -106,7 +106,7 @@ stdenv.mkDerivation rec {
duktape duktape
] ++ lib.optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
# On Linux, fall back to elogind when systemd support is off. # On Linux, fall back to elogind when systemd support is off.
(if useSystemd then systemd else elogind) (if useSystemd then systemdMinimal else elogind)
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [

View file

@ -8,9 +8,17 @@
, bluez , bluez
, networkmanager , networkmanager
, setuptools-scm , setuptools-scm
, runCommand
}: }:
buildPythonPackage rec { let
# Cannot just add it to path in preCheck since that attribute will be passed to
# mkDerivation even with doCheck = false, causing a dependency cycle.
pbap-client = runCommand "pbap-client" { } ''
mkdir -p "$out/bin"
ln -s "${bluez.test}/test/pbap-client" "$out/bin/pbap-client"
'';
in buildPythonPackage rec {
pname = "python-dbusmock"; pname = "python-dbusmock";
version = "0.28.4"; version = "0.28.4";
@ -35,7 +43,7 @@ buildPythonPackage rec {
dbus dbus
pygobject3 pygobject3
bluez bluez
(lib.getOutput "test" bluez) pbap-client
networkmanager networkmanager
nose nose
]; ];
@ -63,7 +71,6 @@ buildPythonPackage rec {
# "test_networkmanager" # "test_networkmanager"
]; ];
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
nosetests -v nosetests -v

View file

@ -12,7 +12,7 @@
, pkg-config , pkg-config
, python3 , python3
, readline , readline
, systemd , systemdMinimal
, udev , udev
, withExperimental ? false , withExperimental ? false
}: let }: let
@ -48,7 +48,7 @@ in stdenv.mkDerivation rec {
python3.pkgs.wrapPython python3.pkgs.wrapPython
]; ];
outputs = [ "out" "dev" ] ++ lib.optional doCheck "test"; outputs = [ "out" "dev" "test" ];
patches = [ patches = [
# https://github.com/bluez/bluez/commit/0905a06410d4a5189f0be81e25eb3c3e8a2199c5 # https://github.com/bluez/bluez/commit/0905a06410d4a5189f0be81e25eb3c3e8a2199c5
@ -63,7 +63,7 @@ in stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
substituteInPlace tools/hid2hci.rules \ substituteInPlace tools/hid2hci.rules \
--replace /sbin/udevadm ${systemd}/bin/udevadm \ --replace /sbin/udevadm ${systemdMinimal}/bin/udevadm \
--replace "hid2hci " "$out/lib/udev/hid2hci " --replace "hid2hci " "$out/lib/udev/hid2hci "
# Disable some tests: # Disable some tests:
# - test-mesh-crypto depends on the following kernel settings: # - test-mesh-crypto depends on the following kernel settings:
@ -107,7 +107,7 @@ in stdenv.mkDerivation rec {
doCheck = stdenv.hostPlatform.isx86_64; doCheck = stdenv.hostPlatform.isx86_64;
postInstall = lib.optionalString doCheck '' postInstall = ''
mkdir -p $test/{bin,test} mkdir -p $test/{bin,test}
cp -a test $test cp -a test $test
pushd $test/test pushd $test/test

View file

@ -8,7 +8,7 @@
, python3 , python3
, dbus , dbus
, polkit , polkit
, systemd , systemdMinimal
, IOKit , IOKit
}: }:
@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook autoconf-archive pkg-config perl ]; nativeBuildInputs = [ autoreconfHook autoconf-archive pkg-config perl ];
buildInputs = [ python3 ] buildInputs = [ python3 ]
++ lib.optionals stdenv.isLinux [ dbus polkit systemd ] ++ lib.optionals stdenv.isLinux [ dbus polkit systemdMinimal ]
++ lib.optionals stdenv.isDarwin [ IOKit ]; ++ lib.optionals stdenv.isDarwin [ IOKit ];
meta = with lib; { meta = with lib; {