about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ce/celeste-classic/package.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-05 09:32:31 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-05 09:32:31 +0100
commit480416cc0d7e508b652c516af8d7342e3b1e59e3 (patch)
treed64d990b0d7cc1f80dca687b48563bc71628b55e /nixpkgs/pkgs/by-name/ce/celeste-classic/package.nix
parent05f40ff2bfe9c68198664c38d65816f677ac7ed4 (diff)
parentfa804edfb7869c9fb230e174182a8a1a7e512c40 (diff)
downloadnixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.gz
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.bz2
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.lz
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.xz
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.zst
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs into HEAD
Conflicts:
	nixpkgs/pkgs/servers/pr-tracker/default.nix
Diffstat (limited to 'nixpkgs/pkgs/by-name/ce/celeste-classic/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/ce/celeste-classic/package.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/ce/celeste-classic/package.nix b/nixpkgs/pkgs/by-name/ce/celeste-classic/package.nix
new file mode 100644
index 000000000000..bbea59a5b457
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/ce/celeste-classic/package.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenvNoCC
+, fetchzip
+, autoPatchelfHook
+, SDL2
+, practiceMod ? false
+}:
+
+let
+  directory = if practiceMod then "CELESTE*Practice*" else "CELESTE";
+  srcbin = if practiceMod then "celeste_practice_mod" else "celeste";
+  outbin = if practiceMod then "celeste-classic-pm" else "celeste-classic";
+in
+stdenvNoCC.mkDerivation {
+  pname = outbin;
+  version = "unstable-2020-12-08";
+
+  # From https://www.speedrun.com/celestep8/resources
+  src = fetchzip {
+    url = "https://www.speedrun.com/static/resource/174ye.zip?v=f3dc98f";
+    hash = "sha256-GANHqKB0N905QJOLaePKWkUuPl9UlL1iqvkMMvw/CC8=";
+    extension = "zip";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+  ];
+
+  buildInputs = [ SDL2 ];
+
+  installPhase = ''
+    runHook preInstall
+    install -Dsm755 ${directory}/${srcbin} $out/lib/${outbin}/${outbin}
+    install -Dm444 ${directory}/data.pod $out/lib/${outbin}/data.pod
+    mkdir -p $out/bin
+    ln -s $out/lib/${outbin}/${outbin} $out/bin/
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A PICO-8 platformer about climbing a mountain, made in four days${lib.optionalString practiceMod " (Practice Mod)"}";
+    homepage = "https://celesteclassic.github.io/";
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    mainProgram = outbin;
+    maintainers = with maintainers; [ mrtnvgr ];
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+  };
+}