summary refs log tree commit diff
path: root/pkgs/os-specific/linux/firmware/sof-firmware/default.nix
blob: a9fc44e48cc892bdb8518b860d6be89750bcd10f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, fetchFromGitHub }:

with stdenv.lib;
stdenv.mkDerivation rec {
  pname = "sof-firmware";
  version = "1.5.1";

  src = fetchFromGitHub {
    owner = "thesofproject";
    repo = "sof-bin";
    rev = "ae61d2778b0a0f47461a52da0d1f191f651e0763";
    sha256 = "0j6bpwz49skvdvian46valjw4anwlrnkq703n0snkbngmq78prba";
  };

  phases = [ "unpackPhase" "installPhase" ];

  installPhase = ''
    mkdir -p $out/lib/firmware/intel

    sed -i 's/ROOT=.*$/ROOT=$out/g' go.sh
    sed -i 's/VERSION=.*$/VERSION=v${version}/g' go.sh

    ./go.sh
  '';

  meta = with stdenv.lib; {
    description = "Sound Open Firmware";
    homepage = "https://www.sofproject.org/";
    license = with licenses; [ bsd3 isc ];
    maintainers = with maintainers; [ lblasc evenbrenden ];
    platforms = with platforms; linux;
  };
}