69 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  lib,
 | 
						|
  stdenv,
 | 
						|
  fetchFromGitHub,
 | 
						|
  cmake,
 | 
						|
  pkg-config,
 | 
						|
  enet,
 | 
						|
  yaml-cpp,
 | 
						|
  SDL2,
 | 
						|
  SDL2_image,
 | 
						|
  SDL2_mixer,
 | 
						|
  zlib,
 | 
						|
  unstableGitUpdater,
 | 
						|
  makeWrapper,
 | 
						|
}:
 | 
						|
 | 
						|
stdenv.mkDerivation (finalAttrs: {
 | 
						|
  pname = "supermariowar";
 | 
						|
  version = "2024-unstable-2025-04-03";
 | 
						|
 | 
						|
  src = fetchFromGitHub {
 | 
						|
    owner = "mmatyas";
 | 
						|
    repo = "supermariowar";
 | 
						|
    rev = "c0ed774a2415ad45e72bd6086add2a5cbfc88898";
 | 
						|
    hash = "sha256-vh8SSMxAOG8f9nyJmKUlA8yb+G61Bfc62dhB2eLdo20=";
 | 
						|
    fetchSubmodules = true;
 | 
						|
  };
 | 
						|
 | 
						|
  nativeBuildInputs = [
 | 
						|
    cmake
 | 
						|
    pkg-config
 | 
						|
    makeWrapper
 | 
						|
  ];
 | 
						|
 | 
						|
  buildInputs = [
 | 
						|
    enet
 | 
						|
    yaml-cpp
 | 
						|
    SDL2
 | 
						|
    SDL2_image
 | 
						|
    SDL2_mixer
 | 
						|
    zlib
 | 
						|
  ];
 | 
						|
 | 
						|
  cmakeFlags = [ "-DBUILD_STATIC_LIBS=OFF" ];
 | 
						|
 | 
						|
  postInstall = ''
 | 
						|
    mkdir -p $out/bin
 | 
						|
 | 
						|
    for app in smw smw-leveledit smw-worldedit; do
 | 
						|
      makeWrapper $out/games/$app $out/bin/$app \
 | 
						|
        --add-flags "--datadir $out/share/games/smw"
 | 
						|
    done
 | 
						|
 | 
						|
    ln -s $out/games/smw-server $out/bin/smw-server
 | 
						|
  '';
 | 
						|
 | 
						|
  passthru.updateScript = unstableGitUpdater { };
 | 
						|
 | 
						|
  meta = {
 | 
						|
    description = "A fan-made multiplayer Super Mario Bros. style deathmatch game";
 | 
						|
    homepage = "https://github.com/mmatyas/supermariowar";
 | 
						|
    changelog = "https://github.com/mmatyas/supermariowar/blob/${finalAttrs.src.rev}/CHANGELOG";
 | 
						|
    license = lib.licenses.gpl2Plus;
 | 
						|
    maintainers = with lib.maintainers; [ theobori ];
 | 
						|
    mainProgram = "smw";
 | 
						|
    platforms = lib.platforms.linux;
 | 
						|
  };
 | 
						|
})
 |