Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / by-name / ce / celeste-classic / package.nix
blobbbea59a5b457a06cc44cca261879ff64f009a311
1 { lib
2 , stdenvNoCC
3 , fetchzip
4 , autoPatchelfHook
5 , SDL2
6 , practiceMod ? false
7 }:
9 let
10   directory = if practiceMod then "CELESTE*Practice*" else "CELESTE";
11   srcbin = if practiceMod then "celeste_practice_mod" else "celeste";
12   outbin = if practiceMod then "celeste-classic-pm" else "celeste-classic";
14 stdenvNoCC.mkDerivation {
15   pname = outbin;
16   version = "unstable-2020-12-08";
18   # From https://www.speedrun.com/celestep8/resources
19   src = fetchzip {
20     url = "https://www.speedrun.com/static/resource/174ye.zip?v=f3dc98f";
21     hash = "sha256-GANHqKB0N905QJOLaePKWkUuPl9UlL1iqvkMMvw/CC8=";
22     extension = "zip";
23   };
25   nativeBuildInputs = [
26     autoPatchelfHook
27   ];
29   buildInputs = [ SDL2 ];
31   installPhase = ''
32     runHook preInstall
33     install -Dsm755 ${directory}/${srcbin} $out/lib/${outbin}/${outbin}
34     install -Dm444 ${directory}/data.pod $out/lib/${outbin}/data.pod
35     mkdir -p $out/bin
36     ln -s $out/lib/${outbin}/${outbin} $out/bin/
37     runHook postInstall
38   '';
40   meta = with lib; {
41     description = "A PICO-8 platformer about climbing a mountain, made in four days${lib.optionalString practiceMod " (Practice Mod)"}";
42     homepage = "https://celesteclassic.github.io/";
43     license = licenses.unfree;
44     platforms = platforms.linux;
45     mainProgram = outbin;
46     maintainers = with maintainers; [ mrtnvgr ];
47     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
48   };