virtualbox: make guest additions use driver according to xserver version

This commit is contained in:
Vladimír Čunát 2013-06-23 13:57:13 +02:00 committed by Bjørn Forsman
parent 43c9ab900b
commit 45f7b9c319
2 changed files with 9 additions and 5 deletions

View File

@ -1,8 +1,11 @@
{ stdenv, fetchurl, lib, patchelf, cdrkit, kernelDev, which, makeWrapper
, libX11, libXt, libXext, libXmu, libXcomposite, libXfixes, libXrandr, libXcursor
, dbus }:
, xorg, dbus }:
let version = "4.2.12"; in
let
version = "4.2.12";
xserverVListFunc = builtins.elemAt (stdenv.lib.splitString "." xorg.xorgserver.version);
xserverABI = xserverVListFunc 0 + xserverVListFunc 1;
in
stdenv.mkDerivation {
name = "VirtualBox-GuestAdditions-${version}-${kernelDev.version}";
@ -22,7 +25,7 @@ stdenv.mkDerivation {
'';
buildCommand = ''
buildCommand = with xorg; ''
${if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then ''
isoinfo -J -i $src -x /VBoxLinuxAdditions.run > ./VBoxLinuxAdditions.run
chmod 755 ./VBoxLinuxAdditions.run
@ -104,7 +107,7 @@ stdenv.mkDerivation {
# Install Xorg drivers
mkdir -p $out/lib/xorg/modules/{drivers,input}
install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_113.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_${xserverABI}.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
# Install kernel modules
cd src

View File

@ -209,6 +209,7 @@ in
rm -fr $out/share/X11/xkb/compiled
ln -s /var/tmp $out/share/X11/xkb/compiled
'';
passthru.version = (builtins.parseDrvName attrs.name).version; # needed by virtualbox guest additions
};