ppsspp: 1.4.2 -> 1.9.3

This commit is contained in:
Peter Hoeg 2019-12-19 19:24:02 +08:00 committed by Matthieu Coudron
parent a7a8bf9040
commit a71a2ee654

View File

@ -1,45 +1,69 @@
{ stdenv, mkDerivation, fetchFromGitHub, cmake, pkgconfig, qtbase, qtmultimedia { SDL2
, glew, libzip, snappy, zlib, withGamepads ? true, SDL2 }: , cmake
, fetchFromGitHub
assert withGamepads -> (SDL2 != null); , ffmpeg
with stdenv.lib; , glew
, lib
, libzip
, mkDerivation
, pkgconfig
, python3
, qtbase
, qtmultimedia
, snappy
, zlib
}:
mkDerivation rec { mkDerivation rec {
pname = "ppsspp"; pname = "ppsspp";
version = "1.4.2"; version = "1.9.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "hrydgard"; owner = "hrydgard";
repo = "ppsspp"; repo = "ppsspp";
rev = "v${version}"; rev = "v${version}";
fetchSubmodules = true; fetchSubmodules = true;
sha256 = "0m4qkhx7q496sm7ibg2n7rm3npxzfr93iraxgndk0vhfk8vy8w75"; sha256 = "17sym0vk72lzbh9a1501mhw98c78x1gq7k1fpy69nvvb119j37wa";
}; };
patchPhase = '' postPatch = ''
echo 'const char *PPSSPP_GIT_VERSION = "${src.rev}";' >> git-version.cpp substituteInPlace git-version.cmake \
substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share --replace unknown ${src.rev}
substituteInPlace UI/NativeApp.cpp \
--replace /usr/share $out/share
''; '';
nativeBuildInputs = [ cmake pkgconfig ]; nativeBuildInputs = [ cmake pkgconfig python3 ];
buildInputs = [ qtbase qtmultimedia glew libzip snappy zlib ]
++ optionals withGamepads [ SDL2 SDL2.dev ];
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DUSING_QT_UI=ON" ]; buildInputs = [
SDL2
ffmpeg
glew
libzip
qtbase
qtmultimedia
snappy
zlib
];
cmakeFlags = [
"-DOpenGL_GL_PREFERENCE=GLVND"
"-DUSE_SYSTEM_FFMPEG=ON"
"-DUSE_SYSTEM_LIBZIP=ON"
"-DUSE_SYSTEM_SNAPPY=ON"
"-DUSING_QT_UI=ON"
];
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/share/ppsspp mkdir -p $out/share/ppsspp
mv PPSSPPQt $out/bin/ppsspp install -Dm555 PPSSPPQt $out/bin/ppsspp
mv assets $out/share/ppsspp mv assets $out/share/ppsspp
''; '';
enableParallelBuilding = true; meta = with lib; {
meta = {
homepage = https://www.ppsspp.org/;
description = "A PSP emulator for Android, Windows, Mac and Linux, written in C++"; description = "A PSP emulator for Android, Windows, Mac and Linux, written in C++";
homepage = "https://www.ppsspp.org/";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
maintainers = with maintainers; [ AndersonTorres ]; maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.linux ++ platforms.darwin ++ platforms.cygwin;
}; };
} }