btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / su / supermariowar / package.nix
blobcac54270548b48c07409fe2e3262c1ed02209c21
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,
17 stdenv.mkDerivation (finalAttrs: {
18   pname = "supermariowar";
19   version = "2023-unstable-2024-09-21";
21   src = fetchFromGitHub {
22     owner = "mmatyas";
23     repo = "supermariowar";
24     rev = "7e7ebe39cadba5d0bd9d7e87a08264332c2f1f12";
25     hash = "sha256-kBwaqw0GZvLWE5GqgfieLRU4s8wYFtTZyl1MgwWGbMc=";
26     fetchSubmodules = true;
27   };
29   nativeBuildInputs = [
30     cmake
31     pkg-config
32     makeWrapper
33   ];
35   buildInputs = [
36     enet
37     yaml-cpp
38     SDL2
39     SDL2_image
40     SDL2_mixer
41     zlib
42   ];
44   cmakeFlags = [ "-DBUILD_STATIC_LIBS=OFF" ];
46   postInstall = ''
47     mkdir -p $out/bin
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
54     ln -s $out/games/smw-server $out/bin/smw-server
55   '';
57   passthru.updateScript = unstableGitUpdater { };
59   meta = {
60     description = "A 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   };