summary refs log tree commit diff
path: root/pkgs/misc/emulators/nestopia/default.nix
blob: 3ed455bd350fbd835d84bcb2deee534b80b927fe (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
{ stdenv, fetchurl, pkgconfig, SDL2, alsaLib, gtk3, mesa_glu, makeWrapper
, mesa, libarchive, libao, unzip, xdg_utils, gsettings_desktop_schemas }:

stdenv.mkDerivation rec {
  name = "nestopia-1.46.2";
  src = fetchurl {
    url = https://github.com/rdanbrook/nestopia/archive/1.46.2.tar.gz;
    sha256 = "07h49xwvg61dx20rk5p4r3ax2ar5y0ppvm60cqwqljyi9rdfbh7p";
  };

  # nondeterministic failures when creating directories
  enableParallelBuilding = false;

  hardening_format = false;

  buildInputs = [ pkgconfig SDL2 alsaLib gtk3 mesa_glu mesa makeWrapper
                  libarchive libao unzip xdg_utils gsettings_desktop_schemas ];

  installPhase = ''
    mkdir -p $out/{bin,share/nestopia}
    make install PREFIX=$out
  '';

  preFixup = ''
     for f in $out/bin/*; do
       wrapProgram $f \
         --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
     done
  '';

  patches = [ ./build-fix.patch ];

  meta = {
    homepage = http://0ldsk00l.ca/nestopia/;
    description = "NES emulator with a focus on accuracy";
    license = stdenv.lib.licenses.gpl2;
    platforms = stdenv.lib.platforms.linux;
    maintainers = with stdenv.lib.maintainers; [ MP2E ];
  };
}