qemu: set localstatedir

Otherwise qemu-qa, qemu-pr-helper, and virtiofsd, try to write to
$out/var at runtime.

Fixes: https://github.com/NixOS/nixpkgs/issues/113909
Fixes: https://github.com/NixOS/nixpkgs/pull/112886
wip/yesman
Alyssa Ross 3 years ago
parent c2b66f2702
commit 8e71416e5d
  1. 7
      pkgs/applications/virtualization/qemu/default.nix

@ -101,6 +101,12 @@ stdenv.mkDerivation rec {
})
];
# Otherwise tries to ensure /var/run exists.
postPatch = ''
sed -i "/install_subdir('run', install_dir: get_option('localstatedir'))/d" \
qga/meson.build
'';
preConfigure = ''
unset CPP # intereferes with dependency calculation
# this script isn't marked as executable b/c it's indirectly used by meson. Needed to patch its shebang
@ -119,6 +125,7 @@ stdenv.mkDerivation rec {
"--enable-docs"
"--enable-tools"
"--enable-guest-agent"
"--localstatedir=/var"
"--sysconfdir=/etc"
]
++ optional numaSupport "--enable-numa"

Loading…
Cancel
Save