Skip to content

Commit

Permalink
pkgs(games/native/celeste-classic*): improve package files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnvgr committed Nov 1, 2023
1 parent dfcc550 commit b8a27bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
10 changes: 8 additions & 2 deletions pkgs/games/native/celeste-classic-2.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ stdenvNoCC, fetchzip, autoPatchelfHook, pkgs, lib }:
{ lib
, stdenvNoCC
, fetchzip
, autoPatchelfHook
, SDL2
}:

stdenvNoCC.mkDerivation {
pname = "celeste-classic-2";
Expand All @@ -14,7 +19,7 @@ stdenvNoCC.mkDerivation {
autoPatchelfHook
];

buildInputs = with pkgs; [ SDL2 ];
buildInputs = [ SDL2 ];

installPhase = ''
runHook preInstall
Expand All @@ -26,6 +31,7 @@ stdenvNoCC.mkDerivation {
meta = with lib; {
description = "A PICO-8 platformer about hiking around a mountain, made in three days for Celeste's third anniversary";
homepage = "https://mattmakesgames.itch.io/celeste-classic-2";
mainProgram = pname;
license = licenses.unfree;
platforms = platforms.linux;
};
Expand Down
25 changes: 16 additions & 9 deletions pkgs/games/native/celeste-classic.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{ stdenvNoCC, fetchzip, autoPatchelfHook, pkgs, lib, practiceMod ? false }:
{ lib
, stdenvNoCC
, fetchzip
, autoPatchelfHook
, SDL2
, practiceMod ? false
}:

let
folder = if practiceMod then "CELESTE*Practice*" else "CELESTE";
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 {
in
stdenvNoCC.mkDerivation {
pname = outbin;
version = "1.0";

Expand All @@ -17,21 +24,21 @@ in stdenvNoCC.mkDerivation {
autoPatchelfHook
];

buildInputs = with pkgs; [ SDL2 ];

sourceRoot = ".";
buildInputs = [ SDL2 ];

installPhase = ''
runHook preInstall
install -Dsm755 */${folder}/${srcbin} $out/bin/${outbin}
install -Dm444 */${folder}/data.pod $out/bin/data.pod
install -Dsm755 ${directory}/${srcbin} $out/bin/${outbin}
install -Dm444 ${directory}/data.pod $out/bin/data.pod
runHook postInstall
'';

meta = with lib; {
description = "A PICO-8 platformer about climbing a mountain, made in four days ${if practiceMod then "(Practice Mod)" else ""}";
description = "A PICO-8 platformer about climbing a mountain, made in four days${if practiceMod then " (Practice Mod)" else ""}";
homepage = "https://celesteclassic.github.io/";
license = licenses.unfree;
platforms = platforms.linux;
mainProgram = outbin;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
}

0 comments on commit b8a27bf

Please sign in to comment.