1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-22 09:20:58 +03:00

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

This commit is contained in:
Sandro 2024-12-18 22:30:03 +01:00 committed by GitHub
commit d9c37ce201
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 59 additions and 94 deletions

View file

@ -446,7 +446,7 @@ in mapAttrs (mkVBoxTest {} vboxVMs) {
create_vm_simple() create_vm_simple()
machine.succeed(ru("VirtualBox >&2 &")) 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.sleep(5)
machine.screenshot("gui_manager_started") machine.screenshot("gui_manager_started")
send_vm_startup() send_vm_startup()

View file

@ -10,7 +10,6 @@
pam, pam,
libxslt, libxslt,
libxml2, libxml2,
wrapQtAppsHook,
libX11, libX11,
xorgproto, xorgproto,
libXext, libXext,
@ -28,11 +27,7 @@
libXinerama, libXinerama,
libopus, libopus,
libtpms, libtpms,
qtbase, qt6,
qtx11extras,
qttools,
qtsvg,
qtwayland,
pkg-config, pkg-config,
which, which,
docbook_xsl, docbook_xsl,
@ -78,8 +73,8 @@ let
buildType = "release"; buildType = "release";
# Use maintainers/scripts/update.nix to update the version and all related hashes or # 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. # change the hashes in extpack.nix and guest-additions/default.nix as well manually.
virtualboxVersion = "7.0.22"; virtualboxVersion = "7.1.4";
virtualboxSha256 = "cf3ddf633ca410f1b087b0722413e83247cda4f14d33323dc122a4a42ff61981"; virtualboxSha256 = "872e7a42b41f8558abbf887f1bdc7aac932bb88b2764d07cbce270cab57e3b5e";
kvmPatchVersion = "20240828"; kvmPatchVersion = "20240828";
kvmPatchHash = "sha256-g0esJbB1IGyLGZMLFJIY8ZYdHWuiM5IZtLMHZvCY6bs="; kvmPatchHash = "sha256-g0esJbB1IGyLGZMLFJIY8ZYdHWuiM5IZtLMHZvCY6bs=";
@ -97,6 +92,14 @@ let
getDev getDev
getLib getLib
; ;
inherit (qt6)
qtbase
qttools
qtsvg
qtwayland
qtscxml
wrapQtAppsHook
;
in in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "virtualbox"; pname = "virtualbox";
@ -164,7 +167,8 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals headless [ libGL ] ++ optionals headless [ libGL ]
++ optionals (!headless) [ ++ optionals (!headless) [
qtbase qtbase
qtx11extras qttools
qtscxml
libXinerama libXinerama
SDL2 SDL2
libGLU libGLU
@ -188,7 +192,7 @@ stdenv.mkDerivation (finalAttrs: {
-e 's@CXX_FLAGS="\(.*\)"@CXX_FLAGS="-std=c++11 \1"@' \ -e 's@CXX_FLAGS="\(.*\)"@CXX_FLAGS="-std=c++11 \1"@' \
${ ${
optionalString (!headless) '' optionalString (!headless) ''
-e 's@TOOLQT5BIN=.*@TOOLQT5BIN="${getDev qtbase}/bin"@' \ -e 's@TOOLQT6BIN=.*@TOOLQT6BIN="${getDev qttools}/bin"@' \
'' ''
} -i configure } -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 ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2
@ -215,8 +219,8 @@ stdenv.mkDerivation (finalAttrs: {
# No update patch disables check for update function # No update patch disables check for update function
# https://bugs.launchpad.net/ubuntu/+source/virtualbox-ose/+bug/272212 # https://bugs.launchpad.net/ubuntu/+source/virtualbox-ose/+bug/272212
(fetchpatch { (fetchpatch {
url = "https://salsa.debian.org/pkg-virtualbox-team/virtualbox/-/raw/debian/7.0.14-dfsg-1/debian/patches/16-no-update.patch"; url = "https://salsa.debian.org/pkg-virtualbox-team/virtualbox/-/raw/42a1ca1291fde365bfba140cb21a8a074aaccce2/debian/patches/16-no-update.patch";
hash = "sha256-UJHpuB6QB/BbxJorlqZXUF12lgq8gbLMRHRMsbyqRpY="; hash = "sha256-qM2e4DkkpmA18Z76OUsnY1MhcGb1dT2PG68JUy6fZEE=";
}) })
] ]
++ [ ./extra_symbols.patch ] ++ [ ./extra_symbols.patch ]
@ -229,7 +233,7 @@ stdenv.mkDerivation (finalAttrs: {
# the user's icon theme can be loaded. # the user's icon theme can be loaded.
++ optional (!headless && enableHardening) (substituteAll { ++ optional (!headless && enableHardening) (substituteAll {
src = ./qt-env-vars.patch; 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, # 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. # we don't take any chances and only apply it if people actually want to use KVM support.
@ -282,16 +286,17 @@ stdenv.mkDerivation (finalAttrs: {
''} ''}
${optionalString (!headless) '' ${optionalString (!headless) ''
VBOX_WITH_VBOXSDL := 1 VBOX_WITH_VBOXSDL := 1
PATH_QT5_X11_EXTRAS_LIB := ${getLib qtx11extras}/lib PATH_QT6_TOOLS_LIB := ${getLib qttools}/lib
PATH_QT5_X11_EXTRAS_INC := ${getDev qtx11extras}/include PATH_QT6_TOOLS_INC := ${getLib qttools}/include
PATH_QT5_TOOLS_LIB := ${getLib qttools}/lib PATH_QT6_SCXML_LIB := ${getLib qtscxml}/lib
PATH_QT5_TOOLS_INC := ${getDev qttools}/include PATH_QT6_SCXML_INC := ${getLib qtscxml}/include
VBOX_PATH_QT := ${getLib qttools}/
''} ''}
${optionalString enableWebService '' ${optionalString enableWebService ''
# fix gsoap missing zlib include and produce errors with --as-needed # fix gsoap missing zlib include and produce errors with --as-needed
VBOX_GSOAP_CXX_LIBS := gsoapssl++ z VBOX_GSOAP_CXX_LIBS := gsoapssl++ z
''} ''}
TOOL_QT5_LRC := ${getDev qttools}/bin/lrelease TOOL_QT6_LRC := ${getLib qttools}/bin/lrelease
LOCAL_CONFIG LOCAL_CONFIG
./configure \ ./configure \
@ -344,7 +349,7 @@ stdenv.mkDerivation (finalAttrs: {
"$libexec/VBoxExtPackHelperApp" install \ "$libexec/VBoxExtPackHelperApp" install \
--base-dir "$share/ExtensionPacks" \ --base-dir "$share/ExtensionPacks" \
--cert-dir "$share/ExtPackCertificates" \ --cert-dir "$share/ExtPackCertificates" \
--name "Oracle VM VirtualBox Extension Pack" \ --name "Oracle VirtualBox Extension Pack" \
--tarball "${extensionPack}" \ --tarball "${extensionPack}" \
--sha-256 "${extensionPack.outputHash}" --sha-256 "${extensionPack.outputHash}"
EOF EOF

View file

@ -7,14 +7,14 @@ let
inherit (virtualbox) version; inherit (virtualbox) version;
in in
fetchurl rec { 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}"; url = "https://download.virtualbox.org/virtualbox/${version}/${name}";
sha256 = sha256 =
# Manually sha256sum the extensionPack file, must be hex! # Manually sha256sum the extensionPack file, must be hex!
# Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`. # 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 # Checksums can also be found at https://www.virtualbox.org/download/hashes/${version}/SHA256SUMS
let let
value = "6b0c16074dde1ea273b15e091336034368217ba569e09359a63c4d32af558886"; value = "9dd60ef3c52c2a318fbbb6faace5862a299b61f678a579988869865dcf7390b6";
in in
assert (builtins.stringLength value) == 64; assert (builtins.stringLength value) == 64;
value; value;

View file

@ -9,7 +9,7 @@ let
in in
fetchurl { fetchurl {
url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso"; url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
sha256 = "486f90cbfe9ed4bf2b12d726ebf54a839758a237e967aa65fc2c92d90a963021"; sha256 = "80c91d35742f68217cf47b13e5b50d53f54c22c485bacce41ad7fdc321649e61";
meta = { meta = {
description = "Guest additions ISO for VirtualBox"; description = "Guest additions ISO for VirtualBox";
longDescription = '' longDescription = ''

View file

@ -28,11 +28,11 @@ let
in in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "VirtualBox-GuestAdditions-builder-${kernel.version}"; pname = "VirtualBox-GuestAdditions-builder-${kernel.version}";
version = "7.0.22"; version = "7.1.4";
src = fetchurl { src = fetchurl {
url = "https://download.virtualbox.org/virtualbox/${finalAttrs.version}/VirtualBox-${finalAttrs.version}.tar.bz2"; 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"; env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration";
@ -72,11 +72,6 @@ stdenv.mkDerivation (finalAttrs: {
rm -r src/libs/zlib*/ rm -r src/libs/zlib*/
''; '';
patches = [
## https://www.virtualbox.org/changeset/100258/vbox
./no-legacy-xorg.patch
];
postPatch = '' postPatch = ''
set -x set -x
sed -e 's@MKISOFS --version@MKISOFS -version@' \ sed -e 's@MKISOFS --version@MKISOFS -version@' \

View file

@ -1,45 +0,0 @@
# https://www.virtualbox.org/changeset/100258/vbox
diff --git a/src/VBox/Additions/linux/Makefile.kmk b/src/VBox/Additions/linux/Makefile.kmk
index 0921b3fe619..de9e98b4989 100644
--- a/src/VBox/Additions/linux/Makefile.kmk
+++ b/src/VBox/Additions/linux/Makefile.kmk
@@ -136,23 +136,29 @@ VBOX_LNX_ADD_STRIP_SBIN += \
$(if $(VBOX_WITH_LIGHTDM_GREETER),vbox-greeter)
VBOX_LNX_ADD_STRIP_MOD = \
- vboxmouse_drv_70.so \
- vboxmouse_drv_71.so \
- vboxmouse_drv_13.so \
- vboxmouse_drv_14.so \
- vboxmouse_drv_15.so \
- vboxmouse_drv_16.so \
- $(addsuffix .so,$(filter-out %_32,$(filter vboxvideo_drv_%,$(DLLS)))) \
$(if $(VBOX_WITH_PAM),pam_vbox.so,) \
mount.vboxsf
+ifndef VBOX_NO_LEGACY_XORG_X11
+ VBOX_LNX_ADD_STRIP_MOD += \
+ vboxmouse_drv_70.so \
+ vboxmouse_drv_71.so \
+ vboxmouse_drv_13.so \
+ vboxmouse_drv_14.so \
+ vboxmouse_drv_15.so \
+ vboxmouse_drv_16.so \
+ $(addsuffix .so,$(filter-out %_32,$(filter vboxvideo_drv_%,$(DLLS))))
+endif
+
VBOX_LNX_ADD_MOD = \
98vboxadd-xclient \
x11config.sh
-VBOX_LNX_ADD_STRIP_OBJ = \
- vboxmouse_drv.o \
- vboxvideo_drv.o
+ifndef VBOX_NO_LEGACY_XORG_X11
+ VBOX_LNX_ADD_STRIP_OBJ = \
+ vboxmouse_drv.o \
+ vboxvideo_drv.o
+endif
VBOX_LNX_ADD_INIT = \
vboxadd \

View file

@ -1,16 +1,26 @@
diff --git a/kBuild/units/qt5.kmk b/kBuild/units/qt5.kmk diff --git a/kBuild/units/qt6.kmk b/kBuild/units/qt6.kmk
index 71b96a3..73391f0 100644 index 28d61005..d65205cf 100644
--- a/kBuild/units/qt5.kmk --- a/kBuild/units/qt6.kmk
+++ b/kBuild/units/qt5.kmk +++ b/kBuild/units/qt6.kmk
@@ -1054,9 +1054,9 @@ else @@ -1131,9 +1131,14 @@ else
$(eval $(target)_LIBS += $(PATH_SDK_QT5_LIB)/$(qt_prefix)qtmain$(qt_infix)$(SUFF_LIB) ) ifeq ($(bld_trg),win)
endif $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT6_LIB)/$(qt_prefix)Qt6$(module)$(qt_infix)$(SUFF_LIB)) )
else 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), $(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_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), \
+ $(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 endif
- $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT5_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT5_INC) ) - $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT6_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT6_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) $(PATH_QT6_TOOLS_INC) $(PATH_QT6_SCXML_INC)/QtStateMachine )
endif endif
$(eval $(target)_DEFS += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) ) $(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)"'
-

View file

@ -10,7 +10,7 @@ oldVersion="$(nix-instantiate --eval -E "with import $nixpkgs {}; $attr.version
latestVersion="$(curl -sS https://download.virtualbox.org/virtualbox/LATEST.TXT)" latestVersion="$(curl -sS https://download.virtualbox.org/virtualbox/LATEST.TXT)"
function fileShaSum() { function fileShaSum() {
echo "$1" | grep -w $2 | cut -f1 -d' ' echo "$1" | grep -w "$2" | cut -f1 -d' '
} }
function oldHash() { function oldHash() {
nix-instantiate --eval --strict -A "$1.drvAttrs.outputHash" | tr -d '"' nix-instantiate --eval --strict -A "$1.drvAttrs.outputHash" | tr -d '"'
@ -20,10 +20,10 @@ function nixFile() {
} }
if [ ! "$oldVersion" = "$latestVersion" ]; then 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") 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") guestAdditionsIsoShaSum=$(fileShaSum "$shaSums" "*VBoxGuestAdditions_$latestVersion.iso")
virtualboxNixFile=$(nixFile ${attr}) virtualboxNixFile=$(nixFile ${attr})
@ -36,15 +36,15 @@ if [ ! "$oldVersion" = "$latestVersion" ]; then
sed -e "s/virtualboxVersion =.*;/virtualboxVersion = \"$latestVersion\";/g" \ sed -e "s/virtualboxVersion =.*;/virtualboxVersion = \"$latestVersion\";/g" \
-e "s/virtualboxSha256 =.*;/virtualboxSha256 = \"$virtualBoxShaSum\";/g" \ -e "s/virtualboxSha256 =.*;/virtualboxSha256 = \"$virtualBoxShaSum\";/g" \
-i $virtualboxNixFile -i "$virtualboxNixFile"
sed -i -e 's|value = "'$extpackOldShaSum'"|value = "'$extpackShaSum'"|' $extpackNixFile sed -i -e 's|value = "'$extpackOldShaSum'"|value = "'$extpackShaSum'"|' $extpackNixFile
sed -e "s/sha256 =.*;/sha256 = \"$guestAdditionsIsoShaSum\";/g" \ sed -e "s/sha256 =.*;/sha256 = \"$guestAdditionsIsoShaSum\";/g" \
-i $guestAdditionsIsoNixFile -i "$guestAdditionsIsoNixFile"
sed -e "s/version =.*;/version = \"$latestVersion\";/g" \ sed -e "s/version =.*;/version = \"$latestVersion\";/g" \
-e "s/sha256 =.*;/sha256 = \"$virtualBoxShaSum\";/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}" git commit -m "$attr: ${oldVersion} -> ${latestVersion}"
else else
echo "$attr is already up-to-date" echo "$attr is already up-to-date"