From 73868e0808a2e6799069b12924479c8b2816eaf9 Mon Sep 17 00:00:00 2001 From: volesen Date: Thu, 8 Aug 2024 15:05:21 +0200 Subject: [PATCH 01/11] darwin.moltenvk: Add `enableStatic` option --- pkgs/os-specific/darwin/moltenvk/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/darwin/moltenvk/default.nix b/pkgs/os-specific/darwin/moltenvk/default.nix index 5e5747b1b4fb..65e8d93f41aa 100644 --- a/pkgs/os-specific/darwin/moltenvk/default.nix +++ b/pkgs/os-specific/darwin/moltenvk/default.nix @@ -16,6 +16,7 @@ Foundation, Metal, QuartzCore, + enableStatic ? stdenv.hostPlatform.isStatic, # MoltenVK supports using private APIs to implement some Vulkan functionality. # Applications that use private APIs can’t be distributed on the App Store, # but that’s not really a concern for nixpkgs, so use them by default. @@ -23,9 +24,6 @@ enablePrivateAPIUsage ? true, }: -let - inherit (stdenv.hostPlatform) isStatic; -in stdenv.mkDerivation (finalAttrs: { pname = "MoltenVK"; version = "1.2.9"; @@ -142,7 +140,7 @@ stdenv.mkDerivation (finalAttrs: { ''; postBuild = - if isStatic then + if enableStatic then '' mkdir -p Package/Release/MoltenVK/static cp Products/Release/libMoltenVK.a Package/Release/MoltenVK/static @@ -174,8 +172,8 @@ stdenv.mkDerivation (finalAttrs: { installPhase = '' runHook preInstall - libraryExtension=${if isStatic then ".a" else ".dylib"} - packagePath=${if isStatic then "static" else "dynamic/dylib"} + libraryExtension=${if enableStatic then ".a" else ".dylib"} + packagePath=${if enableStatic then "static" else "dynamic/dylib"} mkdir -p "$out/lib" "$out/share/vulkan/icd.d" "$bin/bin" "$dev" From b6bcca149a4cdc79fbe1f6774456ba777301b992 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 13 Aug 2024 08:19:05 +0200 Subject: [PATCH 02/11] python312Packages.tencentcloud-sdk-python: 3.0.1209 -> 3.0.1210 Diff: https://github.com/TencentCloud/tencentcloud-sdk-python/compare/refs/tags/3.0.1209...3.0.1210 Changelog: https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3.0.1210/CHANGELOG.md --- .../python-modules/tencentcloud-sdk-python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix b/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix index 8e019554039f..5eaf819f1726 100644 --- a/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix +++ b/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "tencentcloud-sdk-python"; - version = "3.0.1209"; + version = "3.0.1210"; pyproject = true; disabled = pythonOlder "3.9"; @@ -19,7 +19,7 @@ buildPythonPackage rec { owner = "TencentCloud"; repo = "tencentcloud-sdk-python"; rev = "refs/tags/${version}"; - hash = "sha256-SQcqLtdt74Onk3mBre9zaZmJhAOTrjZBhL3i1zr9R80="; + hash = "sha256-TdT6PK+vzkHuptV1i3LvPxvFGgtBBrkRIzJgyvPJG9w="; }; build-system = [ setuptools ]; From e8c75c234eb08d615584d7589d7151535750166b Mon Sep 17 00:00:00 2001 From: Julius Michaelis Date: Fri, 2 Aug 2024 20:32:06 +0900 Subject: [PATCH 03/11] qemu: remove unused texinfo dependency --- pkgs/applications/virtualization/qemu/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 6f4241444b62..089bd299c781 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, fetchpatch, python3Packages, zlib, pkg-config, glib, buildPackages -, pixman, vde2, alsa-lib, texinfo, flex +, pixman, vde2, alsa-lib, flex , bison, lzo, snappy, libaio, libtasn1, gnutls, nettle, curl, dtc, ninja, meson , sigtool , makeWrapper, removeReferencesTo @@ -77,7 +77,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals stdenv.isDarwin [ sigtool ]; buildInputs = [ dtc zlib glib pixman - vde2 texinfo lzo snappy libtasn1 + vde2 lzo snappy libtasn1 gnutls nettle curl libslirp ] ++ lib.optionals ncursesSupport [ ncurses ] From ed38ae461a1a222fcee3a6ee61d50c97cb996b58 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 27 May 2023 11:11:48 -0600 Subject: [PATCH 04/11] qemu: Skip doc-related sphinx dependencies sphinx when docs are disabled --- pkgs/applications/virtualization/qemu/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 089bd299c781..f478d50de16e 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -70,9 +70,10 @@ stdenv.mkDerivation (finalAttrs: { pkg-config flex bison dtc meson ninja # Don't change this to python3 and python3.pkgs.*, breaks cross-compilation - python3Packages.python python3Packages.sphinx python3Packages.sphinx-rtd-theme + python3Packages.python ] ++ lib.optionals gtkSupport [ wrapGAppsHook3 ] + ++ lib.optionals enableDocs [ python3Packages.sphinx python3Packages.sphinx-rtd-theme ] ++ lib.optionals hexagonSupport [ glib ] ++ lib.optionals stdenv.isDarwin [ sigtool ]; From a94afe42c066d6b1fb2a0ae08bf1a3d34af6568b Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 27 May 2023 11:11:48 -0600 Subject: [PATCH 05/11] qemu: Support disabling TCG plugins The plugin .so's do not build statically. --- pkgs/applications/virtualization/qemu/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index f478d50de16e..358cf5616122 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -31,6 +31,7 @@ , uringSupport ? stdenv.isLinux, liburing , canokeySupport ? !toolsOnly, canokey-qemu , capstoneSupport ? !toolsOnly, capstone +, pluginsSupport ? !stdenv.hostPlatform.isStatic , enableDocs ? true , hostCpuOnly ? false , hostCpuTargets ? (if toolsOnly @@ -183,7 +184,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional smbdSupport "--smbd=${samba}/bin/smbd" ++ lib.optional uringSupport "--enable-linux-io-uring" ++ lib.optional canokeySupport "--enable-canokey" - ++ lib.optional capstoneSupport "--enable-capstone"; + ++ lib.optional capstoneSupport "--enable-capstone" + ++ lib.optional (!pluginsSupport) "--disable-plugins"; dontWrapGApps = true; From 12428702ebd164c77a21f6ae5278687dcb7f1239 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 27 May 2023 11:11:48 -0600 Subject: [PATCH 06/11] qemu: Support disabling tools Not needed for a minimal qemu-user-static build. --- pkgs/applications/virtualization/qemu/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 358cf5616122..c17306032c7e 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -33,6 +33,7 @@ , capstoneSupport ? !toolsOnly, capstone , pluginsSupport ? !stdenv.hostPlatform.isStatic , enableDocs ? true +, enableTools ? true , hostCpuOnly ? false , hostCpuTargets ? (if toolsOnly then [ ] @@ -160,7 +161,7 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--disable-strip" # We'll strip ourselves after separating debug info. (lib.enableFeature enableDocs "docs") - "--enable-tools" + (lib.enableFeature enableTools "tools") "--localstatedir=/var" "--sysconfdir=/etc" "--cross-prefix=${stdenv.cc.targetPrefix}" From a4ba1adf0b7b1497eae87064de5235013d32ddb6 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 27 May 2023 11:11:49 -0600 Subject: [PATCH 07/11] qemu: Support disabling blobs Not needed for a minimal qemu-user-static build. --- pkgs/applications/virtualization/qemu/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index c17306032c7e..42288604457a 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -34,6 +34,7 @@ , pluginsSupport ? !stdenv.hostPlatform.isStatic , enableDocs ? true , enableTools ? true +, enableBlobs ? true , hostCpuOnly ? false , hostCpuTargets ? (if toolsOnly then [ ] @@ -186,7 +187,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional uringSupport "--enable-linux-io-uring" ++ lib.optional canokeySupport "--enable-canokey" ++ lib.optional capstoneSupport "--enable-capstone" - ++ lib.optional (!pluginsSupport) "--disable-plugins"; + ++ lib.optional (!pluginsSupport) "--disable-plugins" + ++ lib.optional (!enableBlobs) "--disable-install-blobs"; dontWrapGApps = true; From dd5bc7b7fe597998e36f2677fe2aebcac502d20e Mon Sep 17 00:00:00 2001 From: Julius Michaelis Date: Sun, 4 Aug 2024 20:25:46 +0900 Subject: [PATCH 08/11] 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. --- .../virtualization/qemu/default.nix | 62 +++++++++++-------- pkgs/top-level/all-packages.nix | 5 ++ 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 42288604457a..ab636939db56 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -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- 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"; }; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 66d9336d26d3..ac8a7d3cce8b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { }; From 376b49ee4c9df446da1c49a9853f1fb82fe1b484 Mon Sep 17 00:00:00 2001 From: Julius Michaelis Date: Sat, 3 Aug 2024 22:31:23 +0900 Subject: [PATCH 09/11] qemu: Skip dependencies unnecessary for qemu-user which fail in pkgsStatic (libaio, dtc) --- pkgs/applications/virtualization/qemu/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index ab636939db56..8c846d8721bf 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -73,7 +73,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ makeWrapper removeReferencesTo - pkg-config flex bison dtc meson ninja + pkg-config flex bison meson ninja # Don't change this to python3 and python3.pkgs.*, breaks cross-compilation python3Packages.python @@ -81,9 +81,10 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals gtkSupport [ wrapGAppsHook3 ] ++ lib.optionals enableDocs [ python3Packages.sphinx python3Packages.sphinx-rtd-theme ] ++ lib.optionals hexagonSupport [ glib ] - ++ lib.optionals stdenv.isDarwin [ sigtool ]; + ++ lib.optionals stdenv.isDarwin [ sigtool ] + ++ lib.optionals (!userOnly) [ dtc ]; - buildInputs = [ dtc zlib glib pixman + buildInputs = [ zlib glib pixman vde2 lzo snappy libtasn1 gnutls nettle curl libslirp ] @@ -101,7 +102,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals smartcardSupport [ libcacard ] ++ lib.optionals spiceSupport [ spice-protocol spice ] ++ lib.optionals usbredirSupport [ usbredir ] - ++ lib.optionals stdenv.isLinux [ libaio libcap_ng libcap attr ] + ++ lib.optionals stdenv.isLinux [ libcap_ng libcap attr ] + ++ lib.optionals (stdenv.isLinux && !userOnly) [ libaio ] ++ lib.optionals xenSupport [ xen ] ++ lib.optionals cephSupport [ ceph ] ++ lib.optionals glusterfsSupport [ glusterfs libuuid ] @@ -112,7 +114,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals smbdSupport [ samba ] ++ lib.optionals uringSupport [ liburing ] ++ lib.optionals canokeySupport [ canokey-qemu ] - ++ lib.optionals capstoneSupport [ capstone ]; + ++ lib.optionals capstoneSupport [ capstone ] + ++ lib.optionals (!userOnly) [ dtc ]; dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build @@ -177,7 +180,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional usbredirSupport "--enable-usb-redir" ++ lib.optional (hostCpuTargets != null) "--target-list=${lib.concatStringsSep "," hostCpuTargets}" ++ lib.optionals stdenv.isDarwin [ "--enable-cocoa" "--enable-hvf" ] - ++ lib.optional stdenv.isLinux "--enable-linux-aio" + ++ lib.optional (stdenv.isLinux && !userOnly) "--enable-linux-aio" ++ lib.optional gtkSupport "--enable-gtk" ++ lib.optional xenSupport "--enable-xen" ++ lib.optional cephSupport "--enable-rbd" From 6e81b41ce72f9e3a9190526977f1dafa5c969512 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 3 Aug 2024 22:32:46 +0900 Subject: [PATCH 10/11] qemu: Fix static build --- pkgs/applications/virtualization/qemu/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 8c846d8721bf..7e0e216c94ce 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, fetchpatch, python3Packages, zlib, pkg-config, glib, buildPackages -, pixman, vde2, alsa-lib, flex +, pixman, vde2, alsa-lib, flex, pcre2 , bison, lzo, snappy, libaio, libtasn1, gnutls, nettle, curl, dtc, ninja, meson , sigtool , makeWrapper, removeReferencesTo @@ -82,7 +82,9 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals enableDocs [ python3Packages.sphinx python3Packages.sphinx-rtd-theme ] ++ lib.optionals hexagonSupport [ glib ] ++ lib.optionals stdenv.isDarwin [ sigtool ] - ++ lib.optionals (!userOnly) [ dtc ]; + ++ lib.optionals (!userOnly) [ dtc ] + # workaround, remove once this patch lands: https://lore.kernel.org/qemu-devel/20240805104921.4035256-1-hi@alyssa.is/ + ++ lib.optionals (hexagonSupport && stdenv.hostPlatform.isStatic) [ pcre2 ]; buildInputs = [ zlib glib pixman vde2 lzo snappy libtasn1 @@ -118,6 +120,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals (!userOnly) [ dtc ]; dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build + dontAddStaticConfigureFlags = true; outputs = [ "out" ] ++ lib.optional guestAgentSupport "ga"; # On aarch64-linux we would shoot over the Hydra's 2G output limit. @@ -195,7 +198,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional capstoneSupport "--enable-capstone" ++ lib.optional (!pluginsSupport) "--disable-plugins" ++ lib.optional (!enableBlobs) "--disable-install-blobs" - ++ lib.optional userOnly "--disable-system"; + ++ lib.optional userOnly "--disable-system" + ++ lib.optional stdenv.hostPlatform.isStatic "--static"; dontWrapGApps = true; From aa4e34969baa92fcc227f880d82b1f5a6cc1d343 Mon Sep 17 00:00:00 2001 From: Julius Michaelis Date: Wed, 5 Jun 2024 23:27:57 +0900 Subject: [PATCH 11/11] qemu: add workaround for static build closure pulling in buildinput (#83667) --- pkgs/applications/virtualization/qemu/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 7e0e216c94ce..0edba1c5f008 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -223,6 +223,11 @@ stdenv.mkDerivation (finalAttrs: { for f in $out/bin/qemu-system-*; do wrapGApp $f done + '' + lib.optionalString stdenv.hostPlatform.isStatic '' + # HACK: Otherwise the result will have the entire buildInputs closure + # injected by the pkgsStatic stdenv + # + rm -f $out/nix-support/propagated-build-inputs ''; preBuild = "cd build";