2019-02-27 12:02:52 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, kernel, writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, runtimeShell
|
2016-12-10 04:37:37 +01:00
|
|
|
}:
|
2012-03-31 15:40:34 +02:00
|
|
|
|
2017-01-30 11:18:56 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "tp_smapi-${version}-${kernel.version}";
|
2018-02-24 22:48:58 +01:00
|
|
|
version = "0.43";
|
2017-01-30 11:18:56 +01:00
|
|
|
|
2017-02-19 15:33:31 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evgeni";
|
|
|
|
repo = "tp_smapi";
|
2018-02-24 22:48:58 +01:00
|
|
|
rev = "tp-smapi/${version}";
|
|
|
|
sha256 = "1rjb0njckczc2mj05cagvj0lkyvmyk6bw7wkiinv81lw8m90g77g";
|
2017-02-19 15:33:31 +01:00
|
|
|
name = "tp-smapi-${version}";
|
2017-01-30 11:18:56 +01:00
|
|
|
};
|
2012-03-31 15:40:34 +02:00
|
|
|
|
2017-12-28 09:11:36 +01:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2016-02-26 18:38:15 +01:00
|
|
|
hardeningDisable = [ "pic" ];
|
2016-02-12 03:53:32 +01:00
|
|
|
|
2012-03-31 15:40:34 +02:00
|
|
|
makeFlags = [
|
2014-01-05 02:57:21 +01:00
|
|
|
"KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
|
2019-01-15 23:41:31 +01:00
|
|
|
"SHELL=${stdenv.shell}"
|
2017-09-04 09:41:57 +02:00
|
|
|
"HDAPS=1"
|
2012-03-31 15:40:34 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-05 02:57:21 +01:00
|
|
|
install -v -D -m 644 thinkpad_ec.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/thinkpad_ec.ko"
|
|
|
|
install -v -D -m 644 tp_smapi.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/tp_smapi.ko"
|
2017-09-05 09:24:30 +02:00
|
|
|
install -v -D -m 644 hdaps.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/hdapsd.ko"
|
2012-03-31 15:40:34 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-12-10 04:37:37 +01:00
|
|
|
passthru.updateScript = import ./update.nix {
|
2019-06-18 13:08:32 +02:00
|
|
|
inherit lib writeScript coreutils gnugrep jq curl common-updater-scripts runtimeShell;
|
2016-12-10 04:37:37 +01:00
|
|
|
};
|
|
|
|
|
2012-03-31 15:40:34 +02:00
|
|
|
meta = {
|
|
|
|
description = "IBM ThinkPad hardware functions driver";
|
2018-01-31 14:13:10 +01:00
|
|
|
homepage = https://github.com/evgeni/tp_smapi;
|
2012-03-31 15:40:34 +02:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.garbas ];
|
|
|
|
# driver is only ment for linux thinkpads i think bellow platforms should cover it.
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
};
|
|
|
|
}
|