<commit_before>{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, SDL_mixer, pkgconfig, lua, zlib, unzip }:

let
  version = "2.2.2";

  # I took several games at random from http://instead.syscall.ru/games/
  games = [
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-apple-day-1.2.zip;
      sha256 = "0d4m554hiqmgl4xl0jp0b3bqjl35879768hqznh9y57y04sygd2a";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-cat_en-1.2.zip;
      sha256 = "0jlm3ssqlka16dm0rg6qfjh6xdh3pv7lj2s4ib4mqwj2vfy0v6sg";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-vinny-0.1.zip;
      sha256 = "15qdbg82zp3a8vz4qxminr0xbzbdpnsciliy2wm3raz4hnadawg1";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-toilet3in1-1.2.zip;
      sha256 = "0wz4bljbg67m84qwpaqpzs934a5pcbhpgh39fvbbbfvnnlm4lirl";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-kayleth-0.4.1.zip;
      sha256 = "0xmn9inys0kbcdd02qaqp8gazqs67xq3fq7hvcy2qb9jbq85j8b2";
    })
  ];
in

stdenv.mkDerivation rec {
  name = "instead-" + version;

  src = fetchurl {
    url = "http://downloads.sourceforge.net/project/instead/instead/${version}/instead_${version}.tar.gz";
    sha256 = "14aln69vvr7frsbjdfmzgf0rd45zf247xbfsnhx3hlfsqlj58wd3";
  };

  NIX_LDFLAGS = "-llua -lgcc_s";

  buildInputs = [ SDL SDL_ttf SDL_image SDL_mixer pkgconfig lua zlib unzip ];

  configurePhase = ''
    { echo 2; echo $out; } | ./configure.sh
  '';

  inherit games;

  installPhase = ''
    make install

    pushd $out/share/instead/games
    for a in $games; do
      unzip $a
    done
    popd
  '';

  meta = with stdenv.lib; {
    description = "Simple text adventure interpreter for Unix and Windows";<commit_msg>instead: update from 2.2.2 to 2.2.3<commit_after>{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, SDL_mixer, pkgconfig, lua, zlib, unzip }:

let
  version = "2.2.3";

  # I took several games at random from http://instead.syscall.ru/games/
  games = [
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-apple-day-1.2.zip;
      sha256 = "0d4m554hiqmgl4xl0jp0b3bqjl35879768hqznh9y57y04sygd2a";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-cat_en-1.2.zip;
      sha256 = "0jlm3ssqlka16dm0rg6qfjh6xdh3pv7lj2s4ib4mqwj2vfy0v6sg";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-vinny-0.1.zip;
      sha256 = "15qdbg82zp3a8vz4qxminr0xbzbdpnsciliy2wm3raz4hnadawg1";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-toilet3in1-1.2.zip;
      sha256 = "0wz4bljbg67m84qwpaqpzs934a5pcbhpgh39fvbbbfvnnlm4lirl";
    })
    (fetchurl {
      url = http://instead-games.googlecode.com/files/instead-kayleth-0.4.1.zip;
      sha256 = "0xmn9inys0kbcdd02qaqp8gazqs67xq3fq7hvcy2qb9jbq85j8b2";
    })
  ];
in

stdenv.mkDerivation rec {
  name = "instead-" + version;

  src = fetchurl {
    url = "http://downloads.sourceforge.net/project/instead/instead/${version}/instead_${version}.tar.gz";
    sha256 = "0g01z5z7777pwlsv63gwx4ly61hgqxv53hhb6g22dc5ydaq4965h";
  };

  NIX_LDFLAGS = "-llua -lgcc_s";

  buildInputs = [ SDL SDL_ttf SDL_image SDL_mixer pkgconfig lua zlib unzip ];

  configurePhase = ''
    { echo 2; echo $out; } | ./configure.sh
  '';

  inherit games;

  installPhase = ''
    make install

    pushd $out/share/instead/games
    for a in $games; do
      unzip $a
    done
    popd
  '';

  meta = with stdenv.lib; {
    description = "Simple text adventure interpreter for Unix and Windows";
{'fraction_non_alphanumeric': 0.12788778877887788, 'fraction_numerical': 0.0748074807480748, 'mean_word_length': 3.2290697674418603, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2861512', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1514, 'n_words': 216}