From 7111740cfa60b34dd7272a877bd3c995842a49ce Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Fri, 1 Nov 2024 17:20:24 +0100 Subject: [PATCH 1/3] Revert "virtualbox: do not use open-watcom-bin" This reverts commit 67aa62d45f6d271db7e0ed6e255ce93f5a166814. --- pkgs/applications/virtualization/virtualbox/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index b1c04d305393..23e93e8fdf2f 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -49,6 +49,9 @@ yasm, glslang, nixosTests, + # If open-watcom-bin is not passed, VirtualBox will fall back to use + # the shipped alternative sources (assembly). + open-watcom-bin, makeself, perl, vulkan-loader, @@ -292,6 +295,7 @@ stdenv.mkDerivation (finalAttrs: { ${optionalString (!enableHardening) "--disable-hardening"} \ ${optionalString (!enable32bitGuests) "--disable-vmmraw"} \ ${optionalString enableWebService "--enable-webservice"} \ + ${optionalString (open-watcom-bin != null) "--with-ow-dir=${open-watcom-bin}"} \ ${optionalString (enableKvm) "--with-kvm"} \ ${extraConfigureFlags} \ --disable-kmods From e70bc9367ee06c609323e73e7fe537f4e7a5f586 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Fri, 1 Nov 2024 17:22:49 +0100 Subject: [PATCH 2/3] virtualbox: build BIOS from alternate sources ... to avoid depending on open-watcom-bin which has a habit of breaking. --- pkgs/top-level/all-packages.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 25785bf43510..70de0cb7fe68 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33072,6 +33072,11 @@ with pkgs; # VirtualBox uses wsimport, which was removed after JDK 8. jdk = jdk8; + + # Opt out of building the guest BIOS sources with the problematic Open Watcom + # toolchain. People who need to build the BIOS from sources (for example to + # apply patches) can override this. + open-watcom-bin = null; }; virtualboxKvm = lowPrio (virtualbox.override { From 78ebb34bc8368518f2e1440f8205800d082e6be4 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Fri, 1 Nov 2024 17:52:50 +0100 Subject: [PATCH 3/3] virtualboxKvm: fix for 7.0.22 --- .../virtualization/virtualbox/default.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 23e93e8fdf2f..a7b091013ae7 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -233,11 +233,18 @@ stdenv.mkDerivation (finalAttrs: { }) # While the KVM patch should not break any other behavior if --with-kvm is not specified, # we don't take any chances and only apply it if people actually want to use KVM support. - ++ optional enableKvm (fetchpatch { - name = "virtualbox-${finalAttrs.virtualboxVersion}-kvm-dev-${finalAttrs.kvmPatchVersion}.patch"; - url = "https://github.com/cyberus-technology/virtualbox-kvm/releases/download/dev-${finalAttrs.kvmPatchVersion}/kvm-backend-${finalAttrs.virtualboxVersion}-dev-${finalAttrs.kvmPatchVersion}.patch"; - hash = finalAttrs.kvmPatchHash; - }) + ++ optional enableKvm ( + let + patchVboxVersion = + # There is no updated patch for 7.0.22 yet, but the older one still applies. + if finalAttrs.virtualboxVersion == "7.0.22" then "7.0.20" else finalAttrs.virtualboxVersion; + in + fetchpatch { + name = "virtualbox-${finalAttrs.virtualboxVersion}-kvm-dev-${finalAttrs.kvmPatchVersion}.patch"; + url = "https://github.com/cyberus-technology/virtualbox-kvm/releases/download/dev-${finalAttrs.kvmPatchVersion}/kvm-backend-${patchVboxVersion}-dev-${finalAttrs.kvmPatchVersion}.patch"; + hash = finalAttrs.kvmPatchHash; + } + ) ++ [ ./qt-dependency-paths.patch # https://github.com/NixOS/nixpkgs/issues/123851