2021-05-01 14:27:49 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-06-15 12:25:58 +00:00
|
|
|
, fetchzip
|
2021-05-01 14:27:49 +00:00
|
|
|
, perl
|
|
|
|
, read-edid
|
|
|
|
}:
|
2015-05-17 22:43:13 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "i2c-tools";
|
2024-10-13 12:57:12 +00:00
|
|
|
version = "4.4";
|
2015-05-17 22:43:13 +00:00
|
|
|
|
2023-06-15 12:25:58 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/snapshot/i2c-tools-v${version}.tar.gz";
|
2024-10-13 12:57:12 +00:00
|
|
|
sha256 = "sha256-Zm83gxdZH2XQCc/Dihp7vumF9WAvKgt6OORns5Mua7M=";
|
2015-05-17 22:43:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
2018-12-31 17:26:07 +00:00
|
|
|
postPatch = ''
|
2021-10-19 06:02: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/" ""
|
2015-05-17 22:43:13 +00:00
|
|
|
'';
|
|
|
|
|
2018-12-31 17:26:07 +00:00
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
2021-05-01 14:27:49 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2018-12-31 17:26:07 +00:00
|
|
|
postInstall = ''
|
2021-10-19 06:02:42 +00:00
|
|
|
rm -rf $out/include/linux/i2c-dev.h # conflics with kernel headers
|
2015-05-17 22:43:13 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-05-17 22:43:13 +00:00
|
|
|
description = "Set of I2C tools for Linux";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://i2c.wiki.kernel.org/index.php/I2C_Tools";
|
2021-05-01 14:27:49 +00:00
|
|
|
# library is LGPL 2.1 or later; "most tools" GPL 2 or later
|
|
|
|
license = with licenses; [ lgpl21Plus gpl2Plus ];
|
2015-05-17 22:43:13 +00:00
|
|
|
maintainers = [ maintainers.dezgeg ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|