btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / rm / rmg / package.nix
blob8dcd685da4dd4e737ab877374a4ec30ac9a18755
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , gitUpdater
5 , boost
6 , cmake
7 , discord-rpc
8 , freetype
9 , hidapi
10 , libpng
11 , libsamplerate
12 , minizip
13 , nasm
14 , pkg-config
15 , qt6Packages
16 , SDL2
17 , speexdsp
18 , vulkan-headers
19 , vulkan-loader
20 , which
21 , xdg-user-dirs
22 , zlib
23 , withWayland ? false
24 # Affects final license
25 , withAngrylionRdpPlus ? false
28 let
29   inherit (qt6Packages) qtbase qtsvg qtwayland wrapQtAppsHook;
31 stdenv.mkDerivation rec {
32   pname = "rmg";
33   version = "0.6.6";
35   src = fetchFromGitHub {
36     owner = "Rosalie241";
37     repo = "RMG";
38     rev = "v${version}";
39     hash = "sha256-3Bl9SEHWQbi58VPpCT4H8TC1E5J5j4lRXS1QF+udPdg=";
40   };
42   nativeBuildInputs = [
43     cmake
44     nasm
45     pkg-config
46     wrapQtAppsHook
47     which
48   ];
50   buildInputs = [
51     boost
52     discord-rpc
53     freetype
54     hidapi
55     libpng
56     libsamplerate
57     minizip
58     qtbase
59     qtsvg
60     SDL2
61     speexdsp
62     vulkan-headers
63     vulkan-loader
64     xdg-user-dirs
65     zlib
66   ] ++ lib.optional withWayland qtwayland;
68   cmakeFlags = [
69     "-DPORTABLE_INSTALL=OFF"
70     # mupen64plus-input-gca is written in Rust, so we can't build it with
71     # everything else.
72     "-DNO_RUST=ON"
73     "-DUSE_ANGRYLION=${lib.boolToString withAngrylionRdpPlus}"
74   ];
76   qtWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [
77     "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}"
78   ] ++ lib.optional withWayland "--set RMG_WAYLAND 1";
80   passthru.updateScript = gitUpdater { rev-prefix = "v"; };
82   meta = with lib; {
83     homepage = "https://github.com/Rosalie241/RMG";
84     description = "Rosalie's Mupen GUI";
85     longDescription = ''
86       Rosalie's Mupen GUI is a free and open-source mupen64plus front-end
87       written in C++. It offers a simple-to-use user interface.
88     '';
89     license = if withAngrylionRdpPlus then licenses.unfree else licenses.gpl3Only;
90     platforms = platforms.linux;
91     mainProgram = "RMG";
92     maintainers = with maintainers; [ slam-bert ];
93   };