Commit 331d80d9 authored by Yarny0's avatar Yarny0
Browse files

virtualbox: fix symlink to guest additions iso

Before the commit at hand, the build recipe of
the guest additions iso put the iso file in a directory, with
a name that includes the nix store hash of the fetchurl result.
The virtualbox build recipe doesn't know about
that hash and creates a link without target.
Symptom of this bug is that VirtualBox won't find the iso and
will download it when the user wants to insert the guest iso.

The commit implements two changes:
* The iso build recipe is simplified so its result is
  the direct result of `fetchurl`, i.e., it is the iso
  file without being wrapped in a dedicated directory.
* The symlink now simply points to the result of
  the fetchurl call, hence to the iso file, as it should.
parent 5c24cf2f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ in stdenv.mkDerivation {

    mkdir -p "$out/share/virtualbox"
    cp -rv src/VBox/Main/UnattendedTemplates "$out/share/virtualbox"
    ln -s "${virtualboxGuestAdditionsIso}/VBoxGuestAdditions_${version}.iso" "$out/share/virtualbox/VBoxGuestAdditions.iso"
    ln -s "${virtualboxGuestAdditionsIso}" "$out/share/virtualbox/VBoxGuestAdditions.iso"
  '';

  preFixup = optionalString (!headless) ''
+4 −15
Original line number Diff line number Diff line
{ stdenv, fetchurl, lib, virtualbox}:
{ fetchurl, lib, virtualbox}:

let
  inherit (virtualbox) version;
in
stdenv.mkDerivation rec {
  pname = "VirtualBox-GuestAdditions-iso";
  inherit version;

  src = fetchurl {
fetchurl {
  url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
  sha256 = "0efbcb9bf4722cb19292ae00eba29587432e918d3b1f70905deb70f7cf78e8ce";
  };

  buildCommand = ''
    mkdir -p $out
    cp $src $out/
  '';

  meta = {
    description = "Guest additions ISO for VirtualBox";
    longDescription = ''