virtualbox-modules-5.0.36.ebuild 1.6 KB

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