@@ -1,6 +1,6 @@
1−{ stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2, libX11, xproto, libXext
2−, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernel, lvm2
3−, libXrandr
1+{ stdenv, buildEnv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2, libX11, xproto, libXext
2+, libXcursor, libXmu, qt5, libIDL, SDL, libcap, zlib, libpng, glib, kernel, lvm2
3+, libXrandr, libXinerama
44, which, alsaLib, curl, libvpx, gawk, nettools, dbus
55, xorriso, makeself, perl, pkgconfig, nukeReferences
66, javaBindings ? false, jdk ? null
@@ -20,7 +20,7 @@ let
2020 # revision/hash as well. See
2121 # http://download.virtualbox.org/virtualbox/${version}/SHA256SUMS
2222 # for hashes.
23− version = "5.0.26";
23+ version = "5.1.4";
2424
2525 forEachModule = action: ''
2626 for mod in \
@@ -41,12 +41,12 @@ let
4141 '';
4242
4343 # See https://github.com/NixOS/nixpkgs/issues/672 for details
44− extpackRevision = "108824";
44+ extpackRevision = "110228";
4545 extensionPack = requireFile rec {
4646 name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRevision}.vbox-extpack";
4747 # IMPORTANT: Hash must be base16 encoded because it's used as an input to
4848 # VBoxExtPackHelperApp!
49− sha256 = "2f2302c7ba3d00a1258fe8e7767a6eb08dccdc3c31f6e3eeb74063c2c268b104";
49+ sha256 = "9462ff1b567c37ad9a33c0c7ca1925776615ec89b5a72563f29a8cc8514cf316";
5050 message = ''
5151 In order to use the extension pack, you need to comply with the VirtualBox Personal Use
5252 and Evaluation License (PUEL) available at:
@@ -60,23 +60,28 @@ let
6060 '';
6161 };
6262
63+ vbox-qt5-env = buildEnv {
64+ name = "vbox-qt5-env-${version}";
65+ paths = [ qt5.qtbase.dev qt5.qtbase.out qt5.qtx11extras.dev qt5.qtx11extras.out qt5.qttools.dev ];
66+ };
67+
6368in stdenv.mkDerivation {
6469 name = "virtualbox-${version}-${kernel.version}";
6570
6671 src = fetchurl {
6772 url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
68− sha256 = "78dec1369d2c8feefea3c682d95e76c0e99414c56626388035cf4061d4dad62e";
73+ sha256 = "b9a14a7771059c55c44b97f8d4eef9bea84544f3e215e0caa563bc35e2f16aaf";
6974 };
7075
7176 buildInputs =
7277 [ iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor libIDL
7378 libcap glib lvm2 python alsaLib curl libvpx pam xorriso makeself perl
74− pkgconfig which libXmu nukeReferences ]
79+ pkgconfig which libXmu nukeReferences libpng ]
7580 ++ optional javaBindings jdk
7681 ++ optional pythonBindings python
7782 ++ optional pulseSupport libpulseaudio
78− ++ optionals (headless) [ libXrandr libpng ]
79− ++ optionals (!headless) [ qt4 SDL ];
83+ ++ optionals (headless) [ libXrandr ]
84+ ++ optionals (!headless) [ vbox-qt5-env libXinerama SDL ];
8085
8186 hardeningDisable = [ "fortify" "pic" "stackprotector" ];
8287
@@ -103,11 +108,12 @@ in stdenv.mkDerivation {
103108 set +x
104109 '';
105110
106− patches = optional enableHardening ./hardened.patch;
111+ patches = optional enableHardening ./hardened.patch
112+ ++ [ ./libressl.patch ];
107113
108114 postPatch = ''
109115 sed -i -e 's|/sbin/ifconfig|${nettools}/bin/ifconfig|' \
110− src/apps/adpctl/VBoxNetAdpCtl.cpp
116+ src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp
111117 '';
112118
113119 # first line: ugly hack, and it isn't yet clear why it's a problem
@@ -135,7 +141,7 @@ in stdenv.mkDerivation {
135141
136142 ./configure \
137143 ${optionalString headless "--build-headless"} \
138− ${optionalString (!headless) "--with-qt4-dir=${qt4}"} \
144+ ${optionalString (!headless) "--with-qt-dir=${vbox-qt5-env}"} \
139145 ${optionalString (!javaBindings) "--disable-java"} \
140146 ${optionalString (!pythonBindings) "--disable-python"} \
141147 ${optionalString (!pulseSupport) "--disable-pulse"} \