1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/pkgs/misc/emulators/retroarch/wrapper.nix
Raymond Gauthier 9be54a523e retroarch: improvements
-  Added missing freedesktop items (`*.desktop` and icon).

    Note that for the moment, only added an `*.svg`
    icon as was the only available. It does not give
    us the best results (at least in xfce). We may decide
    later on to extract the content of the `*.ico` instead
    which is a bit more involved.
2016-03-13 20:05:01 -04:00

40 lines
870 B
Nix

{ stdenv, lib, makeWrapper, retroarch, cores }:
let
p = builtins.parseDrvName retroarch.name;
in
stdenv.mkDerivation {
name = "retroarch-" + p.version;
version = p.version;
buildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/lib
$(for coreDir in $cores
do
$(ln -s $coreDir/*.so $out/lib/.)
done)
ln -s -t $out ${retroarch}/share
makeWrapper ${retroarch}/bin/retroarch $out/bin/retroarch \
--suffix-each LD_LIBRARY_PATH ':' "$cores" \
--add-flags "-L $out/lib/ --menu" \
'';
cores = map (x: x + x.libretroCore) cores;
preferLocalBuild = true;
meta = with retroarch.meta; {
inherit license homepage;
description = description
+ " (with cores: "
+ lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) cores))
+ ")";
};
}