diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/virtualization/virtualbox')
9 files changed, 113 insertions, 129 deletions
diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/default.nix b/nixpkgs/pkgs/applications/virtualization/virtualbox/default.nix index fd572a9f2ebe..5c6510e8cab8 100644 --- a/nixpkgs/pkgs/applications/virtualization/virtualbox/default.nix +++ b/nixpkgs/pkgs/applications/virtualization/virtualbox/default.nix @@ -1,11 +1,11 @@ -{ config, stdenv, fetchurl, lib, fetchpatch, iasl, dev86, pam, libxslt, libxml2 +{ config, stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2 , libX11, xorgproto, libXext, libXcursor, libXmu, qt5, libIDL, SDL, libcap , libpng, glib, lvm2, libXrandr, libXinerama, libopus , pkgconfig, which, docbook_xsl, docbook_xml_dtd_43 , alsaLib, curl, libvpx, nettools, dbus , makeself, perl , javaBindings ? false, jdk ? null -, pythonBindings ? false, python2 ? null +, pythonBindings ? false, python3 ? null , extensionPack ? null, fakeroot ? null , pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null , enableHardening ? false @@ -17,12 +17,12 @@ with stdenv.lib; let - python = python2; + python = python3; buildType = "release"; # Remember to change the extpackRev and version in extpack.nix and # guest-additions/default.nix as well. - main = "0jmrbyhs92lyarpvylxqn2ajxdg9b290w5nd4g0i4h83d28bwbw0"; - version = "5.2.28"; + main = "0lp584a350ya1zn03lhgmdbi91yp8yfja9hlg2jz1xyfj2dc869l"; + version = "6.0.6"; in stdenv.mkDerivation { name = "virtualbox-${version}"; @@ -76,11 +76,12 @@ in stdenv.mkDerivation { optional enableHardening ./hardened.patch ++ [ ./qtx11extras.patch - (fetchpatch { - name = "010-qt-5.11.patch"; - url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/010-qt-5.11.patch?h=packages/virtualbox"; - sha256 = "0hjx99pg40wqyggnrpylrp5zngva4xrnk7r90i0ynrqc7n84g9pn"; - }) + # https://www.virtualbox.org/ticket/18620 + ./fix_kbuild.patch + # https://www.virtualbox.org/ticket/18621 + ./fix_module_makefile_sed.patch + # https://forums.virtualbox.org/viewtopic.php?f=7&t=92815 + ./fix_printk_test.patch ]; postPatch = '' @@ -192,6 +193,6 @@ in stdenv.mkDerivation { license = licenses.gpl2; homepage = https://www.virtualbox.org/; maintainers = with maintainers; [ flokli sander ]; - platforms = [ "x86_64-linux" "i686-linux" ]; + platforms = [ "x86_64-linux" ]; }; } diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/extpack.nix b/nixpkgs/pkgs/applications/virtualization/virtualbox/extpack.nix index 0e8a6eb25da5..d26909ad79aa 100644 --- a/nixpkgs/pkgs/applications/virtualization/virtualbox/extpack.nix +++ b/nixpkgs/pkgs/applications/virtualization/virtualbox/extpack.nix @@ -2,7 +2,7 @@ with lib; -let version = "5.2.28"; +let version = "6.0.6"; in fetchurl rec { name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack"; @@ -10,7 +10,7 @@ fetchurl rec { sha256 = # Manually sha256sum the extensionPack file, must be hex! # Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`. - let value = "376e07cbf2ff2844c95c800346c8e4697d7bc671ae0e21e46153b2e7b4ccc1d6"; + let value = "794f023a186bd217c29c3d30bd1434b6e9de3b242c7bf740d06d10f2d3d981c6"; in assert (builtins.stringLength value) == 64; value; meta = { @@ -18,6 +18,6 @@ fetchurl rec { license = licenses.virtualbox-puel; homepage = https://www.virtualbox.org/; maintainers = with maintainers; [ flokli sander cdepillabout ]; - platforms = [ "x86_64-linux" "i686-linux" ]; + platforms = [ "x86_64-linux" ]; }; } diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_kbuild.patch b/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_kbuild.patch new file mode 100644 index 000000000000..7cafeada7d9e --- /dev/null +++ b/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_kbuild.patch @@ -0,0 +1,12 @@ +diff -urN a/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile b/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile +--- a/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile ++++ b/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile +@@ -58,7 +58,7 @@ + RT_WITH_VBOX \ + VBOX_WITH_HARDENING \ + VBOX_WITH_64_BITS_GUESTS # <-- must be consistent with Config.kmk! +-VBOXMOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement ++VBOXMOD_CFLAGS = -include $(VBOXNETADPT_DIR)include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement + + include $(obj)/Makefile-footer.gmk + diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_module_makefile_sed.patch b/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_module_makefile_sed.patch new file mode 100644 index 000000000000..6bfa5a4404be --- /dev/null +++ b/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_module_makefile_sed.patch @@ -0,0 +1,36 @@ +diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk +--- VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk 2019-04-16 12:16:38.000000000 +0200 ++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk 2019-05-04 15:19:14.545497602 +0200 +@@ -175,7 +175,7 @@ + | $$(dir $$@) + $(QUIET)$(RM) -f -- $@ + ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $< ++ $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $< + else + $(QUIET)$(CP) -f $< $@ + endif +diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk +--- VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk 2019-04-16 12:16:39.000000000 +0200 ++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk 2019-05-04 15:19:13.809493324 +0200 +@@ -525,7 +525,7 @@ + | $$(dir $$@) + $(QUIET)$(RM) -f -- $@ + ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $< ++ $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $< + else + $(QUIET)$(CP) -f $< $@ + endif +diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxPci/Makefile.kmk VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxPci/Makefile.kmk +--- VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxPci/Makefile.kmk 2019-04-16 12:16:40.000000000 +0200 ++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxPci/Makefile.kmk 2019-05-04 15:42:12.029664987 +0200 +@@ -67,7 +67,7 @@ + | $$(dir $$@) + $(QUIET)$(RM) -f -- $@ + ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $< ++ $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $< + else + $(QUIET)$(CP) -f $< $@ + endif diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_printk_test.patch b/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_printk_test.patch new file mode 100644 index 000000000000..eceaff2dc61f --- /dev/null +++ b/nixpkgs/pkgs/applications/virtualization/virtualbox/fix_printk_test.patch @@ -0,0 +1,14 @@ +diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c VirtualBox-6.0.6.new/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c +--- VirtualBox-6.0.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c 2019-04-16 12:16:37.000000000 +0200 ++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c 2019-05-04 15:59:44.439905223 +0200 +@@ -426,10 +426,8 @@ + int rc; + PSUPDRVSESSION pSession; + Log(("VBoxDrvLinuxCreate: pFilp=%p pid=%d/%d %s\n", pFilp, RTProcSelf(), current->pid, current->comm)); +- printk("test1\n"); + + #ifdef VBOX_WITH_HARDENING +- printk("test2\n"); + /* + * Only root is allowed to access the unrestricted device, enforce it! + */ diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix index ecefc9bc07e9..1a5c6c670c85 100644 --- a/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix +++ b/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper -, xorg, dbus, virtualbox }: +, zlib, xorg, dbus, virtualbox }: let version = virtualbox.version; @@ -19,32 +19,23 @@ stdenv.mkDerivation { src = fetchurl { url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso"; - sha256 = "0cwdmdgcd1jysyw7c9b3cdk1ngk5nq7slh1zkhxkvvq142cnm1v9"; + sha256 = "1srcsf9264l5yxbq2x83z66j38blbfrywq5lkzwb5kih6sv548c3"; }; KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; KERN_INCL = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/include"; - patchFlags = [ "-p1" "-d" "install/src/vboxguest-${version}" ]; - - patches = [ - ./fix_kerndir.patch - ./fix_kernincl.patch - ]; + # If you add a patch you probably need this. + #patchFlags = [ "-p1" "-d" "install/src/vboxguest-${version}" ]; hardeningDisable = [ "pic" ]; NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration"; nativeBuildInputs = [ patchelf makeWrapper ]; - buildInputs = [ cdrkit dbus ] ++ kernel.moduleBuildDependencies; + buildInputs = [ cdrkit ] ++ kernel.moduleBuildDependencies; - installPhase = '' - mkdir -p $out - cp -r install/* $out - ''; - - buildCommand = with xorg; '' + unpackPhase = '' ${if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then '' isoinfo -J -i $src -x /VBoxLinuxAdditions.run > ./VBoxLinuxAdditions.run chmod 755 ./VBoxLinuxAdditions.run @@ -63,39 +54,30 @@ stdenv.mkDerivation { '' else throw ("Architecture: "+stdenv.hostPlatform.system+" not supported for VirtualBox guest additions") } + ''; - cd ../ - patchPhase - cd install/src - - # Build kernel modules - export INSTALL_MOD_PATH=$out + doConfigure = false; + buildPhase = '' + # Build kernel modules. + cd src find . -type f | xargs sed 's/depmod -a/true/' -i - cd vboxguest-${version} - + # Run just make first. If we only did make install, we get symbol warnings during build. make - cd ../.. # Change the interpreter for various binaries - for i in sbin/VBoxService bin/{VBoxClient,VBoxControl} other/mount.vboxsf - do - ${if stdenv.hostPlatform.system == "i686-linux" then '' - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $i - '' - else if stdenv.hostPlatform.system == "x86_64-linux" then '' - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2 $i - '' - else throw ("Architecture: "+stdenv.hostPlatform.system+" not supported for VirtualBox guest additions") - } - patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc dbus libX11 libXt libXext libXmu libXfixes libXrandr libXcursor ]} $i + for i in sbin/VBoxService bin/{VBoxClient,VBoxControl} other/mount.vboxsf; do + patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} $i + patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc zlib + xorg.libX11 xorg.libXt xorg.libXext xorg.libXmu xorg.libXfixes xorg.libXrandr xorg.libXcursor ]} $i done for i in lib/VBoxOGL*.so do - patchelf --set-rpath ${lib.makeLibraryPath [ "$out" dbus libXcomposite libXdamage libXext libXfixes ]} $i + patchelf --set-rpath ${lib.makeLibraryPath [ "$out" + xorg.libXcomposite xorg.libXdamage xorg.libXext xorg.libXfixes ]} $i done # FIXME: Virtualbox 4.3.22 moved VBoxClient-all (required by Guest Additions @@ -105,6 +87,13 @@ stdenv.mkDerivation { # Remove references to /usr from various scripts and files sed -i -e "s|/usr/bin|$out/bin|" other/vboxclient.desktop sed -i -e "s|/usr/bin|$out/bin|" bin/VBoxClient-all + ''; + + installPhase = '' + # Install kernel modules. + cd src/vboxguest-${version} + make install INSTALL_MOD_PATH=$out + cd ../.. # Install binaries install -D -m 755 other/mount.vboxsf $out/bin/mount.vboxsf @@ -131,21 +120,18 @@ stdenv.mkDerivation { # Install Xorg drivers mkdir -p $out/lib/xorg/modules/{drivers,input} install -m 644 other/vboxvideo_drv_${xserverABI}.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so + ''; - # Install kernel modules - cd src + # Stripping breaks these binaries for some reason. + dontStrip = true; - for i in * - do - cd $i - kernelVersion=$(cd ${kernel.dev}/lib/modules; ls) - export MODULE_DIR=$out/lib/modules/$kernelVersion/misc - find . -type f | xargs sed -i -e "s|-o root||g" \ - -e "s|-g root||g" - make install - cd .. + # Some code dlopen() libdbus, patch RUNPATH in fixupPhase so it isn't stripped. + postFixup = '' + for i in $(grep -F libdbus-1.so -l -r $out/{lib,bin}); do + origRpath=$(patchelf --print-rpath "$i") + patchelf --set-rpath "$origRpath:${lib.makeLibraryPath [ dbus ]}" "$i" done - ''; # */ + ''; meta = { description = "Guest additions for VirtualBox"; diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch b/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch deleted file mode 100644 index 0be949f63c92..000000000000 --- a/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/vboxsf/Makefile.include.header b/vboxsf/Makefile.include.header -index 8df1eb4d25..5a3e5604e7 100644 ---- a/vboxsf/Makefile.include.header -+++ b/vboxsf/Makefile.include.header -@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),) - endif # neq($(KERNELRELEASE),) - - # Kernel build folder --KERN_DIR := /lib/modules/$(KERN_VER)/build - ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) - $(error Error: unable to find the headers of the Linux kernel to build against. \ - Specify KERN_VER=<version> and run Make again) - -diff --git a/vboxguest/Makefile.include.header b/vboxguest/Makefile.include.header -index 8df1eb4d25..5a3e5604e7 100644 ---- a/vboxguest/Makefile.include.header -+++ b/vboxguest/Makefile.include.header -@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),) - endif # neq($(KERNELRELEASE),) - - # Kernel build folder --KERN_DIR := /lib/modules/$(KERN_VER)/build - ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) - $(error Error: unable to find the headers of the Linux kernel to build against. \ - Specify KERN_VER=<version> and run Make again) - -diff --git a/vboxvideo/Makefile.include.header b/vboxvideo/Makefile.include.header -index 8df1eb4d25..5a3e5604e7 100644 ---- a/vboxvideo/Makefile.include.header -+++ b/vboxvideo/Makefile.include.header -@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),) - endif # neq($(KERNELRELEASE),) - - # Kernel build folder --KERN_DIR := /lib/modules/$(KERN_VER)/build - ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) - $(error Error: unable to find the headers of the Linux kernel to build against. \ - Specify KERN_VER=<version> and run Make again) diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch b/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch deleted file mode 100644 index e59e2e98c1b3..000000000000 --- a/nixpkgs/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/vboxvideo/Makefile.include.header b/vboxvideo/Makefile.include.header -index 8df1eb4d25..5a3e5604e7 100644 ---- a/vboxvideo/Makefile.include.header -+++ b/vboxvideo/Makefile.include.header -@@ -122,7 +122,6 @@ ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) - Specify KERN_VER=<version> and run Make again) - endif - # Kernel include folder --KERN_INCL := $(KERN_DIR)/include - # module install folder - INSTALL_MOD_DIR ?= misc - MODULE_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KERN_VER)/$(INSTALL_MOD_DIR) diff --git a/nixpkgs/pkgs/applications/virtualization/virtualbox/qtx11extras.patch b/nixpkgs/pkgs/applications/virtualization/virtualbox/qtx11extras.patch index 6ed74e3e23ed..a3aa98b081d1 100644 --- a/nixpkgs/pkgs/applications/virtualization/virtualbox/qtx11extras.patch +++ b/nixpkgs/pkgs/applications/virtualization/virtualbox/qtx11extras.patch @@ -2,30 +2,15 @@ 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 -@@ -1019,9 +1019,10 @@ else +@@ -1054,9 +1054,9 @@ else $(eval $(target)_LIBS += $(PATH_SDK_QT5_LIB)/$(qt_prefix)qtmain$(qt_infix)$(SUFF_LIB) ) endif 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_QT5_LIB)/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) \ -+ $(PATH_QT5_X11_EXTRAS_LIB)/lib$(qt_prefix)Qt5X11Extras$(qt_infix)$(SUFF_DLL)) ++ $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(if $(filter X11Extras,$(module)),$(PATH_QT5_X11_EXTRAS_LIB),$(PATH_SDK_QT5_LIB))/lib$(qt_prefix)Qt5$(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 ) endif $(eval $(target)_DEFS += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) ) -diff --git a/src/VBox/Frontends/VirtualBox/Makefile.kmk b/src/VBox/Frontends/VirtualBox/Makefile.kmk -index 3295bfefe7..796370623c 100644 ---- a/src/VBox/Frontends/VirtualBox/Makefile.kmk -+++ b/src/VBox/Frontends/VirtualBox/Makefile.kmk -@@ -916,9 +916,6 @@ endif - # The Qt modules we're using. - # (The include directory and lib/framework for each module will be added by the Qt unit.) - VirtualBox_QT_MODULES = Core Gui Widgets PrintSupport --VirtualBox_QT_MODULES.linux += X11Extras --VirtualBox_QT_MODULES.solaris += X11Extras --VirtualBox_QT_MODULES.freebsd += X11Extras - VirtualBox_QT_MODULES.darwin += MacExtras - VirtualBox_QT_MODULES.win += WinExtras - if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL) |