<commit_before>{ stdenv, stdenvNoCC, gccStdenv, lib, recurseIntoAttrs, libsForQt5, newScope, texlive, perlPackages, jdk8, jre8 }:

# To whomever it may concern:
#
# This directory menaces with spikes of Nix code. It is terrifying.
#
# If this is your first time here, you should probably install the dwarf-fortress-full package,
# for instance with:
#
# environment.systemPackages = [ pkgs.dwarf-fortress-packages.dwarf-fortress-full ];
#
# You can adjust its settings by using override, or compile your own package by
# using the other packages here.
#
# For example, you can enable the FPS indicator, disable the intro, pick a
# theme other than phoebus (the default for dwarf-fortress-full), _and_ use
# an older version with something like:
#
# environment.systemPackages = [
#   (pkgs.dwarf-fortress-packages.dwarf-fortress-full.override {
#      dfVersion = "0.44.11";
#      theme = "cla";
#      enableIntro = false;
#      enableFPS = true;
#   })
# ]
#
# Take a look at lazy-pack.nix to see all the other options.
#
# You will find the configuration files in ~/.local/share/df_linux/data/init. If
# you un-symlink them and edit, then the scripts will avoid overwriting your
# changes on later launches, but consider extending the wrapper with your
# desired options instead.

with lib;

let
  callPackage = newScope self;

  # The latest Dwarf Fortress version. Maintainers: when a new version comes
  # out, ensure that (unfuck|dfhack|twbt) are all up to date before changing
  # this.
  latestVersion = "0.47.05";

  # Converts a version to a package name.
  versionToName = version: "dwarf-fortress_${lib.replaceStrings ["."] ["_"] version}";

  dwarf-therapist-original = libsForQt5.callPackage ./dwarf-therapist {
    texlive = texlive.combine {
      inherit (texlive) scheme-basic float caption wrapfig adjmulticol sidecap preprint enumitem;
    };
  };

  # A map of names to each Dwarf Fortress package we know about.
  df-games = lib.listToAttrs (map
    (dfVersion: {
      name = versionToName dfVersion;
      value =
        let
          # I can't believe this syntax works. Spikes of Nix code indeed...
          dwarf-fortress = callPackage ./game.nix {
            inherit dfVersion;
            inherit dwarf-fortress-unfuck;
          };

          # unfuck is linux-only right now, we will only use it there.
          dwarf-fortress-unfuck =
            if stdenv.isLinux then callPackage ./unfuck.nix { inherit dfVersion; }
            else null;

          twbt = callPackage ./twbt { inherit dfVersion; };

          dfhack = callPackage ./dfhack {
            inherit (perlPackages) XMLLibXML XMLLibXSLT;
            inherit dfVersion twbt;
            stdenv = gccStdenv;
          };

          dwarf-therapist = libsForQt5.callPackage ./dwarf-therapist/wrapper.nix {
            inherit dwarf-fortress;<commit_msg>dwarf-fortress-unfuck: don't overwrite to null on none linux platforms<commit_after>{ stdenv, stdenvNoCC, gccStdenv, lib, recurseIntoAttrs, libsForQt5, newScope, texlive, perlPackages, jdk8, jre8 }:

# To whomever it may concern:
#
# This directory menaces with spikes of Nix code. It is terrifying.
#
# If this is your first time here, you should probably install the dwarf-fortress-full package,
# for instance with:
#
# environment.systemPackages = [ pkgs.dwarf-fortress-packages.dwarf-fortress-full ];
#
# You can adjust its settings by using override, or compile your own package by
# using the other packages here.
#
# For example, you can enable the FPS indicator, disable the intro, pick a
# theme other than phoebus (the default for dwarf-fortress-full), _and_ use
# an older version with something like:
#
# environment.systemPackages = [
#   (pkgs.dwarf-fortress-packages.dwarf-fortress-full.override {
#      dfVersion = "0.44.11";
#      theme = "cla";
#      enableIntro = false;
#      enableFPS = true;
#   })
# ]
#
# Take a look at lazy-pack.nix to see all the other options.
#
# You will find the configuration files in ~/.local/share/df_linux/data/init. If
# you un-symlink them and edit, then the scripts will avoid overwriting your
# changes on later launches, but consider extending the wrapper with your
# desired options instead.

with lib;

let
  callPackage = newScope self;

  # The latest Dwarf Fortress version. Maintainers: when a new version comes
  # out, ensure that (unfuck|dfhack|twbt) are all up to date before changing
  # this.
  latestVersion = "0.47.05";

  # Converts a version to a package name.
  versionToName = version: "dwarf-fortress_${lib.replaceStrings ["."] ["_"] version}";

  dwarf-therapist-original = libsForQt5.callPackage ./dwarf-therapist {
    texlive = texlive.combine {
      inherit (texlive) scheme-basic float caption wrapfig adjmulticol sidecap preprint enumitem;
    };
  };

  # A map of names to each Dwarf Fortress package we know about.
  df-games = lib.listToAttrs (map
    (dfVersion: {
      name = versionToName dfVersion;
      value =
        let
          # I can't believe this syntax works. Spikes of Nix code indeed...
          dwarf-fortress = callPackage ./game.nix {
            inherit dfVersion;
            inherit dwarf-fortress-unfuck;
          };

          dwarf-fortress-unfuck = callPackage ./unfuck.nix { inherit dfVersion; };

          twbt = callPackage ./twbt { inherit dfVersion; };

          dfhack = callPackage ./dfhack {
            inherit (perlPackages) XMLLibXML XMLLibXSLT;
            inherit dfVersion twbt;
            stdenv = gccStdenv;
          };

          dwarf-therapist = libsForQt5.callPackage ./dwarf-therapist/wrapper.nix {
            inherit dwarf-fortress;
{'fraction_non_alphanumeric': 0.0906832298136646, 'fraction_numerical': 0.005323868677905945, 'mean_word_length': 2.9440167949615117, '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': '806128', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1715, 'n_words': 571}