nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 SDL2,
4 cmake,
5 fetchFromGitHub,
6 ffmpeg,
7 discord-rpc,
8 libedit,
9 elfutils,
10 libepoxy,
11 libsForQt5,
12 libzip,
13 lua,
14 minizip,
15 pkg-config,
16 stdenv,
17 wrapGAppsHook3,
18 enableDiscordRpc ? false,
19}:
20
21let
22 inherit (libsForQt5)
23 qtbase
24 qtmultimedia
25 qttools
26 wrapQtAppsHook
27 ;
28in
29stdenv.mkDerivation (finalAttrs: {
30 pname = "mgba";
31 version = "0.10.5";
32
33 src = fetchFromGitHub {
34 owner = "mgba-emu";
35 repo = "mgba";
36 tag = finalAttrs.version;
37 hash = "sha256-Za2o06odeisnrE3i7w54OeaPXHscZAaD1+EXii7bnuk=";
38 };
39
40 outputs = [
41 "out"
42 "dev"
43 "doc"
44 "lib"
45 "man"
46 ];
47
48 nativeBuildInputs = [
49 SDL2
50 cmake
51 pkg-config
52 wrapGAppsHook3
53 wrapQtAppsHook
54 ];
55
56 buildInputs = [
57 SDL2
58 ffmpeg
59 libedit
60 elfutils
61 libepoxy
62 libzip
63 lua
64 minizip
65 qtbase
66 qtmultimedia
67 qttools
68 ]
69 ++ lib.optionals enableDiscordRpc [ discord-rpc ];
70
71 cmakeFlags = [
72 (lib.cmakeBool "USE_DISCORD_RPC" enableDiscordRpc)
73 ];
74
75 strictDeps = true;
76
77 dontWrapGApps = true;
78
79 preFixup = ''
80 qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
81 '';
82
83 meta = {
84 homepage = "https://mgba.io";
85 description = "Modern GBA emulator with a focus on accuracy";
86 longDescription = ''
87 mGBA is a new Game Boy Advance emulator written in C.
88
89 The project started in April 2013 with the goal of being fast enough to
90 run on lower end hardware than other emulators support, without
91 sacrificing accuracy or portability. Even in the initial version, games
92 generally play without problems. It is loosely based on the previous
93 GBA.js emulator, although very little of GBA.js can still be seen in mGBA.
94
95 Other goals include accurate enough emulation to provide a development
96 environment for homebrew software, a good workflow for tool-assist
97 runners, and a modern feature set for emulators that older emulators may
98 not support.
99 '';
100 changelog = "https://raw.githubusercontent.com/mgba-emu/mgba/${finalAttrs.src.rev}/CHANGES";
101 license = with lib.licenses; [ mpl20 ];
102 mainProgram = "mgba";
103 maintainers = with lib.maintainers; [ Gliczy ];
104 platforms = lib.platforms.linux;
105 broken = enableDiscordRpc; # Some obscure `ld` error
106 };
107})