/[gentoo-x86]/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-2.0.2.ebuild
Gentoo

Contents of /app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-2.0.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Sep 15 22:13:48 2008 UTC (5 years, 11 months ago) by mr_bones_
Branch: MAIN
Changes since 1.1: +2 -2 lines
whitespace
(Portage version: 2.1.4.4)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-2.0.2.ebuild,v 1.1 2008/09/15 19:50:08 jokey Exp $
4
5 inherit eutils linux-mod
6
7 MY_P=VirtualBox-${PV}-OSE
8 DESCRIPTION="VirtualBox kernel modules and user-space tools for Linux guests"
9 HOMEPAGE="http://www.virtualbox.org/"
10 SRC_URI="http://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="X"
16
17 RDEPEND="x11-libs/libXt
18 amd64? ( app-emulation/emul-linux-x86-xlibs )
19 X? ( ~x11-drivers/xf86-video-virtualbox-${PV}
20 ~x11-drivers/xf86-input-virtualbox-${PV}
21 x11-apps/xrandr
22 x11-apps/xrefresh )"
23 DEPEND="${RDEPEND}
24 >=dev-util/kbuild-0.1.4
25 >=dev-lang/yasm-0.6.2
26 sys-devel/bin86
27 sys-devel/dev86
28 sys-power/iasl
29 x11-proto/renderproto"
30
31 BUILD_TARGETS="all"
32 BUILD_TARGET_ARCH="${ARCH}"
33 MODULE_NAMES="vboxadd(misc:${WORKDIR}/vboxadd:${WORKDIR}/vboxadd)
34 vboxvfs(misc:${WORKDIR}/vboxvfs:${WORKDIR}/vboxvfs)"
35
36 S=${WORKDIR}/${MY_P/-OSE/}
37
38 pkg_setup() {
39 linux-mod_pkg_setup
40 BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}"
41 }
42
43 src_unpack() {
44 unpack ${A}
45
46 # Create and unpack a tarball with the sources of the Linux guest
47 # kernel modules, to include all the needed files
48 "${MY_P/-OSE/}"/src/VBox/Additions/linux/export_modules "${WORKDIR}/vbox-kmod.tar.gz"
49 unpack ./vbox-kmod.tar.gz
50
51 # Remove shipped binaries (kBuild,yasm), see bug #232775
52 cd "${S}"
53 rm -rf kBuild/bin tools
54
55 # Disable things unused or splitted into separate ebuilds
56 cp "${FILESDIR}/${P}-localconfig" LocalConfig.kmk
57 }
58
59 src_compile() {
60 linux-mod_src_compile
61
62 # build the user-space tools, warnings are harmless
63 ./configure --nofatal \
64 --disable-xpcom \
65 --disable-sdl-ttf \
66 --disable-pulse \
67 --disable-alsa \
68 --build-headless || die "configure failed"
69 source ./env.sh
70
71 for each in src/VBox/{Runtime,Additions/common} \
72 src/VBox/Additions/linux{sharefolders,daemon} ; do
73 MAKE="kmk" emake TOOL_YASM_AS=yasm \
74 KBUILD_PATH="${S}/kBuild" \
75 || die "kmk failed"
76 done
77 }
78
79 src_install() {
80 linux-mod_src_install
81
82 cd "${S}"/out/linux.${ARCH}/release/bin/additions
83
84 # shared folders
85 insinto /sbin
86 newins mountvboxsf mount.vboxsf
87 fperms 4755 /sbin/mount.vboxsf
88
89 # time synchronisation system service
90 insinto /usr/sbin
91 doins vboxadd-timesync
92 fperms 0755 /usr/sbin/vboxadd-timesync
93
94 newinitd "${FILESDIR}"/${PN}.initd ${PN}
95
96 # VBoxClient user service and xrandr wrapper
97 if use X; then
98 insinto /usr/bin
99
100 doins VBoxClient
101 doins VBoxComtrol
102 fperms 4755 /usr/bin/VBoxClient
103 fperms 4755 /usr/bin/VBoxControl
104
105 dodir /etc/X11/xinit/xinitrc.d/
106 echo -e "#/bin/sh\n/usr/bin/VBoxClient" \
107 >> "${D}/etc/X11/xinit/xinitrc.d/98VBoxClient"
108 fperms 0755 /etc/X11/xinit/xinitrc.d/98VBoxClient
109
110 cd "${S}"/src/VBox/Additions/x11/installer
111 newins VBoxRandR.sh VBoxRandR
112 fperms 0755 /usr/bin/VBoxRandR
113 fi
114
115 # udev rule for vboxdrv
116 dodir /etc/udev/rules.d
117 echo 'KERNEL=="vboxadd", NAME="vboxadd", OWNER="root", MODE="0660"' \
118 >> "${D}/etc/udev/rules.d/60-virtualbox-guest-additions.rules"
119 }
120
121 pkg_postinst() {
122 linux-mod_pkg_postinst
123 if ! useq X ; then
124 elog "use flag X is off, enable it to install the"
125 elog "X Window System input and video drivers"
126 fi
127 elog "Please add:"
128 elog "/etc/init.d/${PN}"
129 elog "to the default runlevel in order to load all"
130 elog "needed modules and services."
131 elog ""
132 elog "Warning:"
133 elog "this ebuild is only needed if you are running gentoo"
134 elog "inside a VirtualBox Virtual Machine, you don't need"
135 elog "it to run VirtualBox itself."
136 elog ""
137 }

  ViewVC Help
Powered by ViewVC 1.1.20