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