From dd6857add365d190d2a81d0f5d1f850587c42b66 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 18 Oct 2022 15:57:51 +0100 Subject: sys-kernel/virtualbox-modules-dkms : support building from DKMS --- .../files/Makefile-dkms.patch | 43 ++++++++++++++++++++++ .../virtualbox-modules-dkms-6.1.40.ebuild | 2 + 2 files changed, 45 insertions(+) create mode 100644 sys-kernel/virtualbox-modules-dkms/files/Makefile-dkms.patch (limited to 'sys-kernel') diff --git a/sys-kernel/virtualbox-modules-dkms/files/Makefile-dkms.patch b/sys-kernel/virtualbox-modules-dkms/files/Makefile-dkms.patch new file mode 100644 index 00000000..4c801b01 --- /dev/null +++ b/sys-kernel/virtualbox-modules-dkms/files/Makefile-dkms.patch @@ -0,0 +1,43 @@ +diff -Nur a/Makefile b/Makefile +--- a/Makefile 2022-10-11 16:40:10.000000000 +0100 ++++ b/Makefile 2022-10-18 15:54:45.877811069 +0100 +@@ -23,25 +23,25 @@ + # terms and conditions of either the GPL or the CDDL or both. + # + +-ifneq ($(KERNELRELEASE),) ++ifneq ($(KBUILD_EXTMOD),) + +-# Building from kBuild (make -C M=`pwd`), +-# or inside a kernel source tree. ++# Building from kBuild (make -C M=`pwd`). ++# KBUILD_EXTMOD is set to $(M) in this case. + + obj-m = vboxdrv/ +-ifneq ($(wildcard $(CURDIR)/vboxnetflt/Makefile),) ++ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),) + obj-m += vboxnetflt/ + endif +-ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),) ++ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),) + obj-m += vboxnetadp/ + endif +-ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),) ++ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci/Makefile),) + obj-m += vboxpci/ + endif + +-else # ! KERNELRELEASE ++else # ! KBUILD_EXTMOD + +-# convenience Makefile without KERNELRELEASE ++# convenience Makefile without KBUILD_EXTMOD + + KBUILD_VERBOSE ?= + KERN_VER ?= $(shell uname -r) +@@ -167,4 +167,4 @@ + fi; \ + done + +-endif # ! KERNELRELEASE ++endif # ! KBUILD_EXTMOD diff --git a/sys-kernel/virtualbox-modules-dkms/virtualbox-modules-dkms-6.1.40.ebuild b/sys-kernel/virtualbox-modules-dkms/virtualbox-modules-dkms-6.1.40.ebuild index bb68e200..c5262889 100644 --- a/sys-kernel/virtualbox-modules-dkms/virtualbox-modules-dkms-6.1.40.ebuild +++ b/sys-kernel/virtualbox-modules-dkms/virtualbox-modules-dkms-6.1.40.ebuild @@ -23,6 +23,8 @@ DEPEND=" " RDEPEND="${DEPEND}" +PATCHES=( ${FILESDIR}/Makefile-dkms.patch ) + S=${WORKDIR} src_prepare() { -- cgit v1.2.3