2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, which, pkg-config, makeWrapper
|
2021-05-20 23:08:51 +00:00
|
|
|
, ffmpeg, libGLU, libGL, freetype, libxml2, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, libobjc, AppKit, Foundation
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, libdrm ? null
|
|
|
|
, libpulseaudio ? null
|
|
|
|
, libv4l ? null
|
|
|
|
, libX11 ? null
|
|
|
|
, libXdmcp ? null
|
|
|
|
, libXext ? null
|
|
|
|
, libXxf86vm ? null
|
|
|
|
, mesa ? null
|
|
|
|
, SDL2 ? null
|
|
|
|
, udev ? null
|
|
|
|
, enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null
|
|
|
|
, withVulkan ? stdenv.isLinux, vulkan-loader ? null
|
|
|
|
, fetchurl
|
|
|
|
, wayland
|
|
|
|
, libxkbcommon
|
|
|
|
}:
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "retroarch-bare";
|
|
|
|
version = "1.8.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libretro";
|
|
|
|
repo = "RetroArch";
|
|
|
|
sha256 = "1pg8j9wvwgrzsv4xdai6i6jgdcc922v0m42rbqxvbghbksrc8la3";
|
|
|
|
rev = "v${version}";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config wayland ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optional withVulkan makeWrapper;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [ ffmpeg freetype libxml2 libGLU libGL python3 SDL2 which ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optional enableNvidiaCgToolkit nvidia_cg_toolkit
|
|
|
|
++ optional withVulkan vulkan-loader
|
|
|
|
++ optionals stdenv.isDarwin [ libobjc AppKit Foundation ]
|
2021-06-28 23:13:55 +00:00
|
|
|
++ optionals stdenv.isLinux [ alsa-lib libdrm libpulseaudio libv4l libX11
|
2020-04-24 23:36:52 +00:00
|
|
|
libXdmcp libXext libXxf86vm mesa udev
|
|
|
|
wayland libxkbcommon ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
configureFlags = lib.optionals stdenv.isLinux [ "--enable-kms" "--enable-egl" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = optionalString withVulkan ''
|
|
|
|
wrapProgram $out/bin/retroarch --prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = "rm $out/bin/retroarch-cg2glsl";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://libretro.com";
|
|
|
|
description = "Multi-platform emulator frontend for libretro cores";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch ];
|
|
|
|
};
|
|
|
|
}
|