# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit linux-mod-r1 DESCRIPTION="Embedded Controller for MSI laptops" HOMEPAGE="https://github.com/BeardOverflow/msi-ec" if [[ "${PV}" == *9999 ]] ; then inherit git-r3 EGIT_REPO_URI="https://github.com/BeardOverflow/${PN}.git" else SRC_URI="" KEYWORDS="~amd64" fi LICENSE="GPL-2+" SLOT="0" IUSE="" pkg_setup() { CONFIG_CHECK="ACPI ACPI_BATTERY" if kernel_is -ge 6 4 ; then CONFIG_CHECK+=" !MSI_EC" fi check_extra_config linux-mod-r1_pkg_setup } src_prepare() { default if kernel_is -lt 6 2 ; then eapply "${S}"/older-kernel.patch fi # Use /usr/src/linux for the kernel target #sed -i \ # -e 's@/lib/modules/$(shell uname -r)/build@/usr/src/linux@' \ # Makefile || die } src_compile() { local modlist=( ${PN} ) TARGET="$(grep -o '[[:digit:]\.]\+' <<< $(basename $(readlink -f /usr/src/linux)))" if [[ "$(tr '.' ' ' <<< ${TARGET} | wc -w)" -eq 2 ]] ; then TARGET="${TARGET}.0" fi [[ -d /lib/modules/${TARGET}/build ]] && export TARGET linux-mod-r1_src_compile }