/[gentoo-x86]/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.1.22.ebuild
Gentoo

Contents of /x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.1.22.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Sep 17 20:08:51 2012 UTC (21 months, 3 weeks ago) by nativemad
Branch: MAIN
Changes since 1.2: +2 -2 lines
x86 stable, see bug 434872

(Portage version: 2.1.11.9/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.1.22.ebuild,v 1.2 2012/09/16 23:37:05 ago Exp $
4
5 EAPI=2
6
7 inherit eutils linux-mod multilib python versionator toolchain-funcs
8
9 MY_P=VirtualBox-${PV}
10 DESCRIPTION="VirtualBox video driver"
11 HOMEPAGE="http://www.virtualbox.org/"
12 SRC_URI="http://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="amd64 x86"
17 IUSE="dri"
18
19 RDEPEND="<x11-base/xorg-server-1.12.99[-minimal]
20 x11-libs/libXcomposite"
21 DEPEND="${RDEPEND}
22 >=dev-util/kbuild-0.1.999
23 =dev-lang/python-2*
24 >=dev-lang/yasm-0.6.2
25 sys-devel/dev86
26 sys-power/iasl
27 x11-proto/fontsproto
28 x11-proto/randrproto
29 x11-proto/renderproto
30 x11-proto/xextproto
31 x11-proto/xineramaproto
32 x11-proto/xproto
33 x11-libs/libXdmcp
34 x11-libs/libXau
35 x11-libs/libX11
36 x11-libs/libXfixes
37 x11-libs/libXext
38 dri? ( x11-proto/xf86driproto
39 >=x11-libs/libdrm-2.4.5 )"
40
41 BUILD_TARGETS="all"
42 BUILD_TARGET_ARCH="${ARCH}"
43 MODULE_NAMES="vboxvideo(misc:${WORKDIR}/vboxvideo_drm:${WORKDIR}/vboxvideo_drm)"
44
45 S="${WORKDIR}/${MY_P}"
46
47 QA_TEXTRELS_x86="usr/lib/VBoxOGL.so"
48
49 pkg_setup() {
50 linux-mod_pkg_setup
51 BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}"
52
53 python_set_active_version 2
54 python_pkg_setup
55 }
56
57 src_prepare() {
58 # Prepare the vboxvideo_drm sources and Makefile in ${WORKDIR}
59 cp -a "${S}"/src/VBox/Additions/linux/drm "${WORKDIR}/vboxvideo_drm" \
60 || die "cannot copy vboxvideo_drm directory"
61 cp "${FILESDIR}/${PN}-3-vboxvideo_drm.makefile" \
62 "${WORKDIR}/vboxvideo_drm/Makefile" \
63 || die "cannot copy vboxvideo_drm Makefile"
64
65 # stupid new header references...
66 for vboxheader in {product,version}-generated.h ; do
67 ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
68 "${WORKDIR}/vboxvideo_drm/${vboxheader}"
69 done
70
71 # Remove shipped binaries (kBuild,yasm), see bug #232775
72 rm -rf kBuild/bin tools
73
74 # Disable things unused or splitted into separate ebuilds
75 cp "${FILESDIR}/${PN}-3-localconfig" LocalConfig.kmk
76
77 # Ugly hack to build the opengl part of the video driver
78 epatch "${FILESDIR}/${PN}-2.2.0-enable-opengl.patch"
79
80 # unset useless/problematic checks in configure
81 epatch "${FILESDIR}/${PN}-3.2.8-mesa-check.patch" \
82 "${FILESDIR}/${PN}-4-makeself-check.patch" \
83 "${FILESDIR}/${PN}-4-mkisofs-check.patch"
84
85 # Patch to link with lazy on hardened #394757
86 if gcc-specs-now ; then
87 epatch "${FILESDIR}/${PN}-link-lazy.patch"
88 fi
89 }
90
91 src_configure() {
92 # build the user-space tools, warnings are harmless
93 ./configure \
94 --nofatal \
95 --disable-xpcom \
96 --disable-sdl-ttf \
97 --disable-pulse \
98 --disable-alsa \
99 --build-headless || die "configure failed"
100 source ./env.sh
101 }
102
103 src_compile() {
104 for each in /src/VBox/{Runtime,Additions/common/VBoxGuestLib} \
105 /src/VBox/{GuestHost/OpenGL,Additions/x11/x11stubs,Additions/common/crOpenGL} \
106 /src/VBox/Additions/x11/vboxvideo ; do
107 cd "${S}"${each}
108 MAKE="kmk" emake TOOL_YASM_AS=yasm \
109 KBUILD_PATH="${S}/kBuild" \
110 || die "kmk failed"
111 done
112
113 if use dri; then
114 # Now creating the kernel modules. We must do this _after_
115 # we compiled the user-space tools as we need two of the
116 # automatically generated header files. (>=3.2.0)
117 linux-mod_src_compile
118 fi
119 }
120
121 src_install() {
122 if use dri; then
123 linux-mod_src_install
124 fi
125
126 cd "${S}/out/linux.${ARCH}/release/bin/additions"
127 insinto /usr/$(get_libdir)/xorg/modules/drivers
128
129 # xorg-server-1.12.x
130 if has_version ">=x11-base/xorg-server-1.12" ; then
131 newins vboxvideo_drv_112.so vboxvideo_drv.so
132 # xorg-server-1.11.x
133 elif has_version ">=x11-base/xorg-server-1.11" ; then
134 newins vboxvideo_drv_111.so vboxvideo_drv.so
135 # xorg-server-1.10.x
136 elif has_version ">=x11-base/xorg-server-1.10" ; then
137 newins vboxvideo_drv_110.so vboxvideo_drv.so
138 # xorg-server-1.9.x
139 else
140 newins vboxvideo_drv_19.so vboxvideo_drv.so
141 fi
142
143 # Guest OpenGL driver
144 insinto /usr/$(get_libdir)
145 doins -r VBoxOGL* || die
146
147 if use dri ; then
148 dosym /usr/$(get_libdir)/VBoxOGL.so /usr/$(get_libdir)/dri/vboxvideo_dri.so
149 fi
150 }
151
152 pkg_postinst() {
153 elog "You need to edit the file /etc/X11/xorg.conf and set:"
154 elog ""
155 elog " Driver \"vboxvideo\""
156 elog ""
157 elog "in the Graphics device section (Section \"Device\")"
158 elog ""
159 if use dri; then
160 elog "To use the kernel drm video driver, please add:"
161 elog "\"vboxvideo\" to:"
162 if has_version sys-apps/openrc ; then
163 elog "/etc/conf.d/modules"
164 else
165 elog "/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
166 fi
167 elog ""
168 fi
169 }

  ViewVC Help
Powered by ViewVC 1.1.20