virtualbox: Allow building with extension pack.

The extension pack is needed in order to have USB 2.0, RDP and PXE boot support
and is _not_ part of the free version, so please read their conditions before
using it:

https://www.virtualbox.org/wiki/VirtualBox_PUEL

Further information and details about the extension pack is available here:

https://www.virtualbox.org/manual/ch01.html#intro-installing

I'm wimping out here and use requireFile to ask the user to fetch the extension
pack manually, simply because I'm not a lawyer. I've seen other distributions
that fetch the extension packs directly from upstream, but I'm not sure if that
is according to Oracle's PUEL.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2012-12-12 07:12:46 +01:00
parent 6acc5289fc
commit 5a3f9c08b0
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -4,6 +4,7 @@
, xorriso, makeself, perl, pkgconfig
, javaBindings ? false, jdk ? null
, pythonBindings ? false, python ? null
, enableExtensionPack ? false, requireFile ? null, patchelf ? null
}:
with stdenv.lib;
@ -11,6 +12,7 @@ with stdenv.lib;
let
version = "4.2.4";
extpackRevision = "81684";
forEachModule = action: ''
for mod in \
@ -29,6 +31,14 @@ let
done
'';
extensionPack = requireFile {
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRevision}"
+ ".vbox-extpack";
# Has to be base16 because it's used as an input to VBoxExtPackHelperApp!
sha256 = "62078e057a4ab56aec5ac086746522b3d94787333d0444169471fa5152c609ed";
url = "https://www.virtualbox.org/wiki/Downloads";
};
in stdenv.mkDerivation {
name = "virtualbox-${version}-${kernel.version}";
@ -108,6 +118,15 @@ in stdenv.mkDerivation {
ln -s "$libexec/$file" $out/bin/$file
done
${optionalString enableExtensionPack ''
"$libexec/VBoxExtPackHelperApp" install \
--base-dir "$libexec/ExtensionPacks" \
--cert-dir "$libexec/ExtPackCertificates" \
--name "Oracle VM VirtualBox Extension Pack" \
--tarball "${extensionPack}"
--sha-256 "${extensionPack.outputHash}"
''}
# Create and fix desktop item
mkdir -p $out/share/applications
sed -i -e "s|Icon=VBox|Icon=$libexec/VBox.png|" $libexec/virtualbox.desktop