nur-packages

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

default.nix (1368B)


      1 { lib, stdenv, fetchurl, cmake, unzip, ncurses5, SDL, SDL_mixer }:
      2 
      3 stdenv.mkDerivation (finalAttrs: {
      4   pname = "ascii-dash";
      5   version = "1.3";
      6 
      7   src = fetchurl {
      8     url = "mirror://sourceforge/ascii-dash/ASCII-DASH-${finalAttrs.version}.zip";
      9     hash = "sha256-38wBq067aIq9wr34WIP6Kg9LLnc8/2xV9Q+LkmflB5U=";
     10   };
     11 
     12   postPatch = ''
     13     substituteInPlace ascii-gfx/main.cpp \
     14       --replace-fail "boing.wav" "$out/share/ascii-dash/sounds/boing.wav"
     15     substituteInPlace dash/dash.cpp \
     16       --replace-fail "sounds/" "$out/share/ascii-dash/sounds/"
     17     substituteInPlace dash/dash_physics.cpp \
     18       --replace-fail "sounds/" "$out/share/ascii-dash/sounds/"
     19     substituteInPlace main.cpp \
     20       --replace-fail "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     mainProgram = "ascii-dash";
     43   };
     44 })