Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtualbox: 7.0.22 -> 7.1.4 (Qt6 support) #353857

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/tests/virtualbox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ in mapAttrs (mkVBoxTest {} vboxVMs) {
create_vm_simple()
machine.succeed(ru("VirtualBox >&2 &"))
machine.wait_until_succeeds(ru("xprop -name 'Oracle VM VirtualBox Manager'"))
machine.wait_until_succeeds(ru("xprop -name 'Oracle VirtualBox Manager'"))
machine.sleep(5)
machine.screenshot("gui_manager_started")
send_vm_startup()
Expand Down
43 changes: 24 additions & 19 deletions pkgs/applications/virtualization/virtualbox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
pam,
libxslt,
libxml2,
wrapQtAppsHook,
libX11,
xorgproto,
libXext,
Expand All @@ -28,11 +27,7 @@
libXinerama,
libopus,
libtpms,
qtbase,
qtx11extras,
qttools,
qtsvg,
qtwayland,
qt6,
pkg-config,
which,
docbook_xsl,
Expand Down Expand Up @@ -78,8 +73,8 @@ let
buildType = "release";
# Use maintainers/scripts/update.nix to update the version and all related hashes or
# change the hashes in extpack.nix and guest-additions/default.nix as well manually.
virtualboxVersion = "7.0.22";
virtualboxSha256 = "cf3ddf633ca410f1b087b0722413e83247cda4f14d33323dc122a4a42ff61981";
virtualboxVersion = "7.1.4";
virtualboxSha256 = "872e7a42b41f8558abbf887f1bdc7aac932bb88b2764d07cbce270cab57e3b5e";

kvmPatchVersion = "20240828";
kvmPatchHash = "sha256-g0esJbB1IGyLGZMLFJIY8ZYdHWuiM5IZtLMHZvCY6bs=";
Expand All @@ -97,6 +92,14 @@ let
getDev
getLib
;
inherit (qt6)
qtbase
qttools
qtsvg
qtwayland
qtscxml
wrapQtAppsHook
;
in
stdenv.mkDerivation (finalAttrs: {
pname = "virtualbox";
Expand Down Expand Up @@ -164,7 +167,8 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals headless [ libGL ]
++ optionals (!headless) [
qtbase
qtx11extras
qttools
qtscxml
libXinerama
SDL2
libGLU
Expand All @@ -188,7 +192,7 @@ stdenv.mkDerivation (finalAttrs: {
-e 's@CXX_FLAGS="\(.*\)"@CXX_FLAGS="-std=c++11 \1"@' \
${
optionalString (!headless) ''
-e 's@TOOLQT5BIN=.*@TOOLQT5BIN="${getDev qtbase}/bin"@' \
-e 's@TOOLQT6BIN=.*@TOOLQT6BIN="${getDev qttools}/bin"@' \
''
} -i configure
ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2
Expand All @@ -215,8 +219,8 @@ stdenv.mkDerivation (finalAttrs: {
# No update patch disables check for update function
# https://bugs.launchpad.net/ubuntu/+source/virtualbox-ose/+bug/272212
(fetchpatch {
url = "https://salsa.debian.org/pkg-virtualbox-team/virtualbox/-/raw/debian/7.0.14-dfsg-1/debian/patches/16-no-update.patch";
hash = "sha256-UJHpuB6QB/BbxJorlqZXUF12lgq8gbLMRHRMsbyqRpY=";
url = "https://salsa.debian.org/pkg-virtualbox-team/virtualbox/-/raw/42a1ca1291fde365bfba140cb21a8a074aaccce2/debian/patches/16-no-update.patch";
hash = "sha256-qM2e4DkkpmA18Z76OUsnY1MhcGb1dT2PG68JUy6fZEE=";
})
]
++ [ ./extra_symbols.patch ]
Expand All @@ -229,7 +233,7 @@ stdenv.mkDerivation (finalAttrs: {
# the user's icon theme can be loaded.
++ optional (!headless && enableHardening) (substituteAll {
src = ./qt-env-vars.patch;
qtPluginPath = "${qtbase.bin}/${qtbase.qtPluginPrefix}:${qtsvg.bin}/${qtbase.qtPluginPrefix}:${qtwayland.bin}/${qtbase.qtPluginPrefix}";
qtPluginPath = "${qtbase}/bin/${qtbase.qtPluginPrefix}:${qtsvg}/bin/${qtbase.qtPluginPrefix}:${qtwayland}/bin/${qtbase.qtPluginPrefix}";
})
# 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.
Expand Down Expand Up @@ -282,16 +286,17 @@ stdenv.mkDerivation (finalAttrs: {
''}
${optionalString (!headless) ''
VBOX_WITH_VBOXSDL := 1
PATH_QT5_X11_EXTRAS_LIB := ${getLib qtx11extras}/lib
PATH_QT5_X11_EXTRAS_INC := ${getDev qtx11extras}/include
PATH_QT5_TOOLS_LIB := ${getLib qttools}/lib
PATH_QT5_TOOLS_INC := ${getDev qttools}/include
PATH_QT6_TOOLS_LIB := ${getLib qttools}/lib
PATH_QT6_TOOLS_INC := ${getLib qttools}/include
PATH_QT6_SCXML_LIB := ${getLib qtscxml}/lib
PATH_QT6_SCXML_INC := ${getLib qtscxml}/include
VBOX_PATH_QT := ${getLib qttools}/
''}
${optionalString enableWebService ''
# fix gsoap missing zlib include and produce errors with --as-needed
VBOX_GSOAP_CXX_LIBS := gsoapssl++ z
''}
TOOL_QT5_LRC := ${getDev qttools}/bin/lrelease
TOOL_QT6_LRC := ${getLib qttools}/bin/lrelease
LOCAL_CONFIG

./configure \
Expand Down Expand Up @@ -344,7 +349,7 @@ stdenv.mkDerivation (finalAttrs: {
"$libexec/VBoxExtPackHelperApp" install \
--base-dir "$share/ExtensionPacks" \
--cert-dir "$share/ExtPackCertificates" \
--name "Oracle VM VirtualBox Extension Pack" \
--name "Oracle VirtualBox Extension Pack" \
--tarball "${extensionPack}" \
--sha-256 "${extensionPack.outputHash}"
EOF
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/virtualization/virtualbox/extpack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ let
inherit (virtualbox) version;
in
fetchurl rec {
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack";
name = "Oracle_VirtualBox_Extension_Pack-${version}.vbox-extpack";
url = "https://download.virtualbox.org/virtualbox/${version}/${name}";
sha256 =
# Manually sha256sum the extensionPack file, must be hex!
# Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`.
# Checksums can also be found at https://www.virtualbox.org/download/hashes/${version}/SHA256SUMS
let
value = "6b0c16074dde1ea273b15e091336034368217ba569e09359a63c4d32af558886";
value = "9dd60ef3c52c2a318fbbb6faace5862a299b61f678a579988869865dcf7390b6";
in
assert (builtins.stringLength value) == 64;
value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let
in
fetchurl {
url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
sha256 = "486f90cbfe9ed4bf2b12d726ebf54a839758a237e967aa65fc2c92d90a963021";
sha256 = "80c91d35742f68217cf47b13e5b50d53f54c22c485bacce41ad7fdc321649e61";
meta = {
description = "Guest additions ISO for VirtualBox";
longDescription = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "VirtualBox-GuestAdditions-builder-${kernel.version}";
version = "7.0.22";
version = "7.1.4";

src = fetchurl {
url = "https://download.virtualbox.org/virtualbox/${finalAttrs.version}/VirtualBox-${finalAttrs.version}.tar.bz2";
sha256 = "cf3ddf633ca410f1b087b0722413e83247cda4f14d33323dc122a4a42ff61981";
sha256 = "872e7a42b41f8558abbf887f1bdc7aac932bb88b2764d07cbce270cab57e3b5e";
};

env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration";
Expand Down Expand Up @@ -72,11 +72,6 @@ stdenv.mkDerivation (finalAttrs: {
rm -r src/libs/zlib*/
'';

patches = [
## https://www.virtualbox.org/changeset/100258/vbox
./no-legacy-xorg.patch
];

postPatch = ''
set -x
sed -e 's@MKISOFS --version@MKISOFS -version@' \
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
diff --git a/kBuild/units/qt5.kmk b/kBuild/units/qt5.kmk
index 71b96a3..73391f0 100644
--- a/kBuild/units/qt5.kmk
+++ b/kBuild/units/qt5.kmk
@@ -1054,9 +1054,9 @@ else
$(eval $(target)_LIBS += $(PATH_SDK_QT5_LIB)/$(qt_prefix)qtmain$(qt_infix)$(SUFF_LIB) )
endif
diff --git a/kBuild/units/qt6.kmk b/kBuild/units/qt6.kmk
index 28d61005..d65205cf 100644
--- a/kBuild/units/qt6.kmk
+++ b/kBuild/units/qt6.kmk
@@ -1131,9 +1131,14 @@ else
ifeq ($(bld_trg),win)
$(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT6_LIB)/$(qt_prefix)Qt6$(module)$(qt_infix)$(SUFF_LIB)) )
else
- $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT5_LIB)/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) )
+ $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(if $(filter Help,$(module)),$(PATH_QT5_TOOLS_LIB),$(if $(filter X11Extras,$(module)),$(PATH_QT5_X11_EXTRAS_LIB),$(PATH_SDK_QT5_LIB)))/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) )
- $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT6_LIB)/lib$(qt_prefix)Qt6$(module)$(qt_infix)$(SUFF_DLL)) )
+ $(eval $(target)_LIBS += $(foreach module,$(qt_modules), \
+ $(if $(filter Help,$(module)),$(PATH_QT6_TOOLS_LIB), \
+ $(if $(filter StateMachine,$(module)),$(PATH_QT6_SCXML_LIB), \
+ $(PATH_SDK_QT6_LIB)))/lib$(qt_prefix)Qt6$(module)$(qt_infix)$(SUFF_DLL)) \
+ )
endif
- $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT5_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT5_INC) )
+ $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT5_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT5_INC) $(PATH_QT5_X11_EXTRAS_INC)/QtX11Extras $(PATH_QT5_TOOLS_INC))
- $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT6_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT6_INC) )
+ $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT6_INC)/Qt,$(qt_modules)) \
+ $(PATH_SDK_QT6_INC) $(PATH_QT6_TOOLS_INC) $(PATH_QT6_SCXML_INC)/QtStateMachine )
endif
$(eval $(target)_DEFS += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) )


