1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI="8"
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit flag-o-matic linux-mod
|
|
6 |
inherit linux-mod-r1
|
7 |
7 |
|
8 |
8 |
DESCRIPTION="IBM ThinkPad SMAPI BIOS driver"
|
9 |
9 |
HOMEPAGE="https://github.com/evgeni/tp_smapi"
|
... | ... | |
11 |
11 |
|
12 |
12 |
LICENSE="GPL-2"
|
13 |
13 |
SLOT="0"
|
14 |
|
KEYWORDS="amd64 x86"
|
|
14 |
KEYWORDS="~amd64 ~x86"
|
15 |
15 |
|
16 |
16 |
IUSE="hdaps"
|
17 |
17 |
|
18 |
|
# We need dmideode if the kernel does not support
|
19 |
|
# DMI_DEV_TYPE_OEM_STRING in dmi.h.
|
20 |
|
DEPEND="sys-apps/dmidecode"
|
21 |
|
RDEPEND="${DEPEND}"
|
22 |
|
|
23 |
|
# This code is factored out of both pkg_pretend() and pkg_setup()
|
24 |
|
# because the PMS states that ebuilds may not call phase functions
|
25 |
|
# directly (see the "List of functions" section). This was bug #596616
|
26 |
|
# and #596622.
|
27 |
|
tp_smapi_pkg_pretend() {
|
28 |
|
linux-mod_pkg_setup
|
29 |
|
|
30 |
|
MODULE_NAMES="thinkpad_ec(extra:) tp_smapi(extra:)"
|
31 |
|
BUILD_PARAMS="KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR}"
|
32 |
|
BUILD_TARGETS="default"
|
|
18 |
PATCHES=( "${FILESDIR}/${P}-linux-6.4.patch" )
|
33 |
19 |
|
|
20 |
pkg_setup() {
|
34 |
21 |
if use hdaps; then
|
35 |
|
CONFIG_CHECK="~INPUT_UINPUT"
|
36 |
|
WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
|
37 |
|
# Why call this twice?
|
38 |
|
linux-info_pkg_setup
|
39 |
|
|
40 |
|
MODULE_NAMES="${MODULE_NAMES} hdaps(extra:)"
|
41 |
|
BUILD_PARAMS="${BUILD_PARAMS} HDAPS=1"
|
42 |
|
|
43 |
|
CONFIG_CHECK="~!SENSORS_HDAPS"
|
44 |
|
ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
|
45 |
|
linux-info_pkg_setup
|
|
22 |
local CONFIG_CHECK="~INPUT_UINPUT"
|
|
23 |
local WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
|
|
24 |
local CONFIG_CHECK="~!SENSORS_HDAPS"
|
|
25 |
local ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
|
46 |
26 |
fi
|
47 |
|
}
|
48 |
27 |
|
49 |
|
pkg_pretend() {
|
50 |
|
tp_smapi_pkg_pretend
|
51 |
|
}
|
52 |
|
|
53 |
|
pkg_setup() {
|
54 |
|
# run again as pkg_pretend is not var safe
|
55 |
|
tp_smapi_pkg_pretend
|
|
28 |
linux-mod-r1_pkg_setup
|
56 |
29 |
}
|
57 |
30 |
|
58 |
31 |
src_compile() {
|
59 |
|
# Kernel Makefiles may pull in -mpreferred-stack-boundary=3
|
60 |
|
# which requires that SSE disabled or compilation will fail.
|
61 |
|
# So we need to ensure that appended user CLAGS do not re-enable SSE
|
62 |
|
# https://bugs.gentoo.org/show_bug.cgi?id=492964
|
63 |
|
replace-flags '-msse*' ''
|
64 |
|
replace-flags '-mssse3' ''
|
|
32 |
local modlist=( thinkpad_ec tp_smapi )
|
|
33 |
local modargs=( KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR} )
|
65 |
34 |
|
66 |
|
linux-mod_src_compile
|
|
35 |
if use hdaps; then
|
|
36 |
modlist+=( hdaps )
|
|
37 |
modargs+=( HDAPS=1 )
|
|
38 |
fi
|
|
39 |
|
|
40 |
linux-mod-r1_src_compile
|
67 |
41 |
}
|
68 |
42 |
|
69 |
43 |
src_install() {
|
70 |
|
linux-mod_src_install
|
71 |
|
einstalldocs
|
|
44 |
linux-mod-r1_src_install
|
|
45 |
|
72 |
46 |
newinitd "${FILESDIR}/${PN}-0.40-initd" smapi
|
73 |
47 |
newconfd "${FILESDIR}/${PN}-0.40-confd" smapi
|
74 |
48 |
}
|