commit:     fcda13a18ba7d522b8829558db20770a328b0550
Author:     Nick Sarnie <sarnex <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 23:42:31 2022 +0000
Commit:     Nick Sarnie <sarnex <AT> gentoo <DOT> org>
CommitDate: Fri Dec 23 23:44:40 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcda13a1

app-emulation/vendor-reset: Improve ebuild

Closes: https://bugs.gentoo.org/884527
Closes: https://bugs.gentoo.org/884529

Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>

 .../vendor-reset/files/Respect-eselect-kernel.patch   | 13 -------------
 .../vendor-reset-0.1.1_pre20221205.ebuild             | 19 +++++--------------
 app-emulation/vendor-reset/vendor-reset-9999.ebuild   | 19 +++++--------------
 3 files changed, 10 insertions(+), 41 deletions(-)

diff --git a/app-emulation/vendor-reset/files/Respect-eselect-kernel.patch 
b/app-emulation/vendor-reset/files/Respect-eselect-kernel.patch
deleted file mode 100644
index 9259a3e12bf2..000000000000
--- a/app-emulation/vendor-reset/files/Respect-eselect-kernel.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/Makefile b/Makefile
-index b8a0652..79f60e8 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,6 +1,6 @@
- USER  := $(shell whoami)
--KVER ?= $(shell uname -r)
--KDIR ?= /lib/modules/$(KVER)/build
-+KVER ?= $(KV_FULL)
-+KDIR ?= ${KERNEL_DIR}
- 
- all: build
- 

diff --git a/app-emulation/vendor-reset/vendor-reset-0.1.1_pre20221205.ebuild 
b/app-emulation/vendor-reset/vendor-reset-0.1.1_pre20221205.ebuild
index ceaaa99a4a5f..68ee284aa9d7 100644
--- a/app-emulation/vendor-reset/vendor-reset-0.1.1_pre20221205.ebuild
+++ b/app-emulation/vendor-reset/vendor-reset-0.1.1_pre20221205.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit linux-mod
+inherit linux-mod toolchain-funcs
 
 if [[ ${PV} == *9999* ]]; then
        EGIT_REPO_URI="https://github.com/gnif/vendor-reset.git";
@@ -24,26 +24,17 @@ DEPEND=""
 RDEPEND="${DEPEND}"
 S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
 
-PATCHES=( "${FILESDIR}/Respect-eselect-kernel.patch" )
+MODULE_NAMES="vendor-reset(extra)"
 
 pkg_setup() {
        local CONFIG_CHECK="FTRACE KPROBES PCI_QUIRKS KALLSYMS FUNCTION_TRACER"
        linux-mod_pkg_setup
-       export KV_FULL=${KV_FULL}
-       export KERNEL_DIR=${KERNEL_DIR}
-}
-
-src_compile() {
-       set_arch_to_kernel
-       default
+       BUILD_TARGETS="build"
+       BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KDIR=${KERNEL_DIR}"
 }
 
 src_install() {
-       set_arch_to_kernel
-       emake \
-               DESTDIR="${ED}" \
-               INSTALL_MOD_PATH="${ED}" \
-               install
+       linux-mod_src_install
 
        insinto /etc/modules-load.d/
        newins "${FILESDIR}"/modload.conf vendor-reset.conf

diff --git a/app-emulation/vendor-reset/vendor-reset-9999.ebuild 
b/app-emulation/vendor-reset/vendor-reset-9999.ebuild
index a0b2326fc95a..b82d5b15ad5c 100644
--- a/app-emulation/vendor-reset/vendor-reset-9999.ebuild
+++ b/app-emulation/vendor-reset/vendor-reset-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit linux-mod
+inherit linux-mod toolchain-funcs
 
 if [[ ${PV} == *9999* ]]; then
        EGIT_REPO_URI="https://github.com/gnif/vendor-reset.git";
@@ -23,26 +23,17 @@ SLOT="0"
 DEPEND=""
 RDEPEND="${DEPEND}"
 
-PATCHES=( "${FILESDIR}/Respect-eselect-kernel.patch" )
+MODULE_NAMES="vendor-reset(extra)"
 
 pkg_setup() {
        local CONFIG_CHECK="FTRACE KPROBES PCI_QUIRKS KALLSYMS FUNCTION_TRACER"
        linux-mod_pkg_setup
-       export KV_FULL=${KV_FULL}
-       export KERNEL_DIR=${KERNEL_DIR}
-}
-
-src_compile() {
-       set_arch_to_kernel
-       default
+       BUILD_TARGETS="build"
+       BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KDIR=${KERNEL_DIR}"
 }
 
 src_install() {
-       set_arch_to_kernel
-       emake \
-               DESTDIR="${ED}" \
-               INSTALL_MOD_PATH="${ED}" \
-               install
+       linux-mod_src_install
 
        insinto /etc/modules-load.d/
        newins "${FILESDIR}"/modload.conf vendor-reset.conf

Reply via email to