1 |
commit: 9670bfc86462af15a9d05b170b72ad68168b2580 |
2 |
Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 3 20:03:45 2016 +0000 |
4 |
Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 3 20:27:54 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9670bfc8 |
7 |
|
8 |
x11-drivers/xf86-video-virtualbox-5.0.20: build kernel module with help of upstream Makefiles. |
9 |
|
10 |
This commit builds on the prior work of Polynomial-C to compile vboxvideo.ko |
11 |
using the upstream Makefile.module.kms. A small patch is necessary to add a missing |
12 |
include path to the build, and the rest of the changes are the addition of necessary |
13 |
symlinks to allow the build to proceed. |
14 |
|
15 |
Package-Manager: portage-2.2.26 |
16 |
|
17 |
...deo-virtualbox-5.0.20-Makefile.module.kms.patch | 11 +++++ |
18 |
.../xf86-video-virtualbox-5.0.20.ebuild | 51 +++++++++++----------- |
19 |
2 files changed, 37 insertions(+), 25 deletions(-) |
20 |
|
21 |
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5.0.20-Makefile.module.kms.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5.0.20-Makefile.module.kms.patch |
22 |
new file mode 100644 |
23 |
index 0000000..dd05a4a |
24 |
--- /dev/null |
25 |
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5.0.20-Makefile.module.kms.patch |
26 |
@@ -0,0 +1,11 @@ |
27 |
+--- a/src/VBox/Additions/linux/drm/Makefile.module.kms 2016-04-28 09:08:06.000000000 -0400 |
28 |
++++ b/src/VBox/Additions/linux/drm/Makefile.module.kms 2016-05-03 15:11:22.134971872 -0400 |
29 |
+@@ -38,7 +38,7 @@ |
30 |
+ MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h |
31 |
+ endif |
32 |
+ MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING) |
33 |
+-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include) |
34 |
++MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux) |
35 |
+ # What on earth is this? |
36 |
+ MOD_INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxvideo,/ /include) |
37 |
+ MOD_INCL += -Iinclude/drm |
38 |
|
39 |
diff --git a/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.20.ebuild b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.20.ebuild |
40 |
index 24d85e9..5dbf6db 100644 |
41 |
--- a/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.20.ebuild |
42 |
+++ b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.20.ebuild |
43 |
@@ -73,14 +73,19 @@ pkg_setup() { |
44 |
} |
45 |
|
46 |
src_prepare() { |
47 |
- # Prepare the vboxvideo_drm Makefiles |
48 |
- #cp "${FILESDIR}/Makefile.inc" "${MODULES_SRC_DIR}" || die |
49 |
- ln -s Makefile.module.kms "${MODULES_SRC_DIR}/Makefile" || die |
50 |
- #sed '/^include.*header/ainclude $(obj)/Makefile.inc' \ |
51 |
- # -i "${MODULES_SRC_DIR}/Makefile.module.kms" || die |
52 |
- for incfile in Makefile.include.{head,foot}er ; do |
53 |
- ln -s "${S}/src/VBox/Installer/linux/${incfile}" \ |
54 |
- "${MODULES_SRC_DIR}/${incfile}" || die |
55 |
+ # Prepare the vboxvideo_drm Makefiles and build dir |
56 |
+ eapply "${FILESDIR}"/${P}-Makefile.module.kms.patch |
57 |
+ ln -sf Makefile.module.kms "${MODULES_SRC_DIR}"/Makefile || die |
58 |
+ # All of these are expected to be in $(KBUILD_EXTMOD)/ so symlink them into place |
59 |
+ local incfile incfiles=( |
60 |
+ include |
61 |
+ src/VBox/Runtime/r0drv |
62 |
+ src/VBox/Installer/linux/Makefile.include.{head,foot}er |
63 |
+ out/linux.${ARCH}/release/{product,version,revision}-generated.h |
64 |
+ ) |
65 |
+ for incfile in ${incfiles[@]} ; do |
66 |
+ ln -sf "${S}"/${incfile} \ |
67 |
+ "${MODULES_SRC_DIR}"/${incfile##*/} || die |
68 |
done |
69 |
|
70 |
# Remove shipped binaries (kBuild,yasm), see bug #232775 |
71 |
@@ -118,18 +123,14 @@ src_configure() { |
72 |
} |
73 |
|
74 |
src_compile() { |
75 |
- local targets=() |
76 |
- |
77 |
- targets=( |
78 |
+ local each targets=( |
79 |
Runtime |
80 |
Additions/common/VBoxGuestLib |
81 |
GuestHost/OpenGL |
82 |
Additions/x11/x11stubs |
83 |
Additions/common/crOpenGL |
84 |
Additions/x11/vboxvideo |
85 |
- #Additions/linux/drm |
86 |
) |
87 |
- |
88 |
for each in ${targets[@]} ; do |
89 |
pushd "${S}"/src/VBox/${each} $>/dev/null || die |
90 |
MAKE="kmk" \ |
91 |
@@ -142,18 +143,18 @@ src_compile() { |
92 |
|
93 |
if use dri ; then |
94 |
local objdir="out/linux.${ARCH}/release/obj/vboxvideo_drv_system/src/VBox" |
95 |
- ln -s "${S}"/${objdir}/Additions/common/VBoxVideo/HGSMIBase.o \ |
96 |
- ${MODULES_SRC_DIR} || die |
97 |
- ln -s "${S}"/${objdir}/GuestHost/HGSMI/HGSMICommon.o \ |
98 |
- ${MODULES_SRC_DIR} || die |
99 |
- ln -s "${S}"/${objdir}/GuestHost/HGSMI/HGSMIMemAlloc.o \ |
100 |
- ${MODULES_SRC_DIR} || die |
101 |
- ln -s "${S}"/${objdir}/Runtime/common/alloc/heapoffset.o \ |
102 |
- ${MODULES_SRC_DIR} || die |
103 |
- ln -s "${S}"/${objdir}/Additions/common/VBoxVideo/Modesetting.o \ |
104 |
- ${MODULES_SRC_DIR} || die |
105 |
- ln -s "${S}"/${objdir}/Additions/common/VBoxVideo/VBVABase.o \ |
106 |
- ${MODULES_SRC_DIR} || die |
107 |
+ # see the vboxvideo_drm_SOURCES list in Makefile.kmk for the below |
108 |
+ targets=( |
109 |
+ Additions/common/VBoxVideo/HGSMIBase.o |
110 |
+ Additions/common/VBoxVideo/Modesetting.o |
111 |
+ Additions/common/VBoxVideo/VBVABase.o |
112 |
+ GuestHost/HGSMI/HGSMICommon.o |
113 |
+ GuestHost/HGSMI/HGSMIMemAlloc.o |
114 |
+ Runtime/common/alloc/heapoffset.o |
115 |
+ ) |
116 |
+ for each in ${targets[@]} ; do |
117 |
+ ln -sf "${S}"/${objdir}/${each} "${MODULES_SRC_DIR}"/${each##*/} || die |
118 |
+ done |
119 |
|
120 |
# Now creating the kernel modules. We must do this _after_ |
121 |
# we compiled the user-space tools as we need two of the |