summary refs log tree commit diff
path: root/pkgs/applications/virtualization/cbfstool/default.nix
blob: 01832b55292517598fbbbcd0dce853ea62e6a414 (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
34
35
36
37
{ stdenv, fetchgit, iasl, flex, bison }:

stdenv.mkDerivation rec {
  name = "cbfstool-${version}";
  version = "git-2015-07-09";

  src = fetchgit {
    url = "http://review.coreboot.org/p/coreboot";
    rev = "5d866213f42fd22aed80abb5a91d74f6d485ac3f";
    sha256 = "148155829jbabsgg1inmcpqmwbg0fgp8a685bzybv9j4ibasi0z2";
  };

  buildInputs = [ iasl flex bison ];

  hardening_fortify = false;

  buildPhase = ''
    export LEX=${flex}/bin/flex
    make -C util/cbfstool
    '';

  installPhase = ''
    mkdir -p $out/bin
    cp util/cbfstool/cbfstool $out/bin
    cp util/cbfstool/fmaptool $out/bin
    cp util/cbfstool/rmodtool $out/bin
    '';

  meta = with stdenv.lib; {
    description = "CBFS tool";
    homepage = http://www.coreboot.org;
    license = licenses.gpl2;
    maintainers = [ maintainers.tstrobel ];
    platforms = platforms.linux;
  };
}