@@ -0,0 +1,38 @@
1+{ stdenv, fetchurl, pkgconfig, SDL2, alsaLib, gtk3, mesa_glu, makeWrapper
2+, mesa, libarchive, libao, unzip, xdg_utils, gsettings_desktop_schemas }:
3+
4+stdenv.mkDerivation rec {
5+ name = "nestopia-1.46.2";
6+ src = fetchurl {
7+ url = https://github.com/rdanbrook/nestopia/archive/1.46.2.tar.gz;
8+ sha256 = "07h49xwvg61dx20rk5p4r3ax2ar5y0ppvm60cqwqljyi9rdfbh7p";
9+ };
10+
11+ enableParallelBuilding = true;
12+
13+ buildInputs = [ pkgconfig SDL2 alsaLib gtk3 mesa_glu mesa makeWrapper
14+ libarchive libao unzip xdg_utils gsettings_desktop_schemas ];
15+
16+ installPhase = ''
17+ mkdir -p $out/{bin,share/nestopia}
18+ make install PREFIX=$out
19+ '';
20+
21+ preFixup = ''
22+ for f in $out/bin/*; do
23+ wrapProgram $f \
24+ --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
25+ done
26+ '';
27+
28+ patches = [ ./build-fix.patch ];
29+
30+ meta = {
31+ homepage = http://0ldsk00l.ca/nestopia/;
32+ description = "NES emulator with a focus on accuracy";
33+ license = stdenv.lib.licenses.gpl2;
34+ platforms = stdenv.lib.platforms.linux;
35+ maintainers = with stdenv.lib.maintainers; [ MP2E ];
36+ };
37+}
38+