1{ stdenv, fetchurl, perl, read-edid }:
2
3stdenv.mkDerivation rec {
4 name = "i2c-tools-${version}";
5 version = "3.1.1";
6
7 src = fetchurl {
8 url = "http://dl.lm-sensors.org/i2c-tools/releases/${name}.tar.bz2";
9 sha256 = "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l";
10 };
11
12 buildInputs = [ perl ];
13
14 patchPhase = ''
15 substituteInPlace eeprom/decode-edid --replace "/usr/sbin/parse-edid" "${read-edid}/bin/parse-edid"
16 substituteInPlace stub/i2c-stub-from-dump --replace "/sbin/" ""
17 '';
18
19 installPhase = ''
20 make install prefix=$out
21 rm -rf $out/include # Installs include/linux/i2c-dev.h that conflics with kernel headers
22 '';
23
24 meta = with stdenv.lib; {
25 description = "Set of I2C tools for Linux";
26 homepage = http://www.lm-sensors.org/wiki/I2CTools;
27 license = licenses.gpl2;
28 maintainers = [ maintainers.dezgeg ];
29 platforms = platforms.linux;
30 };
31}