depot/pkgs/applications/virtualization/qemu/canokey-qemu.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

53 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
unstableGitUpdater,
}:
stdenv.mkDerivation rec {
pname = "canokey-qemu";
version = "0-unstable-2023-06-06";
rev = "151568c34f5e92b086b7a3a62a11c43dd39f628b";
src = fetchFromGitHub {
owner = "canokeys";
repo = "canokey-qemu";
inherit rev;
fetchSubmodules = true;
hash = "sha256-4V/2UOgGWgL+tFJO/k90bCDjWSVyIpxw3nYi9NU/OxA=";
};
patches = [
./canokey-qemu-memcpy.patch
];
postPatch = ''
substituteInPlace canokey-core/CMakeLists.txt \
--replace "COMMAND git describe --always --tags --long --abbrev=8 --dirty >>" "COMMAND echo '$rev' >>"
'';
preConfigure = ''
cmakeFlagsArray+=(
-DCMAKE_C_FLAGS=${lib.escapeShellArg ([
"-Wno-error=unused-but-set-parameter"
"-Wno-error=unused-but-set-variable"
] ++ lib.optionals stdenv.cc.isClang [
"-Wno-error=documentation"
])}
)
'';
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ];
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
homepage = "https://github.com/canokeys/canokey-qemu";
description = "CanoKey QEMU Virt Card";
license = licenses.asl20;
maintainers = with maintainers; [ oxalica ];
};
}