app-emulation/docker-runc: Remove old
[gentoo.git] / app-emulation / virtualbox-modules / virtualbox-modules-5.1.30.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # XXX: the tarball here is just the kernel modules split out of the binary
5 #      package that comes from virtualbox-bin
6
7 EAPI=6
8
9 inherit eutils linux-mod user
10
11 MY_P=vbox-kernel-module-src-${PV}
12 DESCRIPTION="Kernel Modules for Virtualbox"
13 HOMEPAGE="http://www.virtualbox.org/"
14 SRC_URI="https://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="amd64 x86"
19 IUSE="pax_kernel"
20
21 RDEPEND="!=app-emulation/virtualbox-9999"
22
23 S=${WORKDIR}
24
25 BUILD_TARGETS="all"
26 BUILD_TARGET_ARCH="${ARCH}"
27 MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})"
28
29 pkg_setup() {
30         enewgroup vboxusers
31
32         CONFIG_CHECK="!TRIM_UNUSED_KSYMS"
33         ERROR_TRIM_UNUSED_KSYMS="The kernel option CONFIG_TRIM_UNUSED_KSYMS removed kernel symbols that are needed by ${PN} to load correctly."
34
35         linux-mod_pkg_setup
36
37         BUILD_PARAMS="KERN_DIR=${KV_DIR} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
38 }
39
40 src_prepare() {
41         if kernel_is -ge 2 6 33 ; then
42                 # evil patch for new kernels - header moved
43                 grep -lR linux/autoconf.h *  | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
44         fi
45
46         if use pax_kernel && kernel_is -ge 3 0 0 ; then
47                 epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch
48         fi
49
50         if kernel_is -ge 4 14 0 ; then
51                 epatch "${FILESDIR}"/${PN}-5.1.30-udp.patch
52         fi
53
54         default
55 }
56
57 src_install() {
58         linux-mod_src_install
59         insinto /usr/lib/modules-load.d/
60         doins "${FILESDIR}"/virtualbox.conf
61 }
62
63 pkg_postinst() {
64         linux-mod_pkg_postinst
65         elog "If you are using sys-apps/openrc, please add \"vboxdrv\", \"vboxnetflt\","
66         elog "\"vboxnetadp\" and \"vboxpci\" to:"
67         elog "  /etc/conf.d/modules"
68 }