about summary refs log tree commit diff
path: root/pkgs/by-name/me/mednafen/package.nix
blob: a001edd0e0f15fffaf984dea26299fb5ccef0b9e (plain) (blame)
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
106
107
108
109
110
{
  lib,
  SDL2,
  SDL2_net,
  alsa-lib,
  fetchurl,
  flac,
  freeglut,
  libGL,
  libGLU,
  libX11,
  libcdio,
  libiconv,
  libjack2,
  libsamplerate,
  libsndfile,
  pkg-config,
  stdenv,
  zlib,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "mednafen";
  version = "1.32.1";

  src = fetchurl {
    url = "https://mednafen.github.io/releases/files/mednafen-${finalAttrs.version}.tar.xz";
    hash = "sha256-3n65SrZiEq53WDdlJDaKirIII0szeWYlymMFR9vIODI=";
  };

  outputs = [ "out" "doc" ];

  nativeBuildInputs = [
    SDL2
    pkg-config
  ];

  buildInputs = [
    SDL2
    SDL2_net
    flac
    freeglut
    libcdio
    libjack2
    libsamplerate
    libsndfile
    zlib
  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
    alsa-lib
    libGL
    libGLU
    libX11
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    libiconv
  ];

  hardeningDisable = [
    "format"
    "pic"
  ];

  enableParallelBuilding = true;

  strictDeps = true;

  postInstall = ''
    mkdir -p $doc/share/doc
    mv Documentation $doc/share/doc/mednafen
  '';

  meta = {
    homepage = "https://mednafen.github.io/";
    description = "A portable, CLI-driven, SDL+OpenGL-based, multi-system emulator";
    longDescription = ''
      Mednafen is a portable, utilizing OpenGL and SDL,
      argument(command-line)-driven multi-system emulator. Mednafen has the
      ability to remap hotkey functions and virtual system inputs to a keyboard,
      a joystick, or both simultaneously. Save states are supported, as is
      real-time game rewinding. Screen snapshots may be taken, in the PNG file
      format, at the press of a button. Mednafen can record audiovisual movies
      in the QuickTime file format, with several different lossless codecs
      supported.

      The following systems are supported (refer to the emulation module
      documentation for more details):

      - Apple II/II+
      - Atari Lynx
      - Neo Geo Pocket (Color)
      - WonderSwan
      - GameBoy (Color)
      - GameBoy Advance
      - Nintendo Entertainment System
      - Super Nintendo Entertainment System/Super Famicom
      - Virtual Boy
      - PC Engine/TurboGrafx 16 (CD)
      - SuperGrafx
      - PC-FX
      - Sega Game Gear
      - Sega Genesis/Megadrive
      - Sega Master System
      - Sega Saturn (experimental, x86_64 only)
      - Sony PlayStation
    '';
    license = lib.licenses.gpl2Plus;
    mainProgram = "mednafen";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    platforms = lib.platforms.unix;
  };
})