nixpkgs-suyu/pkgs/misc/emulators/ppsspp/default.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

2017-09-27 16:33:00 +02:00
{ stdenv, fetchFromGitHub, cmake, pkgconfig, qtbase, qtmultimedia
, glew, libzip, snappy, zlib, withGamepads ? true, SDL2 }:
2014-05-27 05:22:24 +02:00
2017-09-27 16:33:00 +02:00
assert withGamepads -> (SDL2 != null);
with stdenv.lib;
2017-09-27 16:33:00 +02:00
stdenv.mkDerivation rec {
2017-10-01 10:33:02 +02:00
name = "ppsspp-${version}";
2017-09-27 16:33:00 +02:00
version = "1.4.2";
2014-05-27 05:22:24 +02:00
2017-09-27 16:33:00 +02:00
src = fetchFromGitHub {
owner = "hrydgard";
repo = "ppsspp";
rev = "v${version}";
2014-05-27 05:22:24 +02:00
fetchSubmodules = true;
2017-09-27 16:33:00 +02:00
sha256 = "0m4qkhx7q496sm7ibg2n7rm3npxzfr93iraxgndk0vhfk8vy8w75";
2014-05-27 05:22:24 +02:00
};
2017-09-27 16:33:00 +02:00
patchPhase = ''
echo 'const char *PPSSPP_GIT_VERSION = "${src.rev}";' >> git-version.cpp
substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
'';
2014-05-27 05:22:24 +02:00
2017-09-27 16:33:00 +02:00
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ qtbase qtmultimedia glew libzip snappy zlib ]
++ optionals withGamepads [ SDL2 SDL2.dev ];
2016-12-17 05:58:57 +01:00
2017-09-27 16:33:00 +02:00
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DUSING_QT_UI=ON" ];
2017-09-27 16:33:00 +02:00
installPhase = ''
mkdir -p $out/bin $out/share/ppsspp
mv PPSSPPQt $out/bin/ppsspp
mv assets $out/share/ppsspp
'';
2014-05-27 05:22:24 +02:00
2017-10-01 10:33:02 +02:00
enableParallelBuilding = true;
meta = {
2017-09-27 16:33:00 +02:00
homepage = https://www.ppsspp.org/;
description = "A PSP emulator for Android, Windows, Mac and Linux, written in C++";
2014-05-27 05:22:24 +02:00
license = licenses.gpl2Plus;
2016-12-17 05:58:57 +01:00
maintainers = with maintainers; [ fuuzetsu AndersonTorres ];
2014-06-07 22:28:56 +02:00
platforms = platforms.linux ++ platforms.darwin ++ platforms.cygwin;
2014-05-27 05:22:24 +02:00
};
}