mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 04:53:27 +00:00
87af66df78
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.
47 lines
1.1 KiB
Nix
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";
|
|
};
|
|
}
|