linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / misc / edid-generator / default.nix
blob89ac21db5f57d414b053b185d28e0d46596ea67e
1 { lib, stdenv
2 , fetchFromGitHub
3 , dos2unix
4 , edid-decode
5 , hexdump
6 , zsh
7 , modelines ? [] # Modeline "1280x800"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync
8 }:
9 let
10   version = "unstable-2018-03-15";
11 in stdenv.mkDerivation {
12   pname = "edid-generator";
13   inherit version;
15   src = fetchFromGitHub {
16     owner = "akatrevorjay";
17     repo = "edid-generator";
18     rev = "31a6f80784d289d2faa8c4ca4788409c83b3ea14";
19     sha256 = "0j6wqzx5frca8b5i6812vvr5iwk7440fka70bmqn00k0vfhsc2x3";
20   };
22   nativeBuildInputs = [ dos2unix edid-decode hexdump zsh ];
24   postPatch = ''
25     patchShebangs modeline2edid
26   '';
28   configurePhase = (lib.concatMapStringsSep "\n" (m: "echo \"${m}\" | ./modeline2edid -") modelines);
30   installPhase = ''
31     install -Dm 444 *.bin -t "$out/lib/firmware/edid"
32   '';
34   meta = {
35     description = "Hackerswork to generate an EDID blob from given Xorg Modelines";
36     homepage = "https://github.com/akatrevorjay/edid-generator";
37     license = lib.licenses.mit;
38     maintainers = [ lib.maintainers.flokli ];
39     platforms = lib.platforms.all;
40   };