nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 enet,
8 yaml-cpp,
9 SDL2,
10 SDL2_image,
11 SDL2_mixer,
12 zlib,
13 unstableGitUpdater,
14 makeWrapper,
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "supermariowar";
19 version = "2024-unstable-2025-06-18";
20
21 src = fetchFromGitHub {
22 owner = "mmatyas";
23 repo = "supermariowar";
24 rev = "71383b07b99a52b57be79cf371ab718337365019";
25 hash = "sha256-PjweE8cGAp8V4LY0/6QzLekQ80Q1qbwDiiSzDirA29s=";
26 fetchSubmodules = true;
27 };
28
29 nativeBuildInputs = [
30 cmake
31 pkg-config
32 makeWrapper
33 ];
34
35 buildInputs = [
36 enet
37 yaml-cpp
38 SDL2
39 SDL2_image
40 SDL2_mixer
41 zlib
42 ];
43
44 cmakeFlags = [ "-DBUILD_STATIC_LIBS=OFF" ];
45
46 postInstall = ''
47 mkdir -p $out/bin
48
49 for app in smw smw-leveledit smw-worldedit; do
50 makeWrapper $out/games/$app $out/bin/$app \
51 --add-flags "--datadir $out/share/games/smw"
52 done
53
54 ln -s $out/games/smw-server $out/bin/smw-server
55 '';
56
57 passthru.updateScript = unstableGitUpdater { };
58
59 meta = {
60 description = "Fan-made multiplayer Super Mario Bros. style deathmatch game";
61 homepage = "https://github.com/mmatyas/supermariowar";
62 changelog = "https://github.com/mmatyas/supermariowar/blob/${finalAttrs.src.rev}/CHANGELOG";
63 license = lib.licenses.gpl2Plus;
64 maintainers = with lib.maintainers; [ theobori ];
65 mainProgram = "smw";
66 platforms = lib.platforms.linux;
67 };
68})