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