2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv, lib, makeWrapper, retroarch, cores ? [ ] }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "retroarch";
|
|
|
|
version = lib.getVersion retroarch;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/lib
|
2022-04-15 01:41:22 +00:00
|
|
|
for coreDir in $cores; do
|
2021-12-06 16:07:01 +00:00
|
|
|
ln -s $coreDir/* $out/lib/.
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
ln -s -t $out ${retroarch}/share
|
|
|
|
|
|
|
|
if [ -d ${retroarch}/Applications ]; then
|
|
|
|
ln -s -t $out ${retroarch}/Applications
|
|
|
|
fi
|
|
|
|
|
|
|
|
makeWrapper ${retroarch}/bin/retroarch $out/bin/retroarch \
|
|
|
|
--suffix-each LD_LIBRARY_PATH ':' "$cores" \
|
|
|
|
--add-flags "-L $out/lib/" \
|
|
|
|
'';
|
|
|
|
|
|
|
|
cores = map (x: x + x.libretroCore) cores;
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
meta = with retroarch.meta; {
|
2022-02-21 08:47:16 +00:00
|
|
|
inherit changelog description homepage license maintainers platforms;
|
2022-04-15 01:41:22 +00:00
|
|
|
longDescription = ''
|
|
|
|
RetroArch is the reference frontend for the libretro API.
|
|
|
|
|
|
|
|
The following cores are included:
|
|
|
|
${lib.concatStringsSep "\n" (map (x: " - ${x.name}") cores)}
|
|
|
|
'';
|
2022-10-21 18:38:19 +00:00
|
|
|
# FIXME: exit with error on macOS:
|
2022-04-15 01:41:22 +00:00
|
|
|
# No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
|
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|