nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 50 lines 1.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchzip, 5 perl, 6 read-edid, 7}: 8 9stdenv.mkDerivation rec { 10 pname = "i2c-tools"; 11 version = "4.4"; 12 13 src = fetchzip { 14 url = "https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/snapshot/i2c-tools-v${version}.tar.gz"; 15 sha256 = "sha256-Zm83gxdZH2XQCc/Dihp7vumF9WAvKgt6OORns5Mua7M="; 16 }; 17 18 buildInputs = [ perl ]; 19 20 postPatch = '' 21 substituteInPlace eeprom/decode-edid \ 22 --replace "/usr/sbin/parse-edid" "${read-edid}/bin/parse-edid" 23 24 substituteInPlace stub/i2c-stub-from-dump \ 25 --replace "/sbin/" "" 26 ''; 27 28 makeFlags = [ "PREFIX=${placeholder "out"}" ]; 29 30 outputs = [ 31 "out" 32 "man" 33 ]; 34 35 postInstall = '' 36 rm -rf $out/include/linux/i2c-dev.h # conflics with kernel headers 37 ''; 38 39 meta = with lib; { 40 description = "Set of I2C tools for Linux"; 41 homepage = "https://i2c.wiki.kernel.org/index.php/I2C_Tools"; 42 # library is LGPL 2.1 or later; "most tools" GPL 2 or later 43 license = with licenses; [ 44 lgpl21Plus 45 gpl2Plus 46 ]; 47 maintainers = [ maintainers.dezgeg ]; 48 platforms = platforms.linux; 49 }; 50}