2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, perl
|
|
|
|
, read-edid
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "i2c-tools";
|
2021-10-17 09:34:42 +00:00
|
|
|
version = "4.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git";
|
|
|
|
rev = "v${version}";
|
2021-10-17 09:34:42 +00:00
|
|
|
sha256 = "sha256-HlmIocum+HZEKNiS5BUwEIswRfTMUhD1vCPibAuAK0Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-10-17 09:34:42 +00:00
|
|
|
substituteInPlace eeprom/decode-edid \
|
|
|
|
--replace "/usr/sbin/parse-edid" "${read-edid}/bin/parse-edid"
|
|
|
|
|
|
|
|
substituteInPlace stub/i2c-stub-from-dump \
|
|
|
|
--replace "/sbin/" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2021-10-17 09:34:42 +00:00
|
|
|
rm -rf $out/include/linux/i2c-dev.h # conflics with kernel headers
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Set of I2C tools for Linux";
|
|
|
|
homepage = "https://i2c.wiki.kernel.org/index.php/I2C_Tools";
|
2021-05-20 23:08:51 +00:00
|
|
|
# library is LGPL 2.1 or later; "most tools" GPL 2 or later
|
|
|
|
license = with licenses; [ lgpl21Plus gpl2Plus ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.dezgeg ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|