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
|
2016-05-27 02:24:26 +02:00
|
|
|
, enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null
|
2018-03-03 03:09:35 +01:00
|
|
|
, withVulkan ? stdenv.isLinux, vulkan-loader ? null
|
2018-08-20 20:43:41 +02:00
|
|
|
, fetchurl
|
2016-05-27 02:24:26 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2013-06-26 13:25:09 +02:00
|
|
|
|
2018-05-11 03:07:11 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
# ibtool is closed source so we have to download the blob
|
|
|
|
osx-MainMenu = fetchurl {
|
|
|
|
url = "https://github.com/matthewbauer/RetroArch/raw/b146a9ac6b2b516652a7bf05a9db5a804eab323d/pkg/apple/OSX/en.lproj/MainMenu.nib";
|
|
|
|
sha256 = "13k1l628wy0rp6wxrpwr4g1m9c997d0q8ks50f8zhmh40l5j2sp8";
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "retroarch-bare";
|
2019-11-12 10:31:53 +01:00
|
|
|
version = "1.8.1";
|
2013-06-26 13:25:09 +02:00
|
|
|
|
2016-05-27 02:24:26 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libretro";
|
|
|
|
repo = "RetroArch";
|
2019-11-12 10:31:53 +01:00
|
|
|
sha256 = "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7";
|
2016-05-27 02:24:26 +02:00
|
|
|
rev = "v${version}";
|
2013-06-26 13:25:09 +02:00
|
|
|
};
|
|
|
|
|
2018-03-03 03:09:35 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ]
|
|
|
|
++ 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 ];
|
libretro-cores:
- adding: 4do, desmume, fceumm, mame, mupen64plus, scummvm,
snes9x, stella, picodrive, ppsspp and vba
retroarch:
- added retroarch wrapper for configured cores
- changed attributes, old retroarch is now retroarchBare*
2014-08-26 19:32:35 +02:00
|
|
|
|
2018-03-03 03:09:35 +01:00
|
|
|
enableParallelBuilding = true;
|
2016-03-14 00:56:12 +01:00
|
|
|
|
2019-11-12 10:31:53 +01:00
|
|
|
configureFlags = if stdenv.isLinux then [ "--enable-kms" ] else "";
|
|
|
|
|
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-08-20 20:43:41 +02:00
|
|
|
'' + optionalString stdenv.targetPlatform.isDarwin ''
|
2018-05-11 03:07:11 +02:00
|
|
|
EXECUTABLE_NAME=RetroArch
|
|
|
|
PRODUCT_NAME=RetroArch
|
|
|
|
MACOSX_DEPLOYMENT_TARGET=10.5
|
|
|
|
app=$out/Applications/$PRODUCT_NAME.app
|
|
|
|
|
|
|
|
install -D pkg/apple/OSX/Info.plist $app/Contents/Info.plist
|
|
|
|
echo "APPL????" > $app/Contents/PkgInfo
|
|
|
|
mkdir -p $app/Contents/MacOS
|
|
|
|
ln -s $out/bin/retroarch $app/Contents/MacOS/$EXECUTABLE_NAME
|
|
|
|
|
|
|
|
# Hack to fill in Info.plist template w/o using xcode
|
|
|
|
sed -i -e 's,''${EXECUTABLE_NAME}'",$EXECUTABLE_NAME," \
|
|
|
|
-e 's,''${MACOSX_DEPLOYMENT_TARGET}'",$MACOSX_DEPLOYMENT_TARGET," \
|
|
|
|
-e 's,''${PRODUCT_NAME}'",$PRODUCT_NAME," \
|
|
|
|
-e 's,''${PRODUCT_NAME:rfc1034identifier}'",$PRODUCT_NAME," \
|
|
|
|
$app/Contents/Info.plist
|
|
|
|
|
|
|
|
install -D ${osx-MainMenu} \
|
|
|
|
$app/Contents/Resources/en.lproj/MainMenu.nib
|
|
|
|
install -D pkg/apple/OSX/en.lproj/InfoPlist.strings \
|
|
|
|
$app/Contents/Resources/en.lproj/InfoPlist.strings
|
|
|
|
install -D media/retroarch.icns $app/Contents/Resources/retroarch.icns
|
2016-03-14 00:56:12 +01:00
|
|
|
'';
|
|
|
|
|
2018-03-03 03:09:35 +01: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 05:11:54 +02:00
|
|
|
|
2016-05-27 02:24:26 +02:00
|
|
|
meta = {
|
2018-03-03 03:09:35 +01: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 05:11:54 +02:00
|
|
|
description = "Multi-platform emulator frontend for libretro cores";
|
|
|
|
license = licenses.gpl3;
|
2016-05-27 02:24:26 +02:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ MP2E edwtjo matthewbauer ];
|
2013-06-26 13:25:09 +02:00
|
|
|
};
|
|
|
|
}
|