summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/virtualization/qemu
diff options
context:
space:
mode:
authorMatthias Treydte <mt@waldheinz.de>2022-03-02 11:00:10 +0100
committerAlyssa Ross <hi@alyssa.is>2022-03-03 21:37:25 +0000
commit38cf6fea696adec20ea36b12af0792a2b488d3a2 (patch)
tree63e0238e3b0ddc9e850df52b0b1efcc136259045 /pkgs/applications/virtualization/qemu
parent51ceca24be1958d2ab9385b3d56162658a5c98cd (diff)
qemu: fix qemu.ga including qemu in it's closure
The qemu-ga binary is already moved to a separate output but still depends on qemu, adding about 600MiB to it's closure. The command "strings qemu-ga" reveals that something like /nix/store/bqgpvv5qrpb741swczqk3lrdm5gzaqx2-qemu-host-cpu-only-6.2.0/bin is contained, causing this false positive. So use remove-references-to to reduce the closure to about 600KiB.
Diffstat (limited to 'pkgs/applications/virtualization/qemu')
-rw-r--r--pkgs/applications/virtualization/qemu/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix
index ee923f4e0cd0..2c220c7d3637 100644
--- a/pkgs/applications/virtualization/qemu/default.nix
+++ b/pkgs/applications/virtualization/qemu/default.nix
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchurl, fetchpatch, python3, python3Packages, zlib, pkg-config, glib, buildPackages
, perl, pixman, vde2, alsa-lib, texinfo, flex
, bison, lzo, snappy, libaio, libtasn1, gnutls, nettle, curl, ninja, meson, sigtool
-, makeWrapper, runtimeShell
+, makeWrapper, runtimeShell, removeReferencesTo
, attr, libcap, libcap_ng, socat
, CoreServices, Cocoa, Hypervisor, rez, setfile
, numaSupport ? stdenv.isLinux && !stdenv.isAarch32, numactl
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
depsBuildBuild = [ buildPackages.stdenv.cc ];
- nativeBuildInputs = [ makeWrapper pkg-config flex bison meson ninja perl python3 python3Packages.sphinx python3Packages.sphinx_rtd_theme ]
+ nativeBuildInputs = [ makeWrapper removeReferencesTo pkg-config flex bison meson ninja perl python3 python3Packages.sphinx python3Packages.sphinx_rtd_theme ]
++ lib.optionals gtkSupport [ wrapGAppsHook ]
++ lib.optionals stdenv.isDarwin [ sigtool ];
@@ -175,6 +175,7 @@ stdenv.mkDerivation rec {
# copy qemu-ga (guest agent) to separate output
mkdir -p $ga/bin
cp $out/bin/qemu-ga $ga/bin/
+ remove-references-to -t $out $ga/bin/qemu-ga
'' + lib.optionalString gtkSupport ''
# wrap GTK Binaries
for f in $out/bin/qemu-system-*; do