1{ stdenv, fetchurl, perl, read-edid }:
2
3stdenv.mkDerivation rec {
4 name = "i2c-tools-${version}";
5 version = "3.1.2";
6
7 src = fetchurl {
8 url = "http://http.debian.net/debian/pool/main/i/i2c-tools/i2c-tools_${version}.orig.tar.bz2";
9 sha256 = "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv";
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}