nixpkgs/pkgs/misc/emulators/retroarch/wrapper.nix

38 lines
937 B
Nix
Raw Normal View History

{ stdenv, lib, makeWrapper, retroarch, cores }:
stdenv.mkDerivation {
pname = "retroarch";
version = lib.getVersion retroarch;
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/lib
$(for coreDir in $cores
do
2018-05-21 22:11:44 +00:00
$(ln -s $coreDir/* $out/lib/.)
done)
ln -s -t $out ${retroarch}/share
2018-05-11 01:07:11 +00:00
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" \
2018-12-13 10:20:31 +00:00
--add-flags "-L $out/lib/" \
'';
cores = map (x: x + x.libretroCore) cores;
preferLocalBuild = true;
meta = with retroarch.meta; {
inherit license homepage platforms maintainers;
description = description
+ " (with cores: "
+ lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) cores))
+ ")";
};
}