nixpkgs/pkgs/applications/emulators/retroarch/wrapper.nix
Thiago Kenji Okada 87af66df78 retroarch: drop all Darwin related code
Darwin support in retroarch was broken for a long time, and it is
getting worse with each subsequent update. Upstream abandoned
`./configure` usage in macOS systems too for a Xcode build system.

So if we want to get back decent support for retroarch in Darwin, we
should migrate it to use Xcode. For now, let's just remove all this code
that is not working.
2022-10-28 21:31:39 +01:00

47 lines
1.1 KiB
Nix

{ lib
, stdenv
, makeWrapper
, retroarch
, symlinkJoin
, cores ? [ ]
}:
let
coresPath = lib.lists.unique (map (c: c.libretroCore) cores);
wrapperArgs = lib.strings.escapeShellArgs
(lib.lists.flatten
(map (corePath: [ "--add-flags" "-L ${placeholder "out" + corePath}" ]) coresPath));
in
symlinkJoin {
name = "retroarch-with-cores-${lib.getVersion retroarch}";
paths = [ retroarch ] ++ cores;
nativeBuildInputs = [ makeWrapper ];
passthru = {
inherit cores;
unwrapped = retroarch;
};
postBuild = ''
# remove core specific binaries
find $out/bin -name 'retroarch-*' -delete
# wrapProgram can't operate on symlinks
rm $out/bin/retroarch
makeWrapper ${retroarch}/bin/retroarch $out/bin/retroarch \
${wrapperArgs}
'';
meta = with retroarch.meta; {
inherit changelog description homepage license maintainers platforms;
longDescription = ''
RetroArch is the reference frontend for the libretro API.
''
+ lib.optionalString (cores != [ ]) ''
The following cores are included: ${lib.concatStringsSep ", " (map (x: x.core) cores)}
'';
mainProgram = "retroarch";
};
}