mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 19:44:09 +00:00
qemu-user: add qemu "user space emulator only" variant
When used from pkgsStatic, this is synonymous with the "qemu-user-static" packages available in other distros.
This commit is contained in:
parent
a4ba1adf0b
commit
dd5bc7b7fe
@ -5,36 +5,36 @@
|
||||
, makeWrapper, removeReferencesTo
|
||||
, attr, libcap, libcap_ng, socat, libslirp
|
||||
, CoreServices, Cocoa, Hypervisor, rez, setfile, vmnet
|
||||
, guestAgentSupport ? (with stdenv.hostPlatform; isLinux || isNetBSD || isOpenBSD || isSunOS || isWindows) && !toolsOnly
|
||||
, numaSupport ? stdenv.isLinux && !stdenv.isAarch32 && !toolsOnly, numactl
|
||||
, seccompSupport ? stdenv.isLinux && !toolsOnly, libseccomp
|
||||
, alsaSupport ? lib.hasSuffix "linux" stdenv.hostPlatform.system && !nixosTestRunner && !toolsOnly
|
||||
, pulseSupport ? !stdenv.isDarwin && !nixosTestRunner && !toolsOnly, libpulseaudio
|
||||
, pipewireSupport ? !stdenv.isDarwin && !nixosTestRunner && !toolsOnly, pipewire
|
||||
, sdlSupport ? !stdenv.isDarwin && !nixosTestRunner && !toolsOnly, SDL2, SDL2_image
|
||||
, jackSupport ? !stdenv.isDarwin && !nixosTestRunner && !toolsOnly, libjack2
|
||||
, gtkSupport ? !stdenv.isDarwin && !xenSupport && !nixosTestRunner && !toolsOnly, gtk3, gettext, vte, wrapGAppsHook3
|
||||
, vncSupport ? !nixosTestRunner && !toolsOnly, libjpeg, libpng
|
||||
, smartcardSupport ? !nixosTestRunner && !toolsOnly, libcacard
|
||||
, spiceSupport ? true && !nixosTestRunner && !toolsOnly, spice, spice-protocol
|
||||
, ncursesSupport ? !nixosTestRunner && !toolsOnly, ncurses
|
||||
, guestAgentSupport ? (with stdenv.hostPlatform; isLinux || isNetBSD || isOpenBSD || isSunOS || isWindows) && !minimal
|
||||
, numaSupport ? stdenv.isLinux && !stdenv.isAarch32 && !minimal, numactl
|
||||
, seccompSupport ? stdenv.isLinux && !minimal, libseccomp
|
||||
, alsaSupport ? lib.hasSuffix "linux" stdenv.hostPlatform.system && !nixosTestRunner && !minimal
|
||||
, pulseSupport ? !stdenv.isDarwin && !nixosTestRunner && !minimal, libpulseaudio
|
||||
, pipewireSupport ? !stdenv.isDarwin && !nixosTestRunner && !minimal, pipewire
|
||||
, sdlSupport ? !stdenv.isDarwin && !nixosTestRunner && !minimal, SDL2, SDL2_image
|
||||
, jackSupport ? !stdenv.isDarwin && !nixosTestRunner && !minimal, libjack2
|
||||
, gtkSupport ? !stdenv.isDarwin && !xenSupport && !nixosTestRunner && !minimal, gtk3, gettext, vte, wrapGAppsHook3
|
||||
, vncSupport ? !nixosTestRunner && !minimal, libjpeg, libpng
|
||||
, smartcardSupport ? !nixosTestRunner && !minimal, libcacard
|
||||
, spiceSupport ? true && !nixosTestRunner && !minimal, spice, spice-protocol
|
||||
, ncursesSupport ? !nixosTestRunner && !minimal, ncurses
|
||||
, usbredirSupport ? spiceSupport, usbredir
|
||||
, xenSupport ? false, xen
|
||||
, cephSupport ? false, ceph
|
||||
, glusterfsSupport ? false, glusterfs, libuuid
|
||||
, openGLSupport ? sdlSupport, mesa, libepoxy, libdrm
|
||||
, rutabagaSupport ? openGLSupport && !toolsOnly && lib.meta.availableOn stdenv.hostPlatform rutabaga_gfx, rutabaga_gfx
|
||||
, rutabagaSupport ? openGLSupport && !minimal && lib.meta.availableOn stdenv.hostPlatform rutabaga_gfx, rutabaga_gfx
|
||||
, virglSupport ? openGLSupport, virglrenderer
|
||||
, libiscsiSupport ? !toolsOnly, libiscsi
|
||||
, libiscsiSupport ? !minimal, libiscsi
|
||||
, smbdSupport ? false, samba
|
||||
, tpmSupport ? !toolsOnly
|
||||
, uringSupport ? stdenv.isLinux, liburing
|
||||
, canokeySupport ? !toolsOnly, canokey-qemu
|
||||
, capstoneSupport ? !toolsOnly, capstone
|
||||
, tpmSupport ? !minimal
|
||||
, uringSupport ? stdenv.isLinux && !userOnly, liburing
|
||||
, canokeySupport ? !minimal, canokey-qemu
|
||||
, capstoneSupport ? !minimal, capstone
|
||||
, pluginsSupport ? !stdenv.hostPlatform.isStatic
|
||||
, enableDocs ? true
|
||||
, enableTools ? true
|
||||
, enableBlobs ? true
|
||||
, enableDocs ? !minimal || toolsOnly
|
||||
, enableTools ? !minimal || toolsOnly
|
||||
, enableBlobs ? !minimal || toolsOnly
|
||||
, hostCpuOnly ? false
|
||||
, hostCpuTargets ? (if toolsOnly
|
||||
then [ ]
|
||||
@ -44,6 +44,8 @@
|
||||
else null)
|
||||
, nixosTestRunner ? false
|
||||
, toolsOnly ? false
|
||||
, userOnly ? false
|
||||
, minimal ? toolsOnly || userOnly
|
||||
, gitUpdater
|
||||
, qemu-utils # for tests attribute
|
||||
}:
|
||||
@ -57,7 +59,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
+ lib.optionalString xenSupport "-xen"
|
||||
+ lib.optionalString hostCpuOnly "-host-cpu-only"
|
||||
+ lib.optionalString nixosTestRunner "-for-vm-tests"
|
||||
+ lib.optionalString toolsOnly "-utils";
|
||||
+ lib.optionalString toolsOnly "-utils"
|
||||
+ lib.optionalString userOnly "-user";
|
||||
version = "9.0.2";
|
||||
|
||||
src = fetchurl {
|
||||
@ -188,7 +191,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optional canokeySupport "--enable-canokey"
|
||||
++ lib.optional capstoneSupport "--enable-capstone"
|
||||
++ lib.optional (!pluginsSupport) "--disable-plugins"
|
||||
++ lib.optional (!enableBlobs) "--disable-install-blobs";
|
||||
++ lib.optional (!enableBlobs) "--disable-install-blobs"
|
||||
++ lib.optional userOnly "--disable-system";
|
||||
|
||||
dontWrapGApps = true;
|
||||
|
||||
@ -255,7 +259,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
'';
|
||||
|
||||
# Add a ‘qemu-kvm’ wrapper for compatibility/convenience.
|
||||
postInstall = lib.optionalString (!toolsOnly) ''
|
||||
postInstall = lib.optionalString (!minimal) ''
|
||||
ln -s $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} $out/bin/qemu-kvm
|
||||
'';
|
||||
|
||||
@ -284,7 +288,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
platforms = platforms.unix;
|
||||
}
|
||||
# toolsOnly: Does not have qemu-kvm and there's no main support tool
|
||||
// lib.optionalAttrs (!toolsOnly) {
|
||||
# userOnly: There's one qemu-<arch> for every architecture
|
||||
// lib.optionalAttrs (!toolsOnly && !userOnly) {
|
||||
mainProgram = "qemu-kvm";
|
||||
}
|
||||
# userOnly: https://qemu.readthedocs.io/en/v9.0.2/user/main.html
|
||||
// lib.optionalAttrs userOnly {
|
||||
platforms = with platforms; (linux ++ freebsd ++ openbsd ++ netbsd);
|
||||
description = "QEMU User space emulator - launch executables compiled for one CPU on another CPU";
|
||||
};
|
||||
})
|
||||
|
@ -33054,6 +33054,11 @@ with pkgs;
|
||||
toolsOnly = true;
|
||||
};
|
||||
|
||||
# variant of qemu building user space emulator only - intended to be used from pkgsStatic
|
||||
qemu-user = qemu.override {
|
||||
userOnly = true;
|
||||
};
|
||||
|
||||
canokey-qemu = callPackage ../applications/virtualization/qemu/canokey-qemu.nix { };
|
||||
|
||||
wrapQemuBinfmtP = callPackage ../applications/virtualization/qemu/binfmt-p-wrapper.nix { };
|
||||
|
Loading…
Reference in New Issue
Block a user