/[gentoo-x86]/app-emulation/virtualbox/virtualbox-4.1.12.ebuild
Gentoo

Contents of /app-emulation/virtualbox/virtualbox-4.1.12.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Sep 18 05:36:39 2012 UTC (23 months, 4 weeks ago) by polynomial-c
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
Removed old versions

(Portage version: 2.2.0_alpha128/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox/virtualbox-4.1.12.ebuild,v 1.8 2012/09/05 09:16:52 jlec Exp $
4
5 EAPI=4
6
7 inherit eutils fdo-mime flag-o-matic linux-info multilib pax-utils python qt4-r2 toolchain-funcs java-pkg-opt-2
8
9 if [[ ${PV} == "9999" ]] ; then
10 # XXX: should finish merging the -9999 ebuild into this one ...
11 ESVN_REPO_URI="http://www.virtualbox.org/svn/vbox/trunk"
12 inherit linux-mod subversion
13 else
14 MY_P=VirtualBox-${PV}
15 SRC_URI="http://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2"
16 S="${WORKDIR}/${MY_P}"
17 fi
18
19 DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
20 HOMEPAGE="http://www.virtualbox.org/"
21
22 LICENSE="GPL-2"
23 SLOT="0"
24 KEYWORDS="amd64 x86"
25 IUSE="+additions alsa doc extensions headless java pam pulseaudio +opengl python +qt4 +sdk vboxwebsrv vnc"
26
27 RDEPEND="!app-emulation/virtualbox-bin
28 ~app-emulation/virtualbox-modules-${PV}
29 dev-libs/libIDL
30 >=dev-libs/libxslt-1.1.19
31 net-misc/curl
32 dev-libs/openssl
33 dev-libs/libxml2
34 sys-libs/zlib
35 !headless? (
36 qt4? (
37 x11-libs/qt-gui:4
38 x11-libs/qt-core:4
39 opengl? ( x11-libs/qt-opengl:4 )
40 x11-libs/libXinerama
41 )
42 opengl? ( virtual/opengl media-libs/freeglut )
43 x11-libs/libX11
44 x11-libs/libXcursor
45 x11-libs/libXext
46 x11-libs/libXmu
47 x11-libs/libXt
48 media-libs/libsdl[X,video]
49 )
50 vnc? ( <net-libs/libvncserver-0.9.9 )
51 java? ( virtual/jre:1.6 )"
52 DEPEND="${RDEPEND}
53 >=dev-util/kbuild-0.1.999
54 >=dev-lang/yasm-0.6.2
55 sys-devel/bin86
56 sys-devel/dev86
57 sys-power/iasl
58 media-libs/libpng
59 pam? ( sys-libs/pam )
60 sys-libs/libcap
61 doc? (
62 dev-texlive/texlive-basic
63 dev-texlive/texlive-latex
64 dev-texlive/texlive-latexrecommended
65 dev-texlive/texlive-latexextra
66 dev-texlive/texlive-fontsrecommended
67 dev-texlive/texlive-fontsextra
68 )
69 java? ( virtual/jdk:1.6 )
70 virtual/pkgconfig
71 alsa? ( >=media-libs/alsa-lib-1.0.13 )
72 !headless? ( x11-libs/libXinerama )
73 pulseaudio? ( media-sound/pulseaudio )
74 vboxwebsrv? ( >=net-libs/gsoap-2.7.13 )"
75 PDEPEND="additions? ( ~app-emulation/virtualbox-additions-${PV} )
76 extensions? ( ~app-emulation/virtualbox-extpack-oracle-${PV} )"
77
78 QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
79 usr/lib/virtualbox/VBoxSDL.so
80 usr/lib/virtualbox/VBoxSharedFolders.so
81 usr/lib/virtualbox/VBoxDD2.so
82 usr/lib/virtualbox/VBoxOGLrenderspu.so
83 usr/lib/virtualbox/VBoxPython.so
84 usr/lib/virtualbox/VBoxDD.so
85 usr/lib/virtualbox/VBoxDDU.so
86 usr/lib/virtualbox/VBoxREM64.so
87 usr/lib/virtualbox/VBoxSharedClipboard.so
88 usr/lib/virtualbox/VBoxHeadless.so
89 usr/lib/virtualbox/VBoxRT.so
90 usr/lib/virtualbox/VBoxREM.so
91 usr/lib/virtualbox/VBoxSettings.so
92 usr/lib/virtualbox/VBoxKeyboard.so
93 usr/lib/virtualbox/VBoxSharedCrOpenGL.so
94 usr/lib/virtualbox/VBoxVMM.so
95 usr/lib/virtualbox/VirtualBox.so
96 usr/lib/virtualbox/VBoxOGLhosterrorspu.so
97 usr/lib/virtualbox/components/VBoxC.so
98 usr/lib/virtualbox/components/VBoxSVCM.so
99 usr/lib/virtualbox/components/VBoxDDU.so
100 usr/lib/virtualbox/components/VBoxRT.so
101 usr/lib/virtualbox/components/VBoxREM.so
102 usr/lib/virtualbox/components/VBoxVMM.so
103 usr/lib/virtualbox/VBoxREM32.so
104 usr/lib/virtualbox/VBoxPython2_4.so
105 usr/lib/virtualbox/VBoxPython2_5.so
106 usr/lib/virtualbox/VBoxPython2_6.so
107 usr/lib/virtualbox/VBoxPython2_7.so
108 usr/lib/virtualbox/VBoxXPCOMC.so
109 usr/lib/virtualbox/VBoxOGLhostcrutil.so
110 usr/lib/virtualbox/VBoxNetDHCP.so"
111
112 REQUIRED_USE="
113 java? ( sdk )
114 python? ( sdk )
115 vboxwebsrv? ( java )
116 "
117
118 pkg_setup() {
119 if ! use headless && ! use qt4 ; then
120 einfo "No USE=\"qt4\" selected, this build will not include"
121 einfo "any Qt frontend."
122 elif use headless && use qt4 ; then
123 einfo "You selected USE=\"headless qt4\", defaulting to"
124 einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
125 fi
126
127 if ! use opengl ; then
128 einfo "No USE=\"opengl\" selected, this build will lack"
129 einfo "the OpenGL feature."
130 fi
131 java-pkg-opt-2_pkg_setup
132 python_set_active_version 2
133 python_pkg_setup
134 }
135
136 src_prepare() {
137 # Remove shipped binaries (kBuild,yasm), see bug #232775
138 rm -rf kBuild/bin tools
139
140 # Disable things unused or split into separate ebuilds
141 sed -e "s/MY_LIBDIR/$(get_libdir)/" \
142 "${FILESDIR}"/${PN}-4-localconfig > LocalConfig.kmk || die
143
144 # unset useless/problematic checks in configure
145 epatch "${FILESDIR}/${PN}-ose-3.2.8-mesa-check.patch" \
146 "${FILESDIR}/${PN}-4-makeself-check.patch" \
147 "${FILESDIR}/${PN}-4-mkisofs-check.patch"
148
149 # fix build with --as-needed (bug #249295 and bug #350907)
150 epatch "${FILESDIR}/${PN}-4.1.4-asneeded.patch"
151
152 # Respect LDFLAGS
153 sed -e "s/_LDFLAGS\.${ARCH}*.*=/& ${LDFLAGS}/g" \
154 -i Config.kmk src/libs/xpcom18a4/Config.kmk || die
155
156 # We still want to use ${HOME}/.VirtualBox/Machines as machines dir.
157 epatch "${FILESDIR}/${PN}-4.0.2-restore_old_machines_dir.patch"
158
159 # Don't build vboxpci.ko module (D'oh!)
160 epatch "${FILESDIR}"/${PN}-4.1.2-vboxpci-build.patch
161
162 # Use PAM only when pam USE flag is enbaled (bug #376531)
163 if ! use pam ; then
164 elog "Disabling PAM removes the possibility to use the VRDP features."
165 sed -i 's/^.*VBOX_WITH_PAM/#VBOX_WITH_PAM/' Config.kmk || die
166 sed -i 's;\(.*/auth/Makefile.kmk.*\);#\1;' \
167 src/VBox/HostServices/Makefile.kmk || die
168 fi
169
170 # add correct java path
171 if use java ; then
172 sed "s:/usr/lib/jvm/java-6-sun:$(java-config -O):" \
173 -i "${S}"/Config.kmk || die
174 java-pkg-opt-2_src_prepare
175 fi
176
177 # Fix compile error on hardened bug 339914 (disable PIE)
178 if gcc-specs-pie ; then
179 epatch "${FILESDIR}"/${PN}-4.1.8-nopie.patch
180 fi
181 }
182
183 src_configure() {
184 local myconf
185 use alsa || myconf+=" --disable-alsa"
186 use opengl || myconf+=" --disable-opengl"
187 use pulseaudio || myconf+=" --disable-pulse"
188 use python || myconf+=" --disable-python"
189 use java || myconf+=" --disable-java"
190 use vboxwebsrv && myconf+=" --enable-webservice"
191 use vnc && myconf+=" --enable-vnc"
192 use doc || myconf+=" --disable-docs"
193 if ! use headless ; then
194 use qt4 || myconf+=" --disable-qt4"
195 else
196 myconf+=" --build-headless --disable-opengl"
197 fi
198 # not an autoconf script
199 ./configure \
200 --with-gcc="$(tc-getCC)" \
201 --with-g++="$(tc-getCXX)" \
202 --disable-kmods \
203 --disable-dbus \
204 ${myconf} \
205 || die "configure failed"
206 }
207
208 src_compile() {
209 source ./env.sh
210
211 # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
212 # and strip all flags
213 # strip-flags
214
215 MAKE="kmk" emake \
216 VBOX_VERSION_STRING='$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)'_Gentoo_ \
217 TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
218 TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
219 TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
220 TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
221 VBOX_GCC_OPT="${CXXFLAGS}" \
222 TOOL_YASM_AS=yasm KBUILD_PATH="${S}/kBuild" \
223 all || die "kmk failed"
224 }
225
226 src_install() {
227 cd "${S}"/out/linux.${ARCH}/release/bin || die
228
229 # Create configuration files
230 insinto /etc/vbox
231 newins "${FILESDIR}/${PN}-4-config" vbox.cfg
232
233 # Set the right libdir
234 sed -i \
235 -e "s/MY_LIBDIR/$(get_libdir)/" \
236 "${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
237
238 # Symlink binaries to the shipped wrapper
239 exeinto /usr/$(get_libdir)/${PN}
240 newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox" || die
241 fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
242 fperms 0750 /usr/$(get_libdir)/${PN}/VBox
243
244 dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
245 dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
246 dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
247 dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
248
249 # Install binaries and libraries
250 insinto /usr/$(get_libdir)/${PN}
251 doins -r components || die
252
253 if use sdk ; then
254 doins -r sdk || die
255 fi
256
257 if use vboxwebsrv ; then
258 doins vboxwebsrv || die
259 fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
260 fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
261 dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
262 newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
263 newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
264 fi
265
266 for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,NetAdpCtl,NetDHCP,ExtPackHelperApp} *so *r0 *gc ; do
267 doins $each || die
268 fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
269 fperms 0750 /usr/$(get_libdir)/${PN}/${each}
270 done
271 # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
272 fperms 4750 /usr/$(get_libdir)/${PN}/VBoxNetAdpCtl
273 fperms 4750 /usr/$(get_libdir)/${PN}/VBoxNetDHCP
274
275 if ! use headless ; then
276 for each in VBox{SDL,Headless} ; do
277 doins $each || die
278 fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
279 fperms 4750 /usr/$(get_libdir)/${PN}/${each}
280 pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each}
281 done
282
283 if use opengl && use qt4 ; then
284 doins VBoxTestOGL || die
285 fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
286 fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
287 fi
288
289 dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
290
291 if use qt4 ; then
292 doins VirtualBox || die
293 fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
294 fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
295 pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox
296
297 dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
298
299 newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
300 fi
301
302 pushd "${S}"/src/VBox/Resources/OSE &>/dev/null || die
303 for size in 16 32 48 64 128 ; do
304 newicon -s ${size} ${PN}-${size}px.png ${PN}.png
305 done
306 newicon ${PN}-48px.png ${PN}.png
307 popd &>/dev/null || die
308 else
309 doins VBoxHeadless || die
310 fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
311 fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
312 pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless
313 fi
314
315 insinto /usr/$(get_libdir)/${PN}
316 # Install EFI Firmware files (bug #320757)
317 pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
318 for fwfile in VBoxEFI{32,64}.fd ; do
319 doins ${fwfile} || die
320 fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile} || die
321 done
322 popd &>/dev/null || die
323
324 # New way of handling USB device nodes for VBox (bug #356215)
325 insinto /lib/udev
326 doins VBoxCreateUSBNode.sh
327 fowners root:vboxusers /lib/udev/VBoxCreateUSBNode.sh
328 fperms 0750 /lib/udev/VBoxCreateUSBNode.sh
329 insinto /lib/udev/rules.d
330 doins "${FILESDIR}"/10-virtualbox.rules
331
332 insinto /usr/share/${PN}
333 if ! use headless && use qt4 ; then
334 doins -r nls
335 fi
336
337 # VRDPAuth only works with this (bug #351949)
338 dosym VBoxAuth.so /usr/$(get_libdir)/${PN}/VRDPAuth.so
339
340 # set an env-variable for 3rd party tools
341 echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
342 doenvd "${T}/90virtualbox"
343
344 if use java ; then
345 java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
346 java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
347 fi
348 }
349
350 pkg_postinst() {
351 fdo-mime_desktop_database_update
352
353 udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
354
355 if ! use headless && use qt4 ; then
356 elog "To launch VirtualBox just type: \"VirtualBox\"."
357 fi
358 elog "You must be in the vboxusers group to use VirtualBox."
359 elog ""
360 elog "The latest user manual is available for download at:"
361 elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
362 elog ""
363 elog "For advanced networking setups you should emerge:"
364 elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
365 elog ""
366 elog "IMPORTANT!"
367 elog "If you upgrade from app-emulation/virtualbox-ose make sure to run"
368 elog "\"env-update\" as root and logout and relogin as the user you wish"
369 elog "to run ${PN} as."
370 elog ""
371 elog "Starting with version 4.0.0, ${PN} has USB-1 support."
372 elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
373 elog " app-emulation/virtualbox-extpack-oracle"
374 elog "package."
375 if [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
376 elog ""
377 elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
378 elog "or else USB in ${PN} won't work."
379 fi
380 }
381
382 pkg_postrm() {
383 fdo-mime_desktop_database_update
384 }

  ViewVC Help
Powered by ViewVC 1.1.20