mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
fe4c776ae9
Based on #257780, separated since it introduces significant changes. bpycv: update passthru.tests.render blender-with-packages: deprecated it is still backwards compatible, but no longer preferred.
30 lines
854 B
Nix
30 lines
854 B
Nix
{ stdenv
|
|
, lib
|
|
, blender
|
|
, makeWrapper
|
|
, extraModules ? []
|
|
}:
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = blender.pname + "-wrapped";
|
|
src = blender;
|
|
|
|
inherit (blender) version meta;
|
|
|
|
nativeBuildInputs = [ blender.pythonPackages.wrapPython makeWrapper ];
|
|
installPhase = ''
|
|
mkdir $out/{share/applications,bin} -p
|
|
sed 's/Exec=blender/Exec=${finalAttrs.finalPackage.pname}/g' $src/share/applications/blender.desktop > $out/share/applications/${finalAttrs.finalPackage.pname}.desktop
|
|
cp -r $src/share/blender $out/share
|
|
cp -r $src/share/doc $out/share
|
|
cp -r $src/share/icons $out/share
|
|
|
|
buildPythonPath "$pythonPath"
|
|
|
|
makeWrapper ${blender}/bin/blender $out/bin/${finalAttrs.finalPackage.pname} \
|
|
--prefix PATH : $program_PATH \
|
|
--prefix PYTHONPATH : $program_PYTHONPATH
|
|
'';
|
|
|
|
pythonPath = extraModules;
|
|
})
|