summaryrefslogtreecommitdiff
path: root/app-laptop/tp_smapi/tp_smapi-0.44.ebuild
blob: 828b76306fd01f1eff7f9dcfab73128170364e2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit linux-mod-r1

DESCRIPTION="IBM ThinkPad SMAPI BIOS driver"
HOMEPAGE="https://github.com/linux-thinkpad/tp_smapi"
SRC_URI="https://github.com/linux-thinkpad/tp_smapi/releases/download/tp-smapi/${PV}/${P}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE="hdaps"

pkg_setup() {
	if use hdaps; then
		local CONFIG_CHECK="~INPUT_UINPUT"
		local WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
		local CONFIG_CHECK="~!SENSORS_HDAPS"
		local ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
	fi

	linux-mod-r1_pkg_setup
}

src_compile() {
	local modlist=( thinkpad_ec tp_smapi )
	local modargs=( KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR} )

	if use hdaps; then
		modlist+=( hdaps )
		modargs+=( HDAPS=1 )
	fi

	linux-mod-r1_src_compile
}

src_install() {
	linux-mod-r1_src_install

	newinitd "${FILESDIR}/${PN}-0.40-initd" smapi
	newconfd "${FILESDIR}/${PN}-0.40-confd" smapi
}