1{
2 fetchFromGitHub,
3 lib,
4 libGLU,
5 SDL2,
6 SDL2_net,
7 xorg,
8 stdenv,
9 zlib,
10}:
11
12stdenv.mkDerivation {
13 pname = "supermodel";
14 version = "0-unstable-2025-04-17";
15
16 src = fetchFromGitHub {
17 owner = "trzy";
18 repo = "supermodel";
19 rev = "2272893a0511c0b3b50f6dda64addb7014717dd3";
20 hash = "sha256-3FdLBGxmi4Xj7ao2nvjLleJSTXvKQrhUWvnQr8DK/RY=";
21 };
22
23 buildInputs = [
24 libGLU
25 SDL2
26 SDL2_net
27 xorg.libX11
28 zlib
29 ];
30
31 env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security";
32
33 makefile = "Makefiles/Makefile.UNIX";
34
35 makeFlags = [ "NET_BOARD=1" ];
36
37 installPhase = ''
38 runHook preInstall
39
40 mkdir -p $out/bin
41 mkdir -p $out/share/supermodel
42 cp bin/* $out/bin
43 cp -r Config Assets $out/share/supermodel
44
45 runHook postInstall
46 '';
47
48 meta = {
49 description = "Sega Model 3 Arcade Emulator";
50 homepage = "https://github.com/trzy/supermodel";
51 license = lib.licenses.gpl3;
52 longDescription = ''
53 Supermodel requires specific files to be present in the $HOME directory of
54 the user running the emulator. To ensure these files are present, move the
55 configuration and assets as follows:
56
57 <code>cp $out/share/supermodel/Config/Supermodel.ini ~/.config/supermodel/Config/Supermodel.ini</code>
58 <code>cp -r $out/share/supermodel/Assets/* ~/.local/share/supermodel/Assets/</code>
59
60 Then the emulator can be started with:
61 <code>supermodel -game-xml-file=$out/share/supermodel/Config/Games.xml /path/to/romset</code>.
62 '';
63 mainProgram = "supermodel";
64 maintainers = with lib.maintainers; [ msanft ];
65 platforms = lib.platforms.linux;
66 };
67}