<commit_before>{ fetchurl, stdenv, flex, bison, gettext, ncurses, libusb, freetype, qemu
, EFIsupport ? false }:

let

  prefix = "grub${if EFIsupport then "-efi" else ""}";
  
  version = "2.00";
  
  unifont_bdf = fetchurl {
    url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz";
    sha256 = "0s0qfff6n6282q28nwwblp5x295zd6n71kl43xj40vgvdqxv0fxx";
  };
  
in

stdenv.mkDerivation rec {
  name = "${prefix}-${version}";

  src = fetchurl {
    url = "mirror://gnu/grub/grub-${version}.tar.xz";
    sha256 = "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq";
  };

  buildNativeInputs = [ flex bison ];
  buildInputs = [ ncurses libusb freetype gettext ]
    ++ stdenv.lib.optional doCheck qemu;

  preConfigure =
    '' for i in "tests/util/"*.in
       do
         sed -i "$i" -e's|/bin/bash|/bin/sh|g'
       done

       # Apparently, the QEMU executable is no longer called
       # `qemu-system-i386', even on i386.
       #
       # In addition, use `-nodefaults' to avoid errors like:
       #
       #  chardev: opening backend "stdio" failed
       #  qemu: could not open serial device 'stdio': Invalid argument
       #<commit_msg>grub2: Add dependency on devicemapper (needed for LVM support)<commit_after>{ fetchurl, stdenv, flex, bison, gettext, ncurses, libusb, freetype, qemu
, devicemapper, EFIsupport ? false }:

let

  prefix = "grub${if EFIsupport then "-efi" else ""}";
  
  version = "2.00";
  
  unifont_bdf = fetchurl {
    url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz";
    sha256 = "0s0qfff6n6282q28nwwblp5x295zd6n71kl43xj40vgvdqxv0fxx";
  };
  
in

stdenv.mkDerivation rec {
  name = "${prefix}-${version}";

  src = fetchurl {
    url = "mirror://gnu/grub/grub-${version}.tar.xz";
    sha256 = "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq";
  };

  buildNativeInputs = [ flex bison ];
  buildInputs = [ ncurses libusb freetype gettext devicemapper ]
    ++ stdenv.lib.optional doCheck qemu;

  preConfigure =
    '' for i in "tests/util/"*.in
       do
         sed -i "$i" -e's|/bin/bash|/bin/sh|g'
       done

       # Apparently, the QEMU executable is no longer called
       # `qemu-system-i386', even on i386.
       #
       # In addition, use `-nodefaults' to avoid errors like:
       #
       #  chardev: opening backend "stdio" failed
       #  qemu: could not open serial device 'stdio': Invalid argument
       #
{'fraction_non_alphanumeric': 0.1297071129707113, 'fraction_numerical': 0.0497907949790795, 'mean_word_length': 2.862681744749596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2108992', 'n_tokens_mistral': 1015, 'n_tokens_neox': 937, 'n_words': 198}