about summary refs log tree commit diff
path: root/pkgs/by-name/ce/celeste64/package.nix
blob: bcd6356015fe6f332e3e6d196d99209f91f3c2b4 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
  lib,
  buildDotnetModule,
  dotnetCorePackages,
  fetchFromGitHub,
  makeDesktopItem,
  copyDesktopItems,
  SDL2,
  libGL,
  mesa,
  systemd,
  libpulseaudio,
  libselinux,
  wayland,
  libdecor,
  xorg,
  libxkbcommon,
  libdrm,
  withSELinux ? false,
}:

buildDotnetModule rec {
  pname = "celeste64";
  version = "1.1.1";

  src = fetchFromGitHub {
    repo = "Celeste64";
    owner = "ExOK";
    rev = "v${version}";
    hash = "sha256-XRAjDYIqYaQYCWNNT7UuLDKDBgq3vqxtCzay7pGICtA=";
  };
  projectFile = "Celeste64.csproj";
  dotnet-sdk = dotnetCorePackages.sdk_8_0;
  dotnet-runtime = dotnetCorePackages.runtime_8_0;
  nugetDeps = ./deps.nix;
  strictDeps = true;
  executables = [ "Celeste64" ];
  nativeBuildInputs = [ copyDesktopItems ];
  runtimeDeps =
    [
      libdecor
      libGL
      SDL2
      systemd
      libpulseaudio
      wayland
      libdrm
      libxkbcommon
      xorg.libX11
      xorg.libXfixes
      xorg.libXext
      xorg.libXcursor
      xorg.libXi
      xorg.libXrandr
    ]
    ++ lib.optionals withSELinux [ libselinux ];

  postInstall = ''
    export ICON_DIR=$out/share/icons/hicolor/256x256/apps
    mkdir -p $ICON_DIR

    cp -r $src/Content $out/lib/$pname/
    cp $src/Content/Models/Sources/logo1.png $ICON_DIR/Celeste64.png
  '';


  desktopItems = [
    (makeDesktopItem {
      name = "Celeste64";
      exec = "Celeste64";
      comment = meta.description;
      desktopName = "Celeste64";
      genericName = "Celeste64";
      icon = "Celeste64";
      categories = [ "Game" ];
    })
  ];

  meta = {
    license = with lib.licenses; [ unfree mit ];
    platforms = [ "x86_64-linux" "aarch64-linux" "armv7l-linux" ];
    maintainers = with lib.maintainers; [ lychee ];
    mainProgram = "Celeste64";
    homepage = "https://github.com/ExOK/Celeste64";
    description = "Celeste 64: Fragments of the Mountain";
    downloadPage = "https://maddymakesgamesinc.itch.io/celeste64";
  };
}