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.
This commit is contained in:
Yarny0 2024-04-24 17:13:28 +02:00
parent 5c24cf2f0a
commit 331d80d9e5
2 changed files with 5 additions and 16 deletions

View File

@ -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) ''

View File

@ -1,22 +1,11 @@
{ stdenv, fetchurl, lib, virtualbox}:
{ fetchurl, lib, virtualbox}:
let
inherit (virtualbox) version;
in
stdenv.mkDerivation rec {
pname = "VirtualBox-GuestAdditions-iso";
inherit version;
src = fetchurl {
url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
sha256 = "0efbcb9bf4722cb19292ae00eba29587432e918d3b1f70905deb70f7cf78e8ce";
};
buildCommand = ''
mkdir -p $out
cp $src $out/
'';
fetchurl {
url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
sha256 = "0efbcb9bf4722cb19292ae00eba29587432e918d3b1f70905deb70f7cf78e8ce";
meta = {
description = "Guest additions ISO for VirtualBox";
longDescription = ''