ppsspp: add SDL and headless
Change the default ppsspp package to SDL frontend, as it supports vulkan, and is allowed to build the headless binary together.
This commit is contained in:
parent
fae0b890bc
commit
a3cdf49dbf
|
@ -3,76 +3,119 @@
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, SDL2
|
, SDL2
|
||||||
, cmake
|
, cmake
|
||||||
|
, copyDesktopItems
|
||||||
, ffmpeg
|
, ffmpeg
|
||||||
, glew
|
, glew
|
||||||
|
, libffi
|
||||||
, libzip
|
, libzip
|
||||||
|
, makeDesktopItem
|
||||||
|
, makeWrapper
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, python3
|
, python3
|
||||||
, qtbase
|
, qtbase ? null
|
||||||
, qtmultimedia
|
, qtmultimedia ? null
|
||||||
, snappy
|
, snappy
|
||||||
, wrapQtAppsHook
|
, vulkan-loader
|
||||||
|
, wayland
|
||||||
|
, wrapQtAppsHook ? null
|
||||||
, zlib
|
, zlib
|
||||||
|
, enableVulkan ? true
|
||||||
|
, forceWayland ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
let
|
||||||
pname = "ppsspp";
|
enableQt = (qtbase != null);
|
||||||
version = "1.13.1";
|
frontend = if enableQt then "Qt" else "SDL and headless";
|
||||||
|
vulkanPath = lib.makeLibraryPath [ vulkan-loader ];
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
# experimental, see https://github.com/hrydgard/ppsspp/issues/13845
|
||||||
owner = "hrydgard";
|
vulkanWayland = enableVulkan && forceWayland;
|
||||||
repo = "ppsspp";
|
in
|
||||||
rev = "v${finalAttrs.version}";
|
# Only SDL front end needs to specify whether to use Wayland
|
||||||
fetchSubmodules = true;
|
assert forceWayland -> !enableQt;
|
||||||
sha256 = "sha256-WsFy2aSOmkII2Lte5et4W6qj0AXUKWWkYe88T0OQP08=";
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
};
|
pname = "ppsspp"
|
||||||
|
+ lib.optionalString enableQt "-qt"
|
||||||
|
+ lib.optionalString (!enableQt) "-sdl"
|
||||||
|
+ lib.optionalString forceWayland "-wayland";
|
||||||
|
version = "1.13.1";
|
||||||
|
|
||||||
postPatch = ''
|
src = fetchFromGitHub {
|
||||||
substituteInPlace git-version.cmake --replace unknown ${finalAttrs.src.rev}
|
owner = "hrydgard";
|
||||||
substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
|
repo = "ppsspp";
|
||||||
'';
|
rev = "v${finalAttrs.version}";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
sha256 = "sha256-WsFy2aSOmkII2Lte5et4W6qj0AXUKWWkYe88T0OQP08=";
|
||||||
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
postPatch = ''
|
||||||
cmake
|
substituteInPlace git-version.cmake --replace unknown ${finalAttrs.src.rev}
|
||||||
pkg-config
|
substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
|
||||||
python3
|
'';
|
||||||
wrapQtAppsHook
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
nativeBuildInputs = [
|
||||||
SDL2
|
cmake
|
||||||
ffmpeg
|
copyDesktopItems
|
||||||
glew
|
makeWrapper
|
||||||
libzip
|
pkg-config
|
||||||
qtbase
|
python3
|
||||||
qtmultimedia
|
wrapQtAppsHook
|
||||||
snappy
|
];
|
||||||
zlib
|
|
||||||
];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
buildInputs = [
|
||||||
"-DHEADLESS=OFF"
|
SDL2
|
||||||
"-DOpenGL_GL_PREFERENCE=GLVND"
|
ffmpeg
|
||||||
"-DUSE_SYSTEM_FFMPEG=ON"
|
(glew.override { enableEGL = forceWayland; })
|
||||||
"-DUSE_SYSTEM_LIBZIP=ON"
|
libzip
|
||||||
"-DUSE_SYSTEM_SNAPPY=ON"
|
qtbase
|
||||||
"-DUSING_QT_UI=ON"
|
qtmultimedia
|
||||||
];
|
snappy
|
||||||
|
zlib
|
||||||
|
] ++ lib.optional enableVulkan vulkan-loader
|
||||||
|
++ lib.optionals vulkanWayland [ wayland libffi ];
|
||||||
|
|
||||||
installPhase = ''
|
cmakeFlags = [
|
||||||
runHook preInstall
|
"-DHEADLESS=${if enableQt then "OFF" else "ON"}"
|
||||||
mkdir -p $out/share/ppsspp
|
"-DOpenGL_GL_PREFERENCE=GLVND"
|
||||||
install -Dm555 PPSSPPQt $out/bin/ppsspp
|
"-DUSE_SYSTEM_FFMPEG=ON"
|
||||||
mv assets $out/share/ppsspp
|
"-DUSE_SYSTEM_LIBZIP=ON"
|
||||||
runHook postInstall
|
"-DUSE_SYSTEM_SNAPPY=ON"
|
||||||
'';
|
"-DUSE_WAYLAND_WSI=${if vulkanWayland then "ON" else "OFF"}"
|
||||||
|
"-DUSING_QT_UI=${if enableQt then "ON" else "OFF"}"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
desktopItems = [(makeDesktopItem {
|
||||||
homepage = "https://www.ppsspp.org/";
|
desktopName = "PPSSPP";
|
||||||
description = "A HLE Playstation Portable emulator, written in C++";
|
name = "ppsspp";
|
||||||
license = licenses.gpl2Plus;
|
exec = "ppsspp";
|
||||||
maintainers = with maintainers; [ AndersonTorres ];
|
icon = "ppsspp";
|
||||||
platforms = platforms.linux;
|
comment = "Play PSP games on your computer";
|
||||||
};
|
categories = [ "Game" "Emulator" ];
|
||||||
})
|
})];
|
||||||
# TODO: add SDL headless port
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out/share/{applications,ppsspp}
|
||||||
|
'' + (if enableQt then ''
|
||||||
|
install -Dm555 PPSSPPQt $out/bin/ppsspp
|
||||||
|
wrapProgram $out/bin/ppsspp \
|
||||||
|
'' else ''
|
||||||
|
install -Dm555 PPSSPPHeadless $out/bin/ppsspp-headless
|
||||||
|
install -Dm555 PPSSPPSDL $out/share/ppsspp/
|
||||||
|
makeWrapper $out/share/ppsspp/PPSSPPSDL $out/bin/ppsspp \
|
||||||
|
--set SDL_VIDEODRIVER ${if forceWayland then "wayland" else "x11"} \
|
||||||
|
'') + lib.optionalString enableVulkan ''
|
||||||
|
--prefix LD_LIBRARY_PATH : ${vulkanPath} \
|
||||||
|
'' + "\n" + ''
|
||||||
|
mv assets $out/share/ppsspp
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://www.ppsspp.org/";
|
||||||
|
description = "A HLE Playstation Portable emulator, written in C++ (${frontend})";
|
||||||
|
license = licenses.gpl2Plus;
|
||||||
|
maintainers = with maintainers; [ AndersonTorres ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
|
@ -1493,8 +1493,18 @@ with pkgs;
|
||||||
|
|
||||||
pcsxr = callPackage ../applications/emulators/pcsxr { };
|
pcsxr = callPackage ../applications/emulators/pcsxr { };
|
||||||
|
|
||||||
ppsspp = callPackage ../applications/emulators/ppsspp {
|
ppsspp = callPackage ../applications/emulators/ppsspp { };
|
||||||
|
|
||||||
|
ppsspp-sdl = ppsspp;
|
||||||
|
|
||||||
|
ppsspp-sdl-wayland = ppsspp.override {
|
||||||
|
forceWayland = true;
|
||||||
|
enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/13845
|
||||||
|
};
|
||||||
|
|
||||||
|
ppsspp-qt = ppsspp.override {
|
||||||
inherit (libsForQt5) qtbase qtmultimedia wrapQtAppsHook;
|
inherit (libsForQt5) qtbase qtmultimedia wrapQtAppsHook;
|
||||||
|
enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/11628
|
||||||
};
|
};
|
||||||
|
|
||||||
proton-caller = callPackage ../applications/emulators/proton-caller { };
|
proton-caller = callPackage ../applications/emulators/proton-caller { };
|
||||||
|
|
Loading…
Reference in a new issue