2022-01-13 20:06:32 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, blender
|
|
|
|
, makeWrapper
|
2023-05-24 13:37:59 +00:00
|
|
|
, python3Packages
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
|
|
|
{ name ? "wrapped"
|
|
|
|
, packages ? []
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "blender-${name}";
|
|
|
|
inherit (blender) version;
|
|
|
|
src = blender;
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [ python3Packages.wrapPython makeWrapper ];
|
2022-01-13 20:06:32 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out/{share/applications,bin} -p
|
|
|
|
sed 's/Exec=blender/Exec=blender-${name}/g' $src/share/applications/blender.desktop > $out/share/applications/blender-${name}.desktop
|
|
|
|
cp -r $src/share/blender $out/share
|
|
|
|
cp -r $src/share/doc $out/share
|
|
|
|
cp -r $src/share/icons $out/share
|
|
|
|
|
|
|
|
buildPythonPath "$pythonPath"
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
makeWrapper ${blender}/bin/blender $out/bin/blender-${name} \
|
|
|
|
--prefix PATH : $program_PATH \
|
|
|
|
--prefix PYTHONPATH : $program_PYTHONPATH
|
2022-01-13 20:06:32 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonPath = packages;
|
|
|
|
|
|
|
|
meta = blender.meta;
|
|
|
|
}
|