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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Nov 10 21:10:47 2012 UTC (23 months, 1 week ago) by polynomial-c
Branch: MAIN
Changes since 1.1: +5 -5 lines
Version bump. Removed old.

(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)

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

  ViewVC Help
Powered by ViewVC 1.1.20