@@ -0,0 +1,55 @@
1+{ stdenv, fetchurl, alsaLib, curl, gdk_pixbuf, gcc, glib, gtk3,
2+ libX11, openssl, ncurses5, SDL, SDL_ttf, unzip, zlib, wrapGAppsHook }:
3+
4+with stdenv.lib;
5+
6+stdenv.mkDerivation rec {
7+ name = "epsxe-${version}";
8+ version = "2.0.5";
9+
10+ src = with stdenv.lib; let
11+ version2 = concatStrings (splitString "." version);
12+ platform = "linux" + (optionalString stdenv.is64bit "_x64");
13+ in fetchurl {
14+ url = "http://www.epsxe.com/files/ePSXe${version2}${platform}.zip";
15+ sha256 = if stdenv.is64bit
16+ then "16fa9qc2xhaz1f6294m0b56s5l86cbmclwm9w3mqnch0yjsrvab0"
17+ else "1677lclam557kp8jwvchdrk27zfj50fqx2q9i3bcx26d9k61q3kl";
18+ };
19+
20+ nativeBuildInputs = [ unzip wrapGAppsHook ];
21+ sourceRoot = ".";
22+
23+ buildInputs = [
24+ alsaLib
25+ curl
26+ gdk_pixbuf
27+ glib
28+ gtk3
29+ libX11
30+ openssl
31+ ncurses5
32+ SDL
33+ SDL_ttf
34+ stdenv.cc.cc.lib
35+ zlib
36+ ];
37+
38+ dontStrip = true;
39+
40+ installPhase = ''
41+ install -D epsxe${optionalString stdenv.is64bit "_x64"} $out/bin/epsxe
42+ patchelf \
43+ --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
44+ --set-rpath ${makeLibraryPath buildInputs} \
45+ $out/bin/epsxe
46+ '';
47+
48+ meta = {
49+ homepage = http://epsxe.com/;
50+ description = "Enhanced PSX (PlayStation 1) emulator";
51+ license = licenses.unfree;
52+ maintainers = with maintainers; [ yegortimoshenko ];
53+ platforms = [ "i686-linux" "x86_64-linux" ];
54+ };
55+}