@@ -1238,4 +1243,3 @@ unit-qt6-show-vars:
@$(ECHO) ' TOOL_QT6_RCC = "$(TOOL_QT6_RCC)"'
@$(ECHO) ' TOOL_QT6_LRC = "$(TOOL_QT6_LRC)"'
@$(ECHO) ' TOOL_QT6_LUPDATE = "$(TOOL_QT6_LUPDATE)"'
-
14 changes: 7 additions & 7 deletions pkgs/applications/virtualization/virtualbox/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ oldVersion="$(nix-instantiate --eval -E "with import $nixpkgs {}; $attr.version
latestVersion="$(curl -sS https://download.virtualbox.org/virtualbox/LATEST.TXT)"

function fileShaSum() {
echo "$1" | grep -w $2 | cut -f1 -d' '
echo "$1" | grep -w "$2" | cut -f1 -d' '
}
function oldHash() {
nix-instantiate --eval --strict -A "$1.drvAttrs.outputHash" | tr -d '"'
Expand All @@ -20,10 +20,10 @@ function nixFile() {
}

if [ ! "$oldVersion" = "$latestVersion" ]; then
shaSums=$(curl -sS https://download.virtualbox.org/virtualbox/$latestVersion/SHA256SUMS)
shaSums=$(curl -sS "https://download.virtualbox.org/virtualbox/$latestVersion/SHA256SUMS")

virtualBoxShaSum=$(fileShaSum "$shaSums" "VirtualBox-$latestVersion.tar.bz2")
extpackShaSum=$(fileShaSum "$shaSums" "Oracle_VM_VirtualBox_Extension_Pack-$latestVersion.vbox-extpack")
extpackShaSum=$(fileShaSum "$shaSums" "Oracle_VirtualBox_Extension_Pack-$latestVersion.vbox-extpack")
guestAdditionsIsoShaSum=$(fileShaSum "$shaSums" "*VBoxGuestAdditions_$latestVersion.iso")

virtualboxNixFile=$(nixFile ${attr})
Expand All @@ -36,15 +36,15 @@ if [ ! "$oldVersion" = "$latestVersion" ]; then

sed -e "s/virtualboxVersion =.*;/virtualboxVersion = \"$latestVersion\";/g" \
-e "s/virtualboxSha256 =.*;/virtualboxSha256 = \"$virtualBoxShaSum\";/g" \
-i $virtualboxNixFile
-i "$virtualboxNixFile"
sed -i -e 's|value = "'$extpackOldShaSum'"|value = "'$extpackShaSum'"|' $extpackNixFile
sed -e "s/sha256 =.*;/sha256 = \"$guestAdditionsIsoShaSum\";/g" \
-i $guestAdditionsIsoNixFile
-i "$guestAdditionsIsoNixFile"
sed -e "s/version =.*;/version = \"$latestVersion\";/g" \
-e "s/sha256 =.*;/sha256 = \"$virtualBoxShaSum\";/g" \
-i $virtualboxGuestAdditionsNixFile
-i "$virtualboxGuestAdditionsNixFile"

git add $virtualboxNixFile $extpackNixFile $guestAdditionsIsoNixFile $virtualboxGuestAdditionsNixFile
git add "$virtualboxNixFile" "$extpackNixFile" "$guestAdditionsIsoNixFile" "$virtualboxGuestAdditionsNixFile"
git commit -m "$attr: ${oldVersion} -> ${latestVersion}"
else
echo "$attr is already up-to-date"
Expand Down