@@ -1,37 +1,43 @@
1−{ stdenv, fetchgit, zlib, libpng, qt4, qmake4Hook, pkgconfig
2−, withGamepads ? true, SDL # SDL is used for gamepad functionality
3−}:
1+{ stdenv, fetchFromGitHub, cmake, pkgconfig, qtbase, qtmultimedia
2+, glew, libzip, snappy, zlib, withGamepads ? true, SDL2 }:
43
5−assert withGamepads -> (SDL != null);
6−
7−let
8− version = "1.3";
9− fstat = x: fn: "-D" + fn + "=" + (if x then "ON" else "OFF");
10−in
4+assert withGamepads -> (SDL2 != null);
115with stdenv.lib;
12−stdenv.mkDerivation rec{
13− name = "PPSSPP-${version}";
146
15− src = fetchgit {
16− url = "https://github.com/hrydgard/ppsspp.git";
17− rev = "refs/tags/v${version}";
7+stdenv.mkDerivation rec {
8+ name = "ppsspp-${version}";
9+ version = "1.4.2";
10+
11+ src = fetchFromGitHub {
12+ owner = "hrydgard";
13+ repo = "ppsspp";
14+ rev = "v${version}";
1815 fetchSubmodules = true;
19− sha256 = "0l8vgdlw657r8gv7rz8iqa6zd9zrbzw10pwhcnahzil7w9qrd03g";
16+ sha256 = "0m4qkhx7q496sm7ibg2n7rm3npxzfr93iraxgndk0vhfk8vy8w75";
2017 };
2118
22− buildInputs = [ zlib libpng qt4 ]
23− ++ (if withGamepads then [ SDL ] else [ ]);
19+ patchPhase = ''
20+ echo 'const char *PPSSPP_GIT_VERSION = "${src.rev}";' >> git-version.cpp
21+ substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
22+ '';
23+
24+ nativeBuildInputs = [ cmake pkgconfig ];
25+ buildInputs = [ qtbase qtmultimedia glew libzip snappy zlib ]
26+ ++ optionals withGamepads [ SDL2 SDL2.dev ];
2427
25− nativeBuildInputs = [ pkgconfig qmake4Hook ];
28+ cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DUSING_QT_UI=ON" ];
2629
27− qmakeFlags = [ "PPSSPPQt.pro" ];
30+ installPhase = ''
31+ mkdir -p $out/bin $out/share/ppsspp
32+ mv PPSSPPQt $out/bin/ppsspp
33+ mv assets $out/share/ppsspp
34+ '';
2835
29− preConfigure = "cd Qt";
30− installPhase = "mkdir -p $out/bin && cp ppsspp $out/bin";
36+ enableParallelBuilding = true;
3137
3238 meta = {
33− homepage = http://www.ppsspp.org/;
34− description = "A PSP emulator, the Qt4 version";
39+ homepage = https://www.ppsspp.org/;
40+ description = "A PSP emulator for Android, Windows, Mac and Linux, written in C++";
3541 license = licenses.gpl2Plus;
3642 maintainers = with maintainers; [ fuuzetsu AndersonTorres ];
3743 platforms = platforms.linux ++ platforms.darwin ++ platforms.cygwin;