about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2019-12-19 19:24:02 +0800
committerMatthieu Coudron <coudron@iij.ad.jp>2019-12-19 15:15:56 +0100
commita71a2ee654585a79659927458f72a3f3076f3d48 (patch)
treea0257165e2e319a68de4527612258d6c204ecf61 /pkgs/misc
parenta7a8bf9040c873ec50df7e4a9736d24721a96dab (diff)
ppsspp: 1.4.2 -> 1.9.3
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/emulators/ppsspp/default.nix66
1 files changed, 45 insertions, 21 deletions
diff --git a/pkgs/misc/emulators/ppsspp/default.nix b/pkgs/misc/emulators/ppsspp/default.nix
index 98ea02cd8970e..b976c1e8c27db 100644
--- a/pkgs/misc/emulators/ppsspp/default.nix
+++ b/pkgs/misc/emulators/ppsspp/default.nix
@@ -1,45 +1,69 @@
-{ stdenv, mkDerivation, fetchFromGitHub, cmake, pkgconfig, qtbase, qtmultimedia
-, glew, libzip, snappy, zlib, withGamepads ? true, SDL2 }:
-
-assert withGamepads -> (SDL2 != null);
-with stdenv.lib;
+{ SDL2
+, cmake
+, fetchFromGitHub
+, ffmpeg
+, glew
+, lib
+, libzip
+, mkDerivation
+, pkgconfig
+, python3
+, qtbase
+, qtmultimedia
+, snappy
+, zlib
+}:
 
 mkDerivation rec {
   pname = "ppsspp";
-  version = "1.4.2";
+  version = "1.9.3";
 
   src = fetchFromGitHub {
     owner = "hrydgard";
     repo = "ppsspp";
     rev = "v${version}";
     fetchSubmodules = true;
-    sha256 = "0m4qkhx7q496sm7ibg2n7rm3npxzfr93iraxgndk0vhfk8vy8w75";
+    sha256 = "17sym0vk72lzbh9a1501mhw98c78x1gq7k1fpy69nvvb119j37wa";
   };
 
-  patchPhase = ''
-    echo 'const char *PPSSPP_GIT_VERSION = "${src.rev}";' >> git-version.cpp
-    substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
+  postPatch = ''
+    substituteInPlace git-version.cmake \
+      --replace unknown ${src.rev}
+    substituteInPlace UI/NativeApp.cpp \
+      --replace /usr/share $out/share
   '';
 
-  nativeBuildInputs = [ cmake pkgconfig ];
-  buildInputs = [ qtbase qtmultimedia glew libzip snappy zlib ]
-    ++ optionals withGamepads [ SDL2 SDL2.dev ];
+  nativeBuildInputs = [ cmake pkgconfig python3 ];
+
+  buildInputs = [
+    SDL2
+    ffmpeg
+    glew
+    libzip
+    qtbase
+    qtmultimedia
+    snappy
+    zlib
+  ];
 
-  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DUSING_QT_UI=ON" ];
+  cmakeFlags = [
+    "-DOpenGL_GL_PREFERENCE=GLVND"
+    "-DUSE_SYSTEM_FFMPEG=ON"
+    "-DUSE_SYSTEM_LIBZIP=ON"
+    "-DUSE_SYSTEM_SNAPPY=ON"
+    "-DUSING_QT_UI=ON"
+  ];
 
   installPhase = ''
-    mkdir -p $out/bin $out/share/ppsspp
-    mv PPSSPPQt $out/bin/ppsspp
+    mkdir -p $out/share/ppsspp
+    install -Dm555 PPSSPPQt $out/bin/ppsspp
     mv assets $out/share/ppsspp
   '';
 
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = https://www.ppsspp.org/;
+  meta = with lib; {
     description = "A PSP emulator for Android, Windows, Mac and Linux, written in C++";
+    homepage = "https://www.ppsspp.org/";
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ AndersonTorres ];
-    platforms = platforms.linux ++ platforms.darwin ++ platforms.cygwin;
   };
 }