From 77f479b205c8ffcb9f422505fba0b8a04268cbff Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 25 Apr 2024 11:17:25 +0100 Subject: app-laptop/tp_smapi : import from Gentoo, convert to DKMS --- sys-kernel/tp_smapi-dkms/Manifest | 1 + sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf | 12 +++++ sys-kernel/tp_smapi-dkms/files/dkms.conf | 10 ++++ sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild | 55 ++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 sys-kernel/tp_smapi-dkms/Manifest create mode 100644 sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf create mode 100644 sys-kernel/tp_smapi-dkms/files/dkms.conf create mode 100644 sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild (limited to 'sys-kernel/tp_smapi-dkms') diff --git a/sys-kernel/tp_smapi-dkms/Manifest b/sys-kernel/tp_smapi-dkms/Manifest new file mode 100644 index 00000000..59422510 --- /dev/null +++ b/sys-kernel/tp_smapi-dkms/Manifest @@ -0,0 +1 @@ +DIST tp_smapi-0.44.tgz 40724 BLAKE2B 03b765bc5736f514cf2a315dcc6d14bbb7869b98da8c5e016be49bd47bc2d1ec4da7c0c5b5468356df6aa4083b2de4048a078b5498dc7aa0083e3fcfbb64aa41 SHA512 c6b6068941d43505d14dc155441287ba5576f0b1b09861e13853e5360f9b4483d709b823761d39c93bc0c860100d43cc485d2454d66a66ceaaf2d43b5b0c9dc9 diff --git a/sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf b/sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf new file mode 100644 index 00000000..9a74ec7a --- /dev/null +++ b/sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf @@ -0,0 +1,12 @@ +PACKAGE_NAME="tp_smapi-dkms" +PACKAGE_VERSION="0.44" +BUILD_EXCLUSIVE_KERNEL="^(5\.[0-9]+\.|6\.[0-8]\.)" # only build for kernels v5.x.x up to and including v6.8.x +MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build HDAPS=1" +CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean" +BUILT_MODULE_NAME[0]="thinkpad_ec" +BUILT_MODULE_NAME[1]="tp_smapi" +BUILT_MODULE_NAME[2]="hdaps" +DEST_MODULE_LOCATION[0]="/extra/dkms" +DEST_MODULE_LOCATION[1]="/extra/dkms" +DEST_MODULE_LOCATION[2]="/extra/dkms" +AUTOINSTALL="yes" diff --git a/sys-kernel/tp_smapi-dkms/files/dkms.conf b/sys-kernel/tp_smapi-dkms/files/dkms.conf new file mode 100644 index 00000000..9dbb68d1 --- /dev/null +++ b/sys-kernel/tp_smapi-dkms/files/dkms.conf @@ -0,0 +1,10 @@ +PACKAGE_NAME="tp_smapi-dkms" +PACKAGE_VERSION="0.44" +BUILD_EXCLUSIVE_KERNEL="^(5\.[0-9]+\.|6\.[0-8]\.)" # only build for kernels v5.x.x up to and including v6.8.x +MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build" +CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean" +BUILT_MODULE_NAME[0]="thinkpad_ec" +BUILT_MODULE_NAME[1]="tp_smapi" +DEST_MODULE_LOCATION[0]="/extra/dkms" +DEST_MODULE_LOCATION[1]="/extra/dkms" +AUTOINSTALL="yes" diff --git a/sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild b/sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild new file mode 100644 index 00000000..b97ec7e2 --- /dev/null +++ b/sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils + +MY_PN=tp_smapi +MY_P=${MY_PN}-${PV} +DESCRIPTION="IBM ThinkPad SMAPI BIOS driver sources" +HOMEPAGE="https://github.com/linux-thinkpad/tp_smapi" +SRC_URI="https://github.com/linux-thinkpad/tp_smapi/releases/download/tp-smapi/${PV}/${MY_P}.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" + +IUSE="hdaps" + +DEPEND="sys-kernel/dkms" +RDEPEND="${DEPEND}" + +S=${WORKDIR}/${MY_P} + +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 +} + +src_compile() { + : +} + +src_install() { + if use hdaps; then + cp "${FILESDIR}"/dkms-hdaps.conf "${S}"/dkms.conf || die + else + cp "${FILESDIR}"/dkms.conf "${S}" || die + fi + dodir /usr/src/${P} + insinto /usr/src/${P} + doins -r "${S}"/* +} + +pkg_postinst() { + dkms add ${PN}/${PV} +} + +pkg_prerm() { + dkms remove ${PN}/${PV} --all +} -- cgit v1.2.3