<commit_before>{ fetchurl, fetchhg, stdenv, xorg, gcc46, makeWrapper }:

stdenv.mkDerivation rec {
  # Inferno is a rolling release from a mercurial repository. For the verison number
  # of the package I'm using the mercurial commit number.
  version = "645";
  name = "inferno-${version}";

  # The mercurial repository does not contain all the components needed for the
  # runtime system. The 'base' package contains these. For this package I download
  # the base, extract the elements required from that, and add them to the source
  # pulled from the mercurial repository.
  srcBase = fetchurl {
    url = "http://www.vitanuova.com/dist/4e/inferno-20100120.tgz";
    sha256 = "0msvy3iwl4n5k0ry0xiyysjkq0qsawmwn3hvg67hbi5y8g7f7l88";
  };

  src = fetchhg {
    url    = "https://inferno-os.googlecode.com/hg";
    rev    = "7ab390b860ca";
    sha256 = "09y0iclb3yy10gw1p0182sddg64xh60q2fx4ai7lxyfb65i76qbh";
  };

  # Fails with gcc48 due to inferno triggering an optimisation issue with floating point.
  buildInputs = [ gcc46 xorg.libX11 xorg.libXpm xorg.libXext xorg.xextproto makeWrapper ];

  infernoWrapper = ./inferno;

  configurePhase = ''
    tar --strip-components=1 -xvf $srcBase inferno/fonts inferno/Mkdirs inferno/empties
    sed -e 's@^ROOT=.*$@ROOT='"$out"'/share/inferno@g' -e 's@^OBJTYPE=.*$@OBJTYPE=386@g' -e 's@^SYSHOST=.*$@SYSHOST=Linux@g' -i mkconfig
    mkdir prof
    sh Mkdirs
  '';

  buildPhase = ''
    export PATH=$PATH:$out/share/inferno/Linux/386/bin
    mkdir -p $out/share/inferno
    cp -r . $out/share/inferno
    ./makemk.sh
    mk nuke
    mk
  '';

  installPhase = ''
    mk install
    mkdir -p $out/bin
    makeWrapper $out/share/inferno/Linux/386/bin/emu $out/bin/emu \
      --suffix LD_LIBRARY_PATH ':' "${gcc46.cc}/lib" \
      --suffix PATH ':' "$out/share/inferno/Linux/386/bin"
    makeWrapper $infernoWrapper $out/bin/inferno \
      --suffix LD_LIBRARY_PATH ':' "${gcc46.cc}/lib" \
      --suffix PATH ':' "$out/share/inferno/Linux/386/bin" \
      --set INFERNO_ROOT "$out/share/inferno"
  '';

  meta = {
    description = "A compact distributed operating system for building cross-platform distributed systems";
    homepage = "http://inferno-os.org/";
    license = stdenv.lib.licenses.gpl2;<commit_msg>inferno: turn off fortify hardening<commit_after>{ fetchurl, fetchhg, stdenv, xorg, gcc46, makeWrapper }:

stdenv.mkDerivation rec {
  # Inferno is a rolling release from a mercurial repository. For the verison number
  # of the package I'm using the mercurial commit number.
  version = "645";
  name = "inferno-${version}";

  # The mercurial repository does not contain all the components needed for the
  # runtime system. The 'base' package contains these. For this package I download
  # the base, extract the elements required from that, and add them to the source
  # pulled from the mercurial repository.
  srcBase = fetchurl {
    url = "http://www.vitanuova.com/dist/4e/inferno-20100120.tgz";
    sha256 = "0msvy3iwl4n5k0ry0xiyysjkq0qsawmwn3hvg67hbi5y8g7f7l88";
  };

  src = fetchhg {
    url    = "https://inferno-os.googlecode.com/hg";
    rev    = "7ab390b860ca";
    sha256 = "09y0iclb3yy10gw1p0182sddg64xh60q2fx4ai7lxyfb65i76qbh";
  };

  # Fails with gcc48 due to inferno triggering an optimisation issue with floating point.
  buildInputs = [ gcc46 xorg.libX11 xorg.libXpm xorg.libXext xorg.xextproto makeWrapper ];

  infernoWrapper = ./inferno;

  configurePhase = ''
    tar --strip-components=1 -xvf $srcBase inferno/fonts inferno/Mkdirs inferno/empties
    sed -e 's@^ROOT=.*$@ROOT='"$out"'/share/inferno@g' -e 's@^OBJTYPE=.*$@OBJTYPE=386@g' -e 's@^SYSHOST=.*$@SYSHOST=Linux@g' -i mkconfig
    mkdir prof
    sh Mkdirs
  '';

  buildPhase = ''
    export PATH=$PATH:$out/share/inferno/Linux/386/bin
    mkdir -p $out/share/inferno
    cp -r . $out/share/inferno
    ./makemk.sh
    mk nuke
    mk
  '';

  installPhase = ''
    mk install
    mkdir -p $out/bin
    makeWrapper $out/share/inferno/Linux/386/bin/emu $out/bin/emu \
      --suffix LD_LIBRARY_PATH ':' "${gcc46.cc}/lib" \
      --suffix PATH ':' "$out/share/inferno/Linux/386/bin"
    makeWrapper $infernoWrapper $out/bin/inferno \
      --suffix LD_LIBRARY_PATH ':' "${gcc46.cc}/lib" \
      --suffix PATH ':' "$out/share/inferno/Linux/386/bin" \
      --set INFERNO_ROOT "$out/share/inferno"
  '';

  hardening_fortify = false;

  meta = {
    description = "A compact distributed operating system for building cross-platform distributed systems";
    homepage = "http://inferno-os.org/";
    license = stdenv.lib.licenses.gpl2;
{'fraction_non_alphanumeric': 0.12860262008733625, 'fraction_numerical': 0.04017467248908297, 'mean_word_length': 3.285313376987839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4538446', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1649, 'n_words': 387}