summaryrefslogtreecommitdiff
path: root/pkgs/by-name/rm/rmg/package.nix
blob: 5558fd286168411c1c0f25cb393b678c27dbd1fc (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{
  lib,
  stdenv,
  fetchFromGitHub,
  gitUpdater,
  boost,
  cmake,
  discord-rpc,
  freetype,
  hidapi,
  libpng,
  libsamplerate,
  minizip,
  nasm,
  pkg-config,
  qt6Packages,
  SDL2,
  SDL2_net,
  speexdsp,
  vulkan-headers,
  vulkan-loader,
  which,
  xdg-user-dirs,
  zlib,
  withWayland ? false,
  # Affects final license
  withAngrylionRdpPlus ? false,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "rmg";
  version = "0.7.8";

  src = fetchFromGitHub {
    owner = "Rosalie241";
    repo = "RMG";
    tag = "v${finalAttrs.version}";
    hash = "sha256-ijoXKZbK4tm1KQ4I7R/g12tCUqrg4wRRRBCPPL03WEk=";
  };

  nativeBuildInputs = [
    cmake
    nasm
    pkg-config
    qt6Packages.wrapQtAppsHook
    which
  ];

  buildInputs =
    [
      boost
      discord-rpc
      freetype
      hidapi
      libpng
      libsamplerate
      minizip
      SDL2
      SDL2_net
      speexdsp
      vulkan-headers
      vulkan-loader
      xdg-user-dirs
      zlib
    ]
    ++ (
      with qt6Packages;
      [
        qtbase
        qtsvg
        qtwebsockets
      ]
      ++ lib.optional withWayland qtwayland
    );

  cmakeFlags = [
    (lib.cmakeBool "PORTABLE_INSTALL" false)
    # mupen64plus-input-gca is written in Rust, so we can't build it with
    # everything else.
    (lib.cmakeBool "NO_RUST" true)
    (lib.cmakeBool "USE_ANGRYLION" withAngrylionRdpPlus)
  ];

  qtWrapperArgs =
    lib.optionals stdenv.hostPlatform.isLinux [
      "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}"
    ]
    ++ lib.optional withWayland "--set RMG_ALLOW_WAYLAND 1";

  passthru.updateScript = gitUpdater { rev-prefix = "v"; };

  meta = {
    homepage = "https://github.com/Rosalie241/RMG";
    changelog = "https://github.com/Rosalie241/RMG/releases/tag/v${finalAttrs.version}";
    description = "Rosalie's Mupen GUI";
    longDescription = ''
      Rosalie's Mupen GUI is a free and open-source mupen64plus front-end
      written in C++. It offers a simple-to-use user interface.
    '';
    license = if withAngrylionRdpPlus then lib.licenses.unfree else lib.licenses.gpl3Only;
    platforms = lib.platforms.linux;
    mainProgram = "RMG";
    maintainers = with lib.maintainers; [ slam-bert ];
  };
})