nixpkgs-suyu/pkgs/misc/emulators/retroarch/default.nix

67 lines
2 KiB
Nix
Raw Normal View History

2018-03-03 03:09:35 +01:00
{ stdenv, fetchFromGitHub, which, pkgconfig, makeWrapper
2019-11-10 17:44:34 +01:00
, ffmpeg, libGLU, libGL, freetype, libxml2, python3
2018-03-04 00:09:44 +01:00
, libobjc, AppKit, Foundation
2018-03-03 03:09:35 +01:00
, alsaLib ? null
2019-11-12 10:31:53 +01:00
, libdrm ? null
2018-03-03 03:09:35 +01:00
, libpulseaudio ? null
, libv4l ? null
, libX11 ? null
, libXdmcp ? null
, libXext ? null
, libXxf86vm ? null
2019-11-12 10:31:53 +01:00
, mesa ? null
2018-03-03 03:09:35 +01:00
, SDL2 ? null
, udev ? null
, enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null
2018-03-03 03:09:35 +01:00
, withVulkan ? stdenv.isLinux, vulkan-loader ? null
, fetchurl
, wayland
, libxkbcommon
}:
with stdenv.lib;
2013-06-26 13:25:09 +02:00
stdenv.mkDerivation rec {
pname = "retroarch-bare";
2020-03-22 03:46:36 +01:00
version = "1.8.5";
2013-06-26 13:25:09 +02:00
src = fetchFromGitHub {
owner = "libretro";
repo = "RetroArch";
2020-03-22 03:46:36 +01:00
sha256 = "1pg8j9wvwgrzsv4xdai6i6jgdcc922v0m42rbqxvbghbksrc8la3";
rev = "v${version}";
2013-06-26 13:25:09 +02:00
};
nativeBuildInputs = [ pkgconfig wayland ]
++ optional withVulkan makeWrapper;
2013-06-26 13:25:09 +02:00
2019-11-10 17:44:34 +01:00
buildInputs = [ ffmpeg freetype libxml2 libGLU libGL python3 SDL2 which ]
2018-03-03 03:09:35 +01:00
++ optional enableNvidiaCgToolkit nvidia_cg_toolkit
++ optional withVulkan vulkan-loader
2018-03-04 00:09:44 +01:00
++ optionals stdenv.isDarwin [ libobjc AppKit Foundation ]
2019-11-12 10:31:53 +01:00
++ optionals stdenv.isLinux [ alsaLib libdrm libpulseaudio libv4l libX11
libXdmcp libXext libXxf86vm mesa udev
wayland libxkbcommon ];
# we use prefix-less pkg-config
PKG_CONF_PATH = "pkg-config";
2018-03-03 03:09:35 +01:00
enableParallelBuilding = true;
2020-03-15 06:48:14 +01:00
configureFlags = stdenv.lib.optionals stdenv.isLinux [ "--enable-kms" "--enable-egl" ];
2019-11-12 10:31:53 +01:00
2018-05-11 03:07:11 +02:00
postInstall = optionalString withVulkan ''
2018-03-03 03:09:35 +01:00
wrapProgram $out/bin/retroarch --prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib
'';
2018-03-03 03:09:35 +01:00
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 ];
2013-06-26 13:25:09 +02:00
};
}