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

46 lines
1.3 KiB
Nix
Raw Normal View History

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