about summary refs log tree commit diff
path: root/pkgs/by-name/ka/katawa-shoujo-re-engineered/package.nix
blob: 34ec710a9b455ecf3b0c4ec338bf568ea55d865f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
  lib,
  stdenvNoCC,
  fetchFromGitea,
  makeDesktopItem,
  copyDesktopItems,
  makeWrapper,
  renpy,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "katawa-shoujo-re-engineered";
  version = "1.4.4";

  src = fetchFromGitea {
    # GitHub mirror at fleetingheart/ksre
    domain = "codeberg.org";
    owner = "fhs";
    repo = "katawa-shoujo-re-engineered";
    rev = "v${finalAttrs.version}";
    hash = "sha256-RYJM/wGVWqIRZzHLUtUZ5mKUrUftDVaOwS1f/EpW6Tk=";
  };

  desktopItems = [
    (makeDesktopItem {
      name = "katawa-shoujo-re-engineered";
      desktopName = "Katawa Shoujo: Re-Engineered";
      type = "Application";
      icon = finalAttrs.meta.mainProgram;
      categories = [ "Game" ];
      exec = finalAttrs.meta.mainProgram;
    })
  ];

  nativeBuildInputs = [
    makeWrapper
    copyDesktopItems
  ];

  dontBuild = true;

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    makeWrapper ${lib.getExe' renpy "renpy"} $out/bin/${finalAttrs.meta.mainProgram} \
      --add-flags ${finalAttrs.src} --add-flags run
    install -D $src/web-icon.png $out/share/icons/hicolor/512x512/apps/${finalAttrs.meta.mainProgram}.png

    runHook postInstall
  '';

  meta = {
    description = "A fan-made modernization of the classic visual novel Katawa Shoujo";
    homepage = "https://www.fhs.sh/projects";
    license = with lib.licenses; [
      # code
      mpl20
      # assets from the original game
      cc-by-nc-nd-30
    ];
    mainProgram = "katawa-shoujo-re-engineered";
    maintainers = with lib.maintainers; [ quantenzitrone ];
    platforms = renpy.meta.platforms;
  };
})