2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-10-06 18:32:54 +00:00
|
|
|
, nixosTests
|
2021-12-06 16:07:01 +00:00
|
|
|
, enableNvidiaCgToolkit ? false
|
2022-01-25 03:21:06 +00:00
|
|
|
, withGamemode ? stdenv.isLinux
|
2021-12-06 16:07:01 +00:00
|
|
|
, withVulkan ? stdenv.isLinux
|
2022-10-21 18:38:19 +00:00
|
|
|
, withWayland ? stdenv.isLinux
|
2021-12-06 16:07:01 +00:00
|
|
|
, alsa-lib
|
2022-08-12 12:06:08 +00:00
|
|
|
, dbus
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2022-02-10 20:34:41 +00:00
|
|
|
, ffmpeg_4
|
2022-10-30 15:09:59 +00:00
|
|
|
, flac
|
2021-12-06 16:07:01 +00:00
|
|
|
, freetype
|
2022-01-25 03:21:06 +00:00
|
|
|
, gamemode
|
2024-02-07 01:22:34 +00:00
|
|
|
, gitUpdater
|
2021-12-06 16:07:01 +00:00
|
|
|
, libdrm
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libpulseaudio
|
|
|
|
, libv4l
|
|
|
|
, libX11
|
|
|
|
, libXdmcp
|
|
|
|
, libXext
|
2020-04-24 23:36:52 +00:00
|
|
|
, libxkbcommon
|
2021-12-06 16:07:01 +00:00
|
|
|
, libxml2
|
|
|
|
, libXxf86vm
|
|
|
|
, makeWrapper
|
2022-12-28 21:21:41 +00:00
|
|
|
, mbedtls_2
|
2021-12-06 16:07:01 +00:00
|
|
|
, mesa
|
|
|
|
, nvidia_cg_toolkit
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2023-01-11 07:51:40 +00:00
|
|
|
, qtbase
|
2021-12-06 16:07:01 +00:00
|
|
|
, SDL2
|
2023-01-11 07:51:40 +00:00
|
|
|
, spirv-tools
|
2021-12-06 16:07:01 +00:00
|
|
|
, udev
|
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
2023-01-11 07:51:40 +00:00
|
|
|
, wrapQtAppsHook
|
2022-10-30 15:09:59 +00:00
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
2022-10-21 18:38:19 +00:00
|
|
|
runtimeLibs =
|
|
|
|
lib.optional withVulkan vulkan-loader ++
|
|
|
|
lib.optional withGamemode (lib.getLib gamemode);
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "retroarch-bare";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.19.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libretro";
|
|
|
|
repo = "RetroArch";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-NVe5dhH3w7RL1C7Z736L5fdi/+aO+Ah9Dpa4u4kn0JY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
nativeBuildInputs = [ pkg-config wrapQtAppsHook ] ++
|
2022-10-21 18:38:19 +00:00
|
|
|
lib.optional withWayland wayland ++
|
2022-01-25 03:21:06 +00:00
|
|
|
lib.optional (runtimeLibs != [ ]) makeWrapper;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
buildInputs = [
|
|
|
|
ffmpeg_4
|
2022-10-30 15:09:59 +00:00
|
|
|
flac
|
2022-10-21 18:38:19 +00:00
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libxml2
|
2022-12-28 21:21:41 +00:00
|
|
|
mbedtls_2
|
2022-10-21 18:38:19 +00:00
|
|
|
python3
|
2023-01-11 07:51:40 +00:00
|
|
|
qtbase
|
2022-10-21 18:38:19 +00:00
|
|
|
SDL2
|
2023-01-11 07:51:40 +00:00
|
|
|
spirv-tools
|
2022-10-30 15:09:59 +00:00
|
|
|
zlib
|
2022-10-21 18:38:19 +00:00
|
|
|
] ++
|
|
|
|
lib.optional enableNvidiaCgToolkit nvidia_cg_toolkit ++
|
|
|
|
lib.optional withVulkan vulkan-loader ++
|
|
|
|
lib.optional withWayland wayland ++
|
|
|
|
lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
dbus
|
|
|
|
libX11
|
|
|
|
libXdmcp
|
|
|
|
libXext
|
|
|
|
libXxf86vm
|
|
|
|
libdrm
|
|
|
|
libpulseaudio
|
|
|
|
libv4l
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
|
|
|
udev
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-update_cores"
|
2022-10-30 15:09:59 +00:00
|
|
|
"--disable-builtinmbedtls"
|
2022-12-28 21:21:41 +00:00
|
|
|
"--enable-systemmbedtls"
|
2022-10-30 15:09:59 +00:00
|
|
|
"--disable-builtinzlib"
|
|
|
|
"--disable-builtinflac"
|
2022-12-28 21:21:41 +00:00
|
|
|
"--disable-update_assets"
|
|
|
|
"--disable-update_core_info"
|
|
|
|
] ++
|
2022-10-21 18:38:19 +00:00
|
|
|
lib.optionals stdenv.isLinux [
|
|
|
|
"--enable-dbus"
|
|
|
|
"--enable-egl"
|
|
|
|
"--enable-kms"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
postInstall = lib.optionalString (runtimeLibs != [ ]) ''
|
2022-01-25 03:21:06 +00:00
|
|
|
wrapProgram $out/bin/retroarch \
|
|
|
|
--prefix LD_LIBRARY_PATH ':' ${lib.makeLibraryPath runtimeLibs}
|
2022-12-28 21:21:41 +00:00
|
|
|
'' +
|
|
|
|
lib.optionalString enableNvidiaCgToolkit ''
|
|
|
|
wrapProgram $out/bin/retroarch-cg2glsl \
|
|
|
|
--prefix PATH ':' ${lib.makeBinPath [ nvidia_cg_toolkit ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
preFixup = lib.optionalString (!enableNvidiaCgToolkit) ''
|
|
|
|
rm $out/bin/retroarch-cg2glsl
|
|
|
|
rm $out/share/man/man6/retroarch-cg2glsl.6*
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru = {
|
|
|
|
tests = nixosTests.retroarch;
|
|
|
|
updateScript = gitUpdater {
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
|
|
|
};
|
2022-10-06 18:32:54 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://libretro.com";
|
|
|
|
description = "Multi-platform emulator frontend for libretro cores";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
2022-01-25 03:21:06 +00:00
|
|
|
changelog = "https://github.com/libretro/RetroArch/blob/v${version}/CHANGES.md";
|
2022-10-06 18:32:54 +00:00
|
|
|
maintainers = with maintainers; teams.libretro.members ++ [ matthewbauer kolbycrouch ];
|
2022-10-30 15:09:59 +00:00
|
|
|
mainProgram = "retroarch";
|
|
|
|
# If you want to (re)-add support for macOS, see:
|
|
|
|
# https://docs.libretro.com/development/retroarch/compilation/osx/
|
|
|
|
# and
|
|
|
|
# https://github.com/libretro/RetroArch/blob/71eb74d256cb4dc5b8b43991aec74980547c5069/.gitlab-ci.yml#L330
|
2022-10-21 18:38:19 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|