Coreboot: Difference between revisions

m fix tutorial link
Artturin (talk | contribs)
Make the shell cross compatible
Line 11: Line 11:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
# shell.nix
{
  pkgs ? import <nixpkgs> { },
}:


# NOTE we need mkShellNoCC
# NOTE we need mkShellNoCC
# mkShell would add the regular gcc, which has no ada (gnat)
# mkShell would add the regular gcc, which has no ada (gnat)
# https://github.com/NixOS/nixpkgs/issues/142943
# https://github.com/NixOS/nixpkgs/issues/142943
 
pkgs.callPackage (
with import <nixpkgs> { };
  {
mkShellNoCC {
    mkShellNoCC,
  buildInputs = [
    qemu,
     gnat11 # gcc with ada
    pkg-config,
     #gnatboot # gnat1
    gnat11,
     ncurses # make menuconfig
    m4,
    m4 flex bison # Generate flashmap descriptor parser
    flex,
     #clang
    bison,
     zlib
    zlib,
    #acpica-tools # iasl
    ncurses,
     pkgconfig
  }:
    qemu # test the image
  mkShellNoCC {
  ];
    strictDeps = true;
   shellHook = ''
     # host/target agnostic programs
    # TODO remove?
     depsBuildBuild = [
    NIX_LDFLAGS="$NIX_LDFLAGS -lncurses"
      qemu # override and change `hostCpuTargets` if cross-compiling
  '';
    ];
}
    # compilers & linkers & dependecy finding programs
     nativeBuildInputs = [
      pkg-config
      gnat11 # gcc with ada
      m4
      flex
      bison # Generate flashmap descriptor parser
    ];
     # libraries
     buildInputs = [
      zlib
      ncurses # make menuconfig
     ];
   }
) { }
</syntaxhighlight>
</syntaxhighlight>