nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1308B)


      1 { lib, stdenv, fetchurl, cmake, unzip, ncurses5, SDL, SDL_mixer }:
      2 
      3 stdenv.mkDerivation (finalAttrs: {
      4   pname = "ascii-dash";
      5   version = "1.2.1";
      6 
      7   src = fetchurl {
      8     url = "mirror://sourceforge/ascii-dash/ASCII-DASH-${finalAttrs.version}.zip";
      9     hash = "sha256-MMkhsmWMtK606lWuuvtl2bq3ub9uWl24tqbCdnb8Da8=";
     10   };
     11 
     12   postPatch = ''
     13     substituteInPlace ascii-gfx/main.cpp \
     14       --replace "boing.wav" "$out/share/ascii-dash/sounds/boing.wav"
     15     substituteInPlace dash.cpp \
     16       --replace "sounds/" "$out/share/ascii-dash/sounds/"
     17     substituteInPlace dash_physics.cpp \
     18       --replace "sounds/" "$out/share/ascii-dash/sounds/"
     19     substituteInPlace main.cpp \
     20       --replace "data/" "$out/share/ascii-dash/data/"
     21   '';
     22 
     23   nativeBuildInputs = [ cmake unzip ];
     24 
     25   buildInputs = [ ncurses5 SDL SDL_mixer ];
     26 
     27   NIX_CFLAGS_COMPILE = [ "-Wno-error=mismatched-new-delete" ]
     28     ++ lib.optional stdenv.cc.isGNU "-Wno-error=stringop-truncation";
     29 
     30   installPhase = ''
     31     install -Dm755 main $out/bin/ascii-dash
     32 
     33     mkdir -p $out/share/ascii-dash
     34     cp -r ../{data,sounds} $out/share/ascii-dash
     35   '';
     36 
     37   meta = with lib; {
     38     description = "Remake of BOULDER DASH with NCurses";
     39     homepage = "https://ascii-dash.sourceforge.io/";
     40     license = licenses.mit;
     41     platforms = platforms.unix;
     42   };
     43 })