package.nix (1495B)
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 cmakeFlags = [ 44 (lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") 45 ]; 46 47 NIX_CFLAGS_COMPILE = [ 48 "-Wno-error=mismatched-new-delete" 49 ] 50 ++ lib.optional stdenv.cc.isGNU "-Wno-error=stringop-truncation"; 51 52 installPhase = '' 53 install -Dm755 main $out/bin/ascii-dash 54 55 mkdir -p $out/share/ascii-dash 56 cp -r ../{data,sounds} $out/share/ascii-dash 57 ''; 58 59 meta = { 60 description = "Remake of BOULDER DASH with NCurses"; 61 homepage = "https://ascii-dash.sourceforge.io/"; 62 license = lib.licenses.mit; 63 platforms = lib.platforms.unix; 64 mainProgram = "ascii-dash"; 65 }; 66 })
