2014-10-17 21:35:43 +04:00
|
|
|
# Copyright 1999-2014 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2014-10-26 18:15:24 +03:00
|
|
|
# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/vmware-modules-279.2.ebuild,v 1.5 2014/06/09 15:24:07 dilfridge Exp $
|
2014-10-17 21:35:43 +04:00
|
|
|
|
|
|
|
EAPI=5
|
|
|
|
|
|
|
|
inherit eutils flag-o-matic linux-info linux-mod user versionator udev
|
|
|
|
|
|
|
|
PV_MAJOR=$(get_major_version)
|
|
|
|
PV_MINOR=$(get_version_component_range 2)
|
|
|
|
|
|
|
|
DESCRIPTION="VMware kernel modules"
|
|
|
|
HOMEPAGE="http://www.vmware.com/"
|
|
|
|
|
|
|
|
SRC_URI=""
|
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
2015-04-25 17:29:15 +03:00
|
|
|
KEYWORDS="~amd64"
|
2014-10-17 21:35:43 +04:00
|
|
|
IUSE="pax_kernel +vmci +vsock"
|
|
|
|
|
|
|
|
RDEPEND=""
|
|
|
|
DEPEND="${RDEPEND}
|
2015-04-25 17:29:15 +03:00
|
|
|
|| ( =app-emulation/vmware-player-7.1.0.2496824
|
|
|
|
=app-emulation/vmware-workstation-11.1.0.2496824 )"
|
2014-10-17 21:35:43 +04:00
|
|
|
|
|
|
|
S=${WORKDIR}
|
|
|
|
|
2015-04-25 17:29:15 +03:00
|
|
|
MAKEOPTS="${MAKEOPTS} -j1"
|
|
|
|
|
2014-10-17 21:35:43 +04:00
|
|
|
pkg_setup() {
|
|
|
|
CONFIG_CHECK="~HIGH_RES_TIMERS"
|
|
|
|
if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then
|
|
|
|
CONFIG_CHECK="${CONFIG_CHECK} BKL"
|
|
|
|
fi
|
|
|
|
if use vmci ; then
|
|
|
|
CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI"
|
|
|
|
else
|
|
|
|
CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI"
|
|
|
|
fi
|
|
|
|
if use vsock ; then
|
|
|
|
CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS"
|
|
|
|
else
|
|
|
|
CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
linux-info_pkg_setup
|
|
|
|
|
|
|
|
linux-mod_pkg_setup
|
|
|
|
|
|
|
|
VMWARE_GROUP=${VMWARE_GROUP:-vmware}
|
|
|
|
|
|
|
|
VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock"
|
|
|
|
VMWARE_MODULE_LIST="vmblock vmmon vmnet"
|
|
|
|
use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci"
|
|
|
|
use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock"
|
|
|
|
|
|
|
|
VMWARE_MOD_DIR="${PN}-${PVR}"
|
|
|
|
|
|
|
|
BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
|
|
|
|
|
|
|
|
enewgroup "${VMWARE_GROUP}"
|
|
|
|
filter-flags -mfpmath=sse
|
2015-04-25 17:29:15 +03:00
|
|
|
filter-flags -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mf16c -mpclmul
|
2014-10-17 21:35:43 +04:00
|
|
|
|
|
|
|
for mod in ${VMWARE_MODULE_LIST}; do
|
|
|
|
MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
src_unpack() {
|
|
|
|
cd "${S}"
|
|
|
|
for mod in ${VMWARE_MODULE_LIST_ALL}; do
|
|
|
|
tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch"
|
|
|
|
epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch"
|
|
|
|
epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch"
|
2015-04-25 17:29:15 +03:00
|
|
|
use pax_kernel && epatch "${FILESDIR}/hardened.patch"
|
2014-10-17 21:35:43 +04:00
|
|
|
epatch "${FILESDIR}/${PV_MAJOR}-apic.patch"
|
|
|
|
kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch"
|
|
|
|
kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-vmblock.patch"
|
|
|
|
kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-filldir.patch"
|
2015-04-25 17:29:15 +03:00
|
|
|
kernel_is ge 3 12 0 && epatch "${FILESDIR}/${PV_MAJOR}-vfsfollowlink.patch"
|
|
|
|
kernel_is ge 3 14 0 && epatch "${FILESDIR}/${PV_MAJOR}-vmblock-3.14.patch"
|
|
|
|
kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-kernel-3.15.patch"
|
|
|
|
kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-kernel-3.19.patch"
|
2014-10-17 21:35:43 +04:00
|
|
|
|
|
|
|
epatch_user
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
linux-mod_src_install
|
|
|
|
local udevrules="${T}/60-vmware.rules"
|
|
|
|
cat > "${udevrules}" <<-EOF
|
2015-04-25 17:29:15 +03:00
|
|
|
KERNEL=="vmci", GROUP="vmware", MODE="660"
|
|
|
|
KERNEL=="vmw_vmci", GROUP="vmware", MODE="660"
|
|
|
|
KERNEL=="vmmon", GROUP="vmware", MODE="660"
|
|
|
|
KERNEL=="vsock", GROUP="vmware", MODE="660"
|
2014-10-17 21:35:43 +04:00
|
|
|
EOF
|
|
|
|
udev_dorules "${udevrules}"
|
|
|
|
}
|