From f90a24f944a1519351cda862bd37259e0eaa1a6c Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 28 Nov 2021 17:40:29 +0800 Subject: [PATCH] qemu: fix cross compilation --- pkgs/applications/virtualization/qemu/default.nix | 8 ++++++-- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index c53eb25af39f..7a29cf222b7d 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch, python, zlib, pkg-config, glib +{ 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 @@ -51,7 +51,9 @@ stdenv.mkDerivation rec { sha256 = "15iw7982g6vc4jy1l9kk1z9sl5bm1bdbwr74y7nvwjs1nffhig7f"; }; - nativeBuildInputs = [ makeWrapper python python.pkgs.sphinx python.pkgs.sphinx_rtd_theme pkg-config flex bison meson ninja ] + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + nativeBuildInputs = [ makeWrapper pkg-config flex bison meson ninja perl python3 python3Packages.sphinx python3Packages.sphinx_rtd_theme ] ++ lib.optionals gtkSupport [ wrapGAppsHook ] ++ lib.optionals stdenv.isDarwin [ sigtool ]; @@ -190,6 +192,8 @@ stdenv.mkDerivation rec { # Always use our Meson, not the bundled version, which doesn't # have our patches and will be subtly broken because of that. "--meson=meson" + "--cross-prefix=${stdenv.cc.targetPrefix}" + "--cpu=${stdenv.hostPlatform.uname.processor}" ] ++ lib.optional numaSupport "--enable-numa" ++ lib.optional seccompSupport "--enable-seccomp" ++ lib.optional smartcardSupport "--enable-smartcard" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04b976989d40..5fdae3ac3361 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28070,7 +28070,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Hypervisor; inherit (darwin.stubs) rez setfile; inherit (darwin) sigtool; - python = python3; }; qemu-utils = callPackage ../applications/virtualization/qemu/utils.nix {};