app-emulation/open-vm-tools: optionally build kernel modules
authorMike Gilbert <floppym@gentoo.org>
Fri, 25 Nov 2016 23:25:50 +0000 (18:25 -0500)
committerMike Gilbert <floppym@gentoo.org>
Fri, 25 Nov 2016 23:29:13 +0000 (18:29 -0500)
The build system does some crazy stuff that is difficult to replicate in
open-vm-tools-kmod.

Package-Manager: portage-2.3.2_p8

app-emulation/open-vm-tools/open-vm-tools-10.1.0.ebuild

index 2c653a5658577992360cbb0fe2b225f8151e38ad..11dd15e4ff89026c6d87b20e7fbf4faa76c5d6df 100644 (file)
@@ -3,8 +3,9 @@
 # $Id$
 
 EAPI=6
+MODULES_OPTIONAL_USE="modules"
 
-inherit autotools flag-o-matic pam systemd toolchain-funcs user
+inherit autotools linux-mod pam systemd toolchain-funcs user
 
 DESCRIPTION="Opensourced tools for VMware guests"
 HOMEPAGE="https://github.com/vmware/open-vm-tools"
@@ -71,7 +72,6 @@ src_configure() {
                --disable-tests
                --with-procps
                --with-dnet
-               --without-kernel-modules
                $(use_enable doc docs)
                $(use_enable grabbitmqproxy)
                $(use_enable vgauth)
@@ -84,6 +84,10 @@ src_configure() {
                $(use_with X gtk3)
                $(use_with X gtkmm3)
                $(use_with X x)
+
+               $(use_with modules kernel-modules)
+               --without-root-privileges
+               --with-kernel-release="${KV_FULL}"
        )
 
        econf "${myeconfargs[@]}"
@@ -92,6 +96,11 @@ src_configure() {
        find . -name Makefile -exec sed -i -e 's/-Werror//g' '{}' +  || die "sed out Werror failed"
 }
 
+src_compile() {
+       use modules && set_arch_to_kernel
+       default
+}
+
 src_install() {
        default
        prune_libtool_files --modules
@@ -117,4 +126,5 @@ src_install() {
 
 pkg_postinst() {
        enewgroup vmware
+       linux-mod_pkg_postinst
 }