projectmoon-overlay/sys-kernel/librem-ec-acpi/librem-ec-acpi-0.9.1-r1.ebuild

47 lines
1.1 KiB
Bash

# Copyright 2021 projectmoon
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-info linux-mod
DESCRIPTION="Librem EC ACPI Driver"
HOMEPAGE="https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms"
SRC_URI="https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms/-/archive/v${PV}/librem-ec-acpi-dkms-v${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="dist-kernel"
RDEPEND="dist-kernel? ( virtual/dist-kernel:= )"
DEPEND="${RDEPEND}"
S="${WORKDIR}/librem-ec-acpi-dkms-v${PV}/"
MODULE_NAMES="librem_ec_acpi(librem:${S}:${S})"
BUILD_TARGETS="clean all"
src_prepare() {
default
# Makefile hardcoded to point at running kernel
# but we want the user-chosen kernel.
linux-info_get_any_version
sed -i "s/\$(shell uname -r)/${KV_FULL}/" Makefile \
|| die "could not set kernel version in makefile"
}
pkg_setup() {
if ! use kernel_linux ; then
die "Unable to install"
fi
BUILD_PARAMS="KV=${KV_FULL} KSRC=${KERNEL_DIR} KERNELDIR=${KV_DIR}"
linux-mod_pkg_setup
}
src_install() {
linux-mod_src_install
einstalldocs
}