<commit_before>{ lib, stdenv, fetchurl, fetchzip, SDL, SDL_net }:

stdenv.mkDerivation rec {
  pname = "opentyrian";
  version = "2.1.20130907";

  src = fetchurl {
    url = "https://bitbucket.org/opentyrian/opentyrian/get/${version}.tar.gz";
    sha256 = "1jnrkq616pc4dhlbd4n30d65vmn25q84w6jfv9383l9q20cqf2ph";
  };

  data = fetchzip {
    url = "http://sites.google.com/a/camanis.net/opentyrian/tyrian/tyrian21.zip";
    sha256 = "1biz6hf6s7qrwn8ky0g6p8w7yg715w7yklpn6258bkks1s15hpdb";
  };

  buildInputs = [SDL SDL_net];

  patchPhase = "
    substituteInPlace src/file.c --replace /usr/share $out/share
  ";
  buildPhase = "make release";
  installPhase = "
    mkdir -p $out/bin
    cp ./opentyrian $out/bin
    mkdir -p $out/share/opentyrian/data
    cp -r $data/* $out/share/opentyrian/data
  ";

  meta = {
    description = ''Open source port of the game "Tyrian"'';
    homepage = "https://bitbucket.org/opentyrian/opentyrian";
    # This does not account of Tyrian data.
    # license = lib.licenses.gpl2;
  };
}<commit_msg>opentyrian: 2.1.20130907 -> 2.1.20220318<commit_after>{ lib
, stdenv
, fetchFromGitHub
, fetchzip
, SDL2
, SDL2_net
, pkg-config
}:

stdenv.mkDerivation rec {
  pname = "opentyrian";
  version = "2.1.20220318";

  src = fetchFromGitHub {
    owner = "opentyrian";
    repo = "opentyrian";
    rev = "v${version}";
    sha256 = "01z1zxpps4ils0bnwazl9lmqdbfhfd8fkacahnh6kqyczavg40xg";
  };

  data = fetchzip {
    url = "https://camanis.net/tyrian/tyrian21.zip";
    sha256 = "1biz6hf6s7qrwn8ky0g6p8w7yg715w7yklpn6258bkks1s15hpdb";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ SDL2 SDL2_net ];

  enableParallelBuilding = true;

  makeFlags = [ "prefix=${placeholder "out"}" ];

  postInstall = ''
    mkdir -p $out/share/games/tyrian
    cp -r $data/* $out/share/games/tyrian/
  '';

  meta = {
    description = ''Open source port of the game "Tyrian"'';
    homepage = "https://github.com/opentyrian/opentyrian";
    # This does not account of Tyrian data.
    # license = lib.licenses.gpl2;
  };
}
{'fraction_non_alphanumeric': 0.14257907542579076, 'fraction_numerical': 0.06569343065693431, 'mean_word_length': 3.3559322033898304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, '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': '5195935', 'n_tokens_mistral': 912, 'n_tokens_neox': 823, 'n_words': 141}