2021-11-19 01:19:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-10-01 11:24:46 +00:00
|
|
|
, nixosTests
|
2021-11-19 01:19:53 +00:00
|
|
|
, enableNvidiaCgToolkit ? false
|
2022-12-18 22:12:48 +00:00
|
|
|
, withAssets ? false
|
|
|
|
, withCoreInfo ? false
|
2022-01-21 21:26:24 +00:00
|
|
|
, withGamemode ? stdenv.isLinux
|
2021-11-19 01:19:53 +00:00
|
|
|
, withVulkan ? stdenv.isLinux
|
2022-10-18 16:54:52 +00:00
|
|
|
, withWayland ? stdenv.isLinux
|
2021-11-19 01:19:53 +00:00
|
|
|
, alsa-lib
|
2022-08-06 11:04:55 +00:00
|
|
|
, dbus
|
2021-11-19 01:19:53 +00:00
|
|
|
, fetchFromGitHub
|
2022-12-23 21:46:49 +00:00
|
|
|
, fetchpatch
|
2022-02-05 21:28:01 +00:00
|
|
|
, ffmpeg_4
|
2022-10-28 11:45:00 +00:00
|
|
|
, flac
|
2021-11-19 01:19:53 +00:00
|
|
|
, freetype
|
2022-01-21 21:26:24 +00:00
|
|
|
, gamemode
|
2021-11-19 01:19:53 +00:00
|
|
|
, libdrm
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libpulseaudio
|
2022-10-28 22:52:09 +00:00
|
|
|
, libretro-core-info
|
2021-11-19 01:19:53 +00:00
|
|
|
, libv4l
|
|
|
|
, libX11
|
|
|
|
, libXdmcp
|
|
|
|
, libXext
|
2020-03-11 02:54:31 +00:00
|
|
|
, libxkbcommon
|
2021-11-19 01:19:53 +00:00
|
|
|
, libxml2
|
|
|
|
, libXxf86vm
|
|
|
|
, makeWrapper
|
2022-12-22 12:53:04 +00:00
|
|
|
, mbedtls_2
|
2021-11-19 01:19:53 +00:00
|
|
|
, mesa
|
|
|
|
, nvidia_cg_toolkit
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2023-01-08 00:48:23 +00:00
|
|
|
, qtbase
|
2022-12-18 22:12:48 +00:00
|
|
|
, retroarch-assets
|
2021-11-19 01:19:53 +00:00
|
|
|
, SDL2
|
2023-01-08 00:48:23 +00:00
|
|
|
, spirv-tools
|
2022-10-28 22:52:09 +00:00
|
|
|
, substituteAll
|
2021-11-19 01:19:53 +00:00
|
|
|
, udev
|
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
2023-01-08 00:48:23 +00:00
|
|
|
, wrapQtAppsHook
|
2022-10-28 11:45:00 +00:00
|
|
|
, zlib
|
2016-05-27 00:24:26 +00:00
|
|
|
}:
|
|
|
|
|
2021-11-19 01:19:53 +00:00
|
|
|
let
|
2022-10-18 16:54:52 +00:00
|
|
|
runtimeLibs =
|
|
|
|
lib.optional withVulkan vulkan-loader ++
|
|
|
|
lib.optional withGamemode (lib.getLib gamemode);
|
2021-11-19 01:19:53 +00:00
|
|
|
in
|
2020-03-22 03:36:54 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "retroarch-bare";
|
2022-12-14 10:55:37 +00:00
|
|
|
version = "1.14.0";
|
2013-06-26 11:25:09 +00:00
|
|
|
|
2016-05-27 00:24:26 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libretro";
|
|
|
|
repo = "RetroArch";
|
2022-12-14 10:55:37 +00:00
|
|
|
hash = "sha256-oEENGehbzjJq1kTiz6gkXHMMe/rXjWPxxMoe4RqdqK4=";
|
2016-05-27 00:24:26 +00:00
|
|
|
rev = "v${version}";
|
2013-06-26 11:25:09 +00:00
|
|
|
};
|
|
|
|
|
2022-12-23 21:46:49 +00:00
|
|
|
patches = [
|
|
|
|
./use-default-values-for-libretro_info_path-assets_directory.patch
|
|
|
|
# TODO: remove those two patches in the next RetroArch release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/libretro/RetroArch/commit/894c44c5ea7f1eada9207be3c29e8d5c0a7a9e1f.patch";
|
|
|
|
hash = "sha256-ThB6jd9pmsipT8zjehz7znK/s0ofHHCJeEYBKur6sO8=";
|
2022-12-18 22:12:48 +00:00
|
|
|
})
|
2022-12-23 21:46:49 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/libretro/RetroArch/commit/c5bfd52159cf97312bb28fc42203c39418d1bbbd.patch";
|
|
|
|
hash = "sha256-rb1maAvCSUgq2VtJ67iqUY+Fz00Fchl8YGG0EPm0+F0=";
|
|
|
|
})
|
|
|
|
];
|
2021-11-19 01:19:53 +00:00
|
|
|
|
2023-01-08 00:48:23 +00:00
|
|
|
nativeBuildInputs = [ pkg-config wrapQtAppsHook ] ++
|
2022-10-18 16:54:52 +00:00
|
|
|
lib.optional withWayland wayland ++
|
2022-01-21 21:26:24 +00:00
|
|
|
lib.optional (runtimeLibs != [ ]) makeWrapper;
|
2013-06-26 11:25:09 +00:00
|
|
|
|
2022-10-18 16:54:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
ffmpeg_4
|
2022-10-28 11:45:00 +00:00
|
|
|
flac
|
2022-10-18 16:54:52 +00:00
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libxml2
|
2022-12-22 12:53:04 +00:00
|
|
|
mbedtls_2
|
2022-10-18 16:54:52 +00:00
|
|
|
python3
|
2023-01-08 00:48:23 +00:00
|
|
|
qtbase
|
2022-10-18 16:54:52 +00:00
|
|
|
SDL2
|
2023-01-08 00:48:23 +00:00
|
|
|
spirv-tools
|
2022-10-28 11:45:00 +00:00
|
|
|
zlib
|
2022-10-18 16:54:52 +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-03-11 02:54:31 +00:00
|
|
|
|
2018-03-03 02:09:35 +00:00
|
|
|
enableParallelBuilding = true;
|
2016-03-13 23:56:12 +00:00
|
|
|
|
2022-10-18 16:54:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-update_cores"
|
2022-10-28 11:45:00 +00:00
|
|
|
"--disable-builtinmbedtls"
|
2022-12-22 12:53:04 +00:00
|
|
|
"--enable-systemmbedtls"
|
2022-10-28 11:45:00 +00:00
|
|
|
"--disable-builtinzlib"
|
|
|
|
"--disable-builtinflac"
|
2022-10-18 16:54:52 +00:00
|
|
|
] ++
|
2022-12-18 22:12:48 +00:00
|
|
|
lib.optionals withAssets [
|
|
|
|
"--disable-update_assets"
|
2022-12-23 21:46:49 +00:00
|
|
|
"--with-assets_dir=${retroarch-assets}/share"
|
|
|
|
] ++
|
|
|
|
lib.optionals withCoreInfo [
|
|
|
|
"--disable-update_core_info"
|
|
|
|
"--with-core_info_dir=${libretro-core-info}/share"
|
2022-12-18 22:12:48 +00:00
|
|
|
] ++
|
2022-10-18 16:54:52 +00:00
|
|
|
lib.optionals stdenv.isLinux [
|
|
|
|
"--enable-dbus"
|
|
|
|
"--enable-egl"
|
|
|
|
"--enable-kms"
|
|
|
|
];
|
2019-11-12 09:31:53 +00:00
|
|
|
|
2022-10-28 22:52:09 +00:00
|
|
|
postInstall = lib.optionalString (runtimeLibs != [ ]) ''
|
2022-01-21 21:26:24 +00:00
|
|
|
wrapProgram $out/bin/retroarch \
|
|
|
|
--prefix LD_LIBRARY_PATH ':' ${lib.makeLibraryPath runtimeLibs}
|
2022-12-23 22:11:18 +00:00
|
|
|
'' +
|
|
|
|
lib.optionalString enableNvidiaCgToolkit ''
|
|
|
|
wrapProgram $out/bin/retroarch-cg2glsl \
|
|
|
|
--prefix PATH ':' ${lib.makeBinPath [ nvidia_cg_toolkit ]}
|
2016-03-13 23:56:12 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-23 22:11:18 +00:00
|
|
|
preFixup = lib.optionalString (!enableNvidiaCgToolkit) ''
|
|
|
|
rm $out/bin/retroarch-cg2glsl
|
|
|
|
rm $out/share/man/man6/retroarch-cg2glsl.6*
|
|
|
|
'';
|
Replaced retroarchBare with retroarchBareMaster, also added a few new libretro cores
retroarchBare was too old for any practical use at this point, so it was removed in favor
of fetching releases from git. RetroArch often recommends checkout out the latest git master
if you are on a desktop platform, so we are conforming with their recommendation. I plan on
bumping the git of retroarch and each core every month, and I plan on adding more libretro
cores in the future.
The libretro cores that were added are nestopia, quicknes, snes9x, and vba-m
planned next are : bsnes-accuracy, bsnes-balanced, bsnes-performance, a few libretro mame ports
Closes #4448
2014-10-10 03:11:54 +00:00
|
|
|
|
2022-10-01 11:24:46 +00:00
|
|
|
passthru.tests = nixosTests.retroarch;
|
|
|
|
|
2022-01-21 21:26:24 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://libretro.com";
|
Replaced retroarchBare with retroarchBareMaster, also added a few new libretro cores
retroarchBare was too old for any practical use at this point, so it was removed in favor
of fetching releases from git. RetroArch often recommends checkout out the latest git master
if you are on a desktop platform, so we are conforming with their recommendation. I plan on
bumping the git of retroarch and each core every month, and I plan on adding more libretro
cores in the future.
The libretro cores that were added are nestopia, quicknes, snes9x, and vba-m
planned next are : bsnes-accuracy, bsnes-balanced, bsnes-performance, a few libretro mame ports
Closes #4448
2014-10-10 03:11:54 +00:00
|
|
|
description = "Multi-platform emulator frontend for libretro cores";
|
2021-11-17 15:09:43 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2021-11-28 17:50:21 +00:00
|
|
|
platforms = platforms.unix;
|
2022-01-22 14:01:48 +00:00
|
|
|
changelog = "https://github.com/libretro/RetroArch/blob/v${version}/CHANGES.md";
|
2022-10-01 13:27:20 +00:00
|
|
|
maintainers = with maintainers; teams.libretro.members ++ [ matthewbauer kolbycrouch ];
|
2022-10-28 12:12:12 +00:00
|
|
|
mainProgram = "retroarch";
|
2022-10-28 20:22:09 +00:00
|
|
|
# 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-09 13:44:40 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2013-06-26 11:25:09 +00:00
|
|
|
};
|
|
|
|
}
|