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

46 lines
1.3 KiB
Nix
Raw Normal View History

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