2021-11-19 01:19:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, enableNvidiaCgToolkit ? false
|
|
|
|
, withVulkan ? stdenv.isLinux
|
|
|
|
, alsa-lib
|
|
|
|
, AppKit
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ffmpeg
|
|
|
|
, Foundation
|
|
|
|
, freetype
|
|
|
|
, libdrm
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libobjc
|
|
|
|
, libpulseaudio
|
|
|
|
, libv4l
|
|
|
|
, libX11
|
|
|
|
, libXdmcp
|
|
|
|
, libXext
|
2020-03-11 02:54:31 +00:00
|
|
|
, libxkbcommon
|
2021-11-19 01:19:53 +00:00
|
|
|
, libxml2
|
|
|
|
, libXxf86vm
|
|
|
|
, makeWrapper
|
|
|
|
, mesa
|
|
|
|
, nvidia_cg_toolkit
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, SDL2
|
|
|
|
, substituteAll
|
|
|
|
, udev
|
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
|
|
|
, which
|
2016-05-27 00:24:26 +00:00
|
|
|
}:
|
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
with lib;
|
2013-06-26 11:25:09 +00:00
|
|
|
|
2021-11-19 01:19:53 +00:00
|
|
|
let
|
2021-12-06 13:49:07 +00:00
|
|
|
version = "1.9.14";
|
2021-11-19 01:19:53 +00:00
|
|
|
libretroSuperSrc = fetchFromGitHub {
|
|
|
|
owner = "libretro";
|
2021-11-22 03:27:10 +00:00
|
|
|
repo = "libretro-core-info";
|
2021-12-06 13:49:07 +00:00
|
|
|
sha256 = "sha256-C2PiBcN5r9NDxFWFE1pytSGR1zq9E5aVt6QUf5aJ7I0=";
|
|
|
|
rev = "v${version}";
|
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";
|
2021-12-06 13:49:07 +00:00
|
|
|
inherit version;
|
2013-06-26 11:25:09 +00:00
|
|
|
|
2016-05-27 00:24:26 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libretro";
|
|
|
|
repo = "RetroArch";
|
2021-12-06 13:49:07 +00:00
|
|
|
sha256 = "sha256-H2fCA1sM8FZfVnLxBjnKe7RjHJNAn/Antxlos5oFFSY=";
|
2016-05-27 00:24:26 +00:00
|
|
|
rev = "v${version}";
|
2013-06-26 11:25:09 +00:00
|
|
|
};
|
|
|
|
|
2021-11-19 01:19:53 +00:00
|
|
|
patches = [
|
2021-11-20 19:08:36 +00:00
|
|
|
./0001-Disable-menu_show_core_updater.patch
|
|
|
|
./0002-Use-fixed-paths-on-libretro_info_path.patch
|
2021-11-19 01:19:53 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-11-20 19:08:36 +00:00
|
|
|
substituteInPlace "frontend/drivers/platform_unix.c" \
|
2021-11-19 01:19:53 +00:00
|
|
|
--replace "@libretro_directory@" "$out/lib" \
|
2021-11-20 19:08:36 +00:00
|
|
|
--replace "@libretro_info_path@" "$out/share/libretro/info"
|
|
|
|
substituteInPlace "frontend/drivers/platform_darwin.m" \
|
|
|
|
--replace "@libretro_directory@" "$out/lib" \
|
|
|
|
--replace "@libretro_info_path@" "$out/share/libretro/info"
|
2021-11-19 01:19:53 +00:00
|
|
|
'';
|
|
|
|
|
2021-11-20 13:41:46 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ] ++
|
|
|
|
optional stdenv.isLinux wayland ++
|
2021-11-19 01:19:53 +00:00
|
|
|
optional withVulkan makeWrapper;
|
2013-06-26 11:25:09 +00:00
|
|
|
|
2021-11-19 01:19:53 +00:00
|
|
|
buildInputs = [ ffmpeg freetype libxml2 libGLU libGL python3 SDL2 which ] ++
|
|
|
|
optional enableNvidiaCgToolkit nvidia_cg_toolkit ++
|
|
|
|
optional withVulkan vulkan-loader ++
|
|
|
|
optionals stdenv.isDarwin [ libobjc AppKit Foundation ] ++
|
|
|
|
optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
libdrm
|
|
|
|
libpulseaudio
|
|
|
|
libv4l
|
|
|
|
libX11
|
|
|
|
libXdmcp
|
|
|
|
libXext
|
|
|
|
libXxf86vm
|
|
|
|
mesa
|
|
|
|
udev
|
|
|
|
wayland
|
|
|
|
libxkbcommon
|
|
|
|
];
|
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
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
configureFlags = lib.optionals stdenv.isLinux [ "--enable-kms" "--enable-egl" ];
|
2019-11-12 09:31:53 +00:00
|
|
|
|
2018-05-11 01:07:11 +00:00
|
|
|
postInstall = optionalString withVulkan ''
|
2021-11-19 01:19:53 +00:00
|
|
|
mkdir -p $out/share/libretro/info
|
|
|
|
# TODO: ideally each core should have its own core information
|
2021-11-22 03:27:10 +00:00
|
|
|
cp -r ${libretroSuperSrc}/* $out/share/libretro/info
|
2018-03-03 02:09:35 +00:00
|
|
|
wrapProgram $out/bin/retroarch --prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib
|
2016-03-13 23:56:12 +00:00
|
|
|
'';
|
|
|
|
|
2018-03-03 02:09:35 +00:00
|
|
|
preFixup = "rm $out/bin/retroarch-cg2glsl";
|
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
|
|
|
|
2016-05-27 00:24:26 +00:00
|
|
|
meta = {
|
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;
|
2021-11-17 15:09:57 +00:00
|
|
|
maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch thiagokokada ];
|
2021-11-20 13:41:46 +00:00
|
|
|
# FIXME: exits with error on macOS:
|
|
|
|
# No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
|
|
|
|
broken = stdenv.isDarwin;
|
2013-06-26 11:25:09 +00:00
|
|
|
};
|
|
|
|
}
|