From 8e71416e5d4306c3800133ca6dc2ad4469480b90 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 10 Feb 2021 20:48:54 +0000 Subject: [PATCH] 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 --- pkgs/applications/virtualization/qemu/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 84604c65579f..c04d3b339452 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/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"