package.nix (1553B)
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 __structuredAttrs = true; 17 18 src = fetchurl { 19 url = "mirror://sourceforge/ascii-dash/ASCII-DASH-${finalAttrs.version}.zip"; 20 hash = "sha256-j1knFVGCh2fwHIV0oauNqjzhEnxINFGjcjTXHQ5tPbc="; 21 }; 22 23 postPatch = '' 24 substituteInPlace ascii-gfx/main.cpp \ 25 --replace-fail "boing.wav" "$out/share/ascii-dash/sounds/boing.wav" 26 substituteInPlace dash/dash.cpp \ 27 --replace-fail "sounds/" "$out/share/ascii-dash/sounds/" 28 substituteInPlace dash/dash_physics.cpp \ 29 --replace-fail "sounds/" "$out/share/ascii-dash/sounds/" 30 substituteInPlace main.cpp \ 31 --replace-fail "data/" "$out/share/ascii-dash/data/" 32 ''; 33 34 nativeBuildInputs = [ 35 cmake 36 unzip 37 ]; 38 39 buildInputs = [ 40 ncurses5 41 SDL 42 SDL_mixer 43 ]; 44 45 cmakeFlags = [ 46 (lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") 47 ]; 48 49 env.NIX_CFLAGS_COMPILE = toString ( 50 [ 51 "-Wno-error=mismatched-new-delete" 52 ] 53 ++ lib.optional stdenv.cc.isGNU "-Wno-error=stringop-truncation" 54 ); 55 56 installPhase = '' 57 install -Dm755 main $out/bin/ascii-dash 58 59 mkdir -p $out/share/ascii-dash 60 cp -r ../{data,sounds} $out/share/ascii-dash 61 ''; 62 63 meta = { 64 description = "Remake of BOULDER DASH with NCurses"; 65 homepage = "https://ascii-dash.sourceforge.io/"; 66 license = lib.licenses.mit; 67 platforms = lib.platforms.unix; 68 mainProgram = "ascii-dash"; 69 }; 70 })
