mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 02:13:23 +00:00
ca20a96b5f
Update all usage of lib.concatStrings (lib.intersperse ...) to lib.concatStringsSep. This produces the same result as per https://github.com/NixOS/nixpkgs/pull/135843, however it yields a performance benefit on Nix versions that support the builtins.concatStringsSep primop.
38 lines
922 B
Nix
38 lines
922 B
Nix
{ 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
|
|
$(ln -s $coreDir/* $out/lib/.)
|
|
done)
|
|
|
|
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; {
|
|
inherit license homepage platforms maintainers;
|
|
description = description
|
|
+ " (with cores: "
|
|
+ lib.concatStringsSep ", " (map (x: ""+x.name) cores)
|
|
+ ")";
|
|
};
|
|
}
|