VirtualBox-GuestAdditions: Add to the channel

This commit is contained in:
Eelco Dolstra 2012-08-14 13:43:37 -04:00
parent 9d516f16fc
commit c67c397c11

View File

@ -17,16 +17,16 @@ stdenv.mkDerivation {
cp -r install/* $out
'';
buildCommand = ''
${if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then ''
isoinfo -J -i $src -x /VBoxLinuxAdditions.run > ./VBoxLinuxAdditions.run
chmod 755 ./VBoxLinuxAdditions.run
./VBoxLinuxAdditions.run --noexec --keep
./VBoxLinuxAdditions.run --noexec --keep
''
else throw ("Architecture: "+stdenv.system+" not supported for VirtualBox guest additions")
}
# Unpack files
cd install
${if stdenv.system == "i686-linux" then ''
@ -38,31 +38,31 @@ stdenv.mkDerivation {
else throw ("Architecture: "+stdenv.system+" not supported for VirtualBox guest additions")
}
# Build kernel modules
cd src
# Build kernel modules
cd src
for i in *
do
cd $i
find . -type f | xargs sed 's/depmod -a/true/' -i
make
cd ..
cd $i
find . -type f | xargs sed 's/depmod -a/true/' -i
make
cd ..
done
cd ..
# Change the interpreter for various binaries
for i in sbin/VBoxService bin/{VBoxClient,VBoxControl}
do
${if stdenv.system == "i686-linux" then ''
patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 $i
''
else if stdenv.system == "x86_64-linux" then ''
patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $i
''
else throw ("Architecture: "+stdenv.system+" not supported for VirtualBox guest additions")
}
''
else if stdenv.system == "x86_64-linux" then ''
patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $i
''
else throw ("Architecture: "+stdenv.system+" not supported for VirtualBox guest additions")
}
done
# Change rpath for various binaries and libraries
@ -72,11 +72,11 @@ stdenv.mkDerivation {
do
patchelf --set-rpath $out/lib $i
done
# Remove references to /usr from various scripts and files
sed -i -e "s|/usr/bin|$out/bin|" share/VBoxGuestAdditions/vboxclient.desktop
sed -i -e "s|/usr/bin|$out/bin|" bin/VBoxClient-all
# Install binaries
mkdir -p $out/sbin
install -m 755 sbin/VBoxService $out/sbin
@ -94,7 +94,7 @@ stdenv.mkDerivation {
cp -v lib/VBoxOGL*.so $out/lib
mkdir -p $out/lib/dri
ln -s $out/lib/VBoxOGL.so $out/lib/dri/vboxvideo_dri.so
# Install desktop file
mkdir -p $out/share/autostart
cp -v share/VBoxGuestAdditions/vboxclient.desktop $out/share/autostart
@ -103,23 +103,23 @@ stdenv.mkDerivation {
mkdir -p $out/lib/xorg/modules/{drivers,input}
install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_19.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
# There doesn't appear to be a vboxmouse driver for Xorg 1.9. Was there ever?
# install -m 644 lib/VBoxGuestAdditions/vboxmouse_drv_19.so $out/lib/xorg/modules/input/vboxmouse_drv.so
#install -m 644 lib/VBoxGuestAdditions/vboxmouse_drv_19.so $out/lib/xorg/modules/input/vboxmouse_drv.so
# Install kernel modules
cd src
for i in *
do
cd $i
kernelVersion=$(cd ${kernel}/lib/modules; ls)
export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
find . -type f | xargs sed -i -e "s|-o root||g" \
-e "s|-g root||g"
make install
cd ..
done
'';
kernelVersion=$(cd ${kernel}/lib/modules; ls)
export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
find . -type f | xargs sed -i -e "s|-o root||g" \
-e "s|-g root||g"
make install
cd ..
done
''; # */
meta = {
description = "Guest additions for VirtualBox";
longDescriptions = ''
@ -129,5 +129,6 @@ stdenv.mkDerivation {
'';
license = "GPL";
maintainers = [ lib.maintainers.sander ];
platforms = lib.platforms.linux;
};
}