mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 16:23:26 +00:00
045910a1a3
qemu_kvm is a much smaller build, so it's nicer if you're building qemu-utils specifically. None of the tools depend on the emulation targets disabled in qemu_kvm. The tools are copied, not linked, so we don't have to worry about potentially depending on both qemu_kvm and qemu in a bigger derivation, and qemu_kvm is already built by Hydra, so there's no increase in Hydra workload by using the variant.
25 lines
721 B
Nix
25 lines
721 B
Nix
{ stdenv, installShellFiles, qemu_kvm, removeReferencesTo }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "qemu-utils";
|
|
inherit (qemu_kvm) version;
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
buildInputs = [ qemu_kvm ];
|
|
disallowedRequisites = [ qemu_kvm ];
|
|
unpackPhase = "true";
|
|
|
|
installPhase = ''
|
|
mkdir -p "$out/bin"
|
|
cp "${qemu_kvm}/bin/qemu-img" "$out/bin/qemu-img"
|
|
cp "${qemu_kvm}/bin/qemu-io" "$out/bin/qemu-io"
|
|
cp "${qemu_kvm}/bin/qemu-nbd" "$out/bin/qemu-nbd"
|
|
${removeReferencesTo}/bin/remove-references-to -t ${qemu_kvm} $out/bin/*
|
|
|
|
installManPage ${qemu_kvm}/share/man/man1/qemu-img.1.gz
|
|
installManPage ${qemu_kvm}/share/man/man8/qemu-nbd.8.gz
|
|
'';
|
|
|
|
inherit (qemu_kvm) meta;
|
|
}
|