Merge pull request #194254 from oxalica/pkg/canokey-qemu

This commit is contained in:
Bernardo Meurer 2022-10-03 22:37:42 -03:00 committed by GitHub
commit 6b58d8b8ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,35 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
}:
stdenv.mkDerivation rec {
pname = "canokey-qemu";
version = "unstable-2022-06-23";
rev = "b70af31229f1858089c3366f71b8d771de4a1e84";
src = fetchFromGitHub {
owner = "canokeys";
repo = "canokey-qemu";
inherit rev;
fetchSubmodules = true;
hash = "sha256-VJb59K/skx+DhoJs5qGUu070hAjQZC2Z6hAMXuX0bMw=";
};
postPatch = ''
substituteInPlace canokey-core/CMakeLists.txt \
--replace "COMMAND git describe --always --tags --long --abbrev=8 --dirty >>" "COMMAND echo '$rev' >>"
'';
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ];
meta = with lib; {
homepage = "https://github.com/canokeys/canokey-qemu";
description = "CanoKey QEMU Virt Card";
license = licenses.asl20;
maintainers = with maintainers; [ oxalica ];
};
}

View File

@ -26,6 +26,7 @@
, smbdSupport ? false, samba
, tpmSupport ? true
, uringSupport ? stdenv.isLinux, liburing
, canokeySupport ? false, canokey-qemu
, hostCpuOnly ? false
, hostCpuTargets ? (if hostCpuOnly
then (lib.optional stdenv.isx86_64 "i386-softmmu"
@ -79,7 +80,8 @@ stdenv.mkDerivation rec {
++ lib.optionals virglSupport [ virglrenderer ]
++ lib.optionals libiscsiSupport [ libiscsi ]
++ lib.optionals smbdSupport [ samba ]
++ lib.optionals uringSupport [ liburing ];
++ lib.optionals uringSupport [ liburing ]
++ lib.optionals canokeySupport [ canokey-qemu ];
dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build
@ -161,7 +163,8 @@ stdenv.mkDerivation rec {
++ lib.optional tpmSupport "--enable-tpm"
++ lib.optional libiscsiSupport "--enable-libiscsi"
++ lib.optional smbdSupport "--smbd=${samba}/bin/smbd"
++ lib.optional uringSupport "--enable-linux-io-uring";
++ lib.optional uringSupport "--enable-linux-io-uring"
++ lib.optional canokeySupport "--enable-canokey";
dontWrapGApps = true;

View File

@ -30868,6 +30868,8 @@ with pkgs;
qemu-utils = callPackage ../applications/virtualization/qemu/utils.nix {};
canokey-qemu = callPackage ../applications/virtualization/qemu/canokey-qemu.nix { };
wrapQemuBinfmtP = callPackage ../applications/virtualization/qemu/binfmt-p-wrapper.nix { };
qgroundcontrol = libsForQt5.callPackage ../applications/science/robotics/qgroundcontrol { };