2017-02-19 14:33:31 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, kernel, writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts
|
2016-12-10 03:37:37 +00:00
|
|
|
}:
|
2012-03-31 13:40:34 +00:00
|
|
|
|
2017-01-30 10:18:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "tp_smapi-${version}-${kernel.version}";
|
|
|
|
version = "0.42";
|
|
|
|
|
2017-02-19 14:33:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evgeni";
|
|
|
|
repo = "tp_smapi";
|
|
|
|
rev = "tp-smapi/${version}";
|
|
|
|
sha256 = "12lnig90lrmkmqwl386q7ssqs9p0jikqhwl2wsmcmii1gn92hzfy";
|
|
|
|
name = "tp-smapi-${version}";
|
2017-01-30 10:18:56 +00:00
|
|
|
};
|
2012-03-31 13:40:34 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "pic" ];
|
2016-02-12 02:53:32 +00:00
|
|
|
|
2012-03-31 13:40:34 +00:00
|
|
|
makeFlags = [
|
2014-01-05 01:57:21 +00:00
|
|
|
"KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
|
2012-03-31 13:40:34 +00:00
|
|
|
"SHELL=/bin/sh"
|
2017-09-04 07:41:57 +00:00
|
|
|
"HDAPS=1"
|
2012-03-31 13:40:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-05 01:57:21 +00: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 07:24:30 +00:00
|
|
|
install -v -D -m 644 hdaps.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/hdapsd.ko"
|
2012-03-31 13:40:34 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-12-10 03:37:37 +00:00
|
|
|
passthru.updateScript = import ./update.nix {
|
2017-02-19 14:33:31 +00:00
|
|
|
inherit lib writeScript coreutils gnugrep jq curl common-updater-scripts;
|
2016-12-10 03:37:37 +00:00
|
|
|
};
|
|
|
|
|
2012-03-31 13:40:34 +00:00
|
|
|
meta = {
|
|
|
|
description = "IBM ThinkPad hardware functions driver";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = https://github.com/evgeni/tp_smapi/tree/tp-smapi/0.41;
|
2012-03-31 13:40:34 +00: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" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|