Merge pull request #296016 from amarshall/blender-usd
blender: enable USD support; openusd: cleanup
This commit is contained in:
commit
127f03b7ad
3 changed files with 132 additions and 98 deletions
|
@ -84,6 +84,7 @@
|
||||||
let
|
let
|
||||||
python3Packages = python310Packages;
|
python3Packages = python310Packages;
|
||||||
python3 = python3Packages.python;
|
python3 = python3Packages.python;
|
||||||
|
pyPkgsOpenusd = python3Packages.openusd.override { withOsl = false; };
|
||||||
|
|
||||||
libdecor' = libdecor.overrideAttrs (old: {
|
libdecor' = libdecor.overrideAttrs (old: {
|
||||||
# Blender uses private APIs, need to patch to expose them
|
# Blender uses private APIs, need to patch to expose them
|
||||||
|
@ -171,6 +172,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
"-DWITH_PYTHON_INSTALL_REQUESTS=OFF"
|
"-DWITH_PYTHON_INSTALL_REQUESTS=OFF"
|
||||||
"-DWITH_SDL=OFF"
|
"-DWITH_SDL=OFF"
|
||||||
"-DWITH_TBB=ON"
|
"-DWITH_TBB=ON"
|
||||||
|
"-DWITH_USD=ON"
|
||||||
|
|
||||||
# Blender supplies its own FindAlembic.cmake (incompatible with the Alembic-supplied config file)
|
# Blender supplies its own FindAlembic.cmake (incompatible with the Alembic-supplied config file)
|
||||||
"-DALEMBIC_INCLUDE_DIR=${lib.getDev alembic}/include"
|
"-DALEMBIC_INCLUDE_DIR=${lib.getDev alembic}/include"
|
||||||
|
@ -237,6 +239,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
(opensubdiv.override { inherit cudaSupport; })
|
(opensubdiv.override { inherit cudaSupport; })
|
||||||
potrace
|
potrace
|
||||||
pugixml
|
pugixml
|
||||||
|
pyPkgsOpenusd
|
||||||
python3
|
python3
|
||||||
tbb
|
tbb
|
||||||
zlib
|
zlib
|
||||||
|
@ -292,6 +295,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
ps.numpy
|
ps.numpy
|
||||||
ps.requests
|
ps.requests
|
||||||
ps.zstandard
|
ps.zstandard
|
||||||
|
pyPkgsOpenusd
|
||||||
];
|
];
|
||||||
|
|
||||||
blenderExecutable =
|
blenderExecutable =
|
||||||
|
|
|
@ -1,35 +1,43 @@
|
||||||
{ buildPythonPackage
|
{
|
||||||
, fetchFromGitHub
|
alembic,
|
||||||
, lib
|
bison,
|
||||||
, writeShellScriptBin
|
boost,
|
||||||
, cmake
|
buildPythonPackage,
|
||||||
, doxygen
|
cmake,
|
||||||
, draco
|
darwin,
|
||||||
, graphviz-nox
|
doxygen,
|
||||||
, ninja
|
draco,
|
||||||
, setuptools
|
embree,
|
||||||
, pyqt6
|
fetchFromGitHub,
|
||||||
, pyopengl
|
flex,
|
||||||
, jinja2
|
git,
|
||||||
, pyside6
|
graphviz-nox,
|
||||||
, boost
|
imath,
|
||||||
, numpy
|
jinja2,
|
||||||
, git
|
lib,
|
||||||
, tbb
|
libGL,
|
||||||
, opensubdiv
|
libX11,
|
||||||
, openimageio
|
ninja,
|
||||||
, opencolorio
|
numpy,
|
||||||
, osl
|
opencolorio,
|
||||||
, ptex
|
openimageio,
|
||||||
, embree
|
opensubdiv,
|
||||||
, alembic
|
osl,
|
||||||
, imath
|
ptex,
|
||||||
, flex
|
pyopengl,
|
||||||
, bison
|
pyqt6,
|
||||||
, qt6
|
pyside6,
|
||||||
, python
|
python,
|
||||||
, darwin
|
qt6,
|
||||||
|
setuptools,
|
||||||
|
tbb,
|
||||||
|
withDocs ? false,
|
||||||
|
withOsl ? true,
|
||||||
|
withTools ? false,
|
||||||
|
withUsdView ? false,
|
||||||
|
writeShellScriptBin,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# Matches the pyside6-uic implementation
|
# Matches the pyside6-uic implementation
|
||||||
# https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside-tools/pyside_tool.py?id=e501cad66146a49c7a259579c7bb94bc93a67a08#n82
|
# https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside-tools/pyside_tool.py?id=e501cad66146a49c7a259579c7bb94bc93a67a08#n82
|
||||||
|
@ -37,9 +45,11 @@ let
|
||||||
exec ${qt6.qtbase}/libexec/uic -g python "$@"
|
exec ${qt6.qtbase}/libexec/uic -g python "$@"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "OpenUSD";
|
pname = "OpenUSD";
|
||||||
version = "23.11";
|
version = "23.11";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "PixarAnimationStudios";
|
owner = "PixarAnimationStudios";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
|
@ -47,85 +57,100 @@ buildPythonPackage rec {
|
||||||
hash = "sha256-5zQrfB14kXs75WbL3s4eyhxELglhLNxU2L2aVXiyVjg=";
|
hash = "sha256-5zQrfB14kXs75WbL3s4eyhxELglhLNxU2L2aVXiyVjg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenv = if python.stdenv.isDarwin then
|
stdenv = if python.stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else python.stdenv;
|
||||||
darwin.apple_sdk_11_0.stdenv
|
|
||||||
else
|
|
||||||
python.stdenv;
|
|
||||||
|
|
||||||
outputs = ["out" "doc"];
|
outputs = [ "out" ] ++ lib.optional withDocs "doc";
|
||||||
|
|
||||||
format = "other";
|
format = "other";
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
|
||||||
setuptools
|
|
||||||
pyqt6
|
|
||||||
pyopengl
|
|
||||||
jinja2
|
|
||||||
pyside6
|
|
||||||
pyside-tools-uic
|
|
||||||
boost
|
|
||||||
numpy
|
|
||||||
];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DPXR_BUILD_EXAMPLES=OFF"
|
|
||||||
"-DPXR_BUILD_TUTORIALS=OFF"
|
|
||||||
"-DPXR_BUILD_USD_TOOLS=ON"
|
|
||||||
"-DPXR_BUILD_IMAGING=ON"
|
|
||||||
"-DPXR_BUILD_USD_IMAGING=ON"
|
|
||||||
"-DPXR_BUILD_USDVIEW=ON"
|
|
||||||
"-DPXR_BUILD_DOCUMENTATION=ON"
|
|
||||||
"-DPXR_BUILD_PYTHON_DOCUMENTATION=ON"
|
|
||||||
"-DPXR_BUILD_EMBREE_PLUGIN=ON"
|
|
||||||
"-DPXR_BUILD_ALEMBIC_PLUGIN=ON"
|
"-DPXR_BUILD_ALEMBIC_PLUGIN=ON"
|
||||||
"-DPXR_BUILD_DRACO_PLUGIN=ON"
|
"-DPXR_BUILD_DRACO_PLUGIN=ON"
|
||||||
|
"-DPXR_BUILD_EMBREE_PLUGIN=ON"
|
||||||
|
"-DPXR_BUILD_EXAMPLES=OFF"
|
||||||
|
"-DPXR_BUILD_IMAGING=ON"
|
||||||
"-DPXR_BUILD_MONOLITHIC=ON" # Seems to be commonly linked to monolithically
|
"-DPXR_BUILD_MONOLITHIC=ON" # Seems to be commonly linked to monolithically
|
||||||
(lib.cmakeBool "PXR_ENABLE_OSL_SUPPORT" (!stdenv.isDarwin))
|
"-DPXR_BUILD_TESTS=OFF"
|
||||||
|
"-DPXR_BUILD_TUTORIALS=OFF"
|
||||||
|
"-DPXR_BUILD_USD_IMAGING=ON"
|
||||||
|
(lib.cmakeBool "PXR_BUILD_DOCUMENTATION" withDocs)
|
||||||
|
(lib.cmakeBool "PXR_BUILD_PYTHON_DOCUMENTATION" withDocs)
|
||||||
|
(lib.cmakeBool "PXR_BUILD_USDVIEW" withUsdView)
|
||||||
|
(lib.cmakeBool "PXR_BUILD_USD_TOOLS" withTools)
|
||||||
|
(lib.cmakeBool "PXR_ENABLE_OSL_SUPPORT" (!stdenv.isDarwin && withOsl))
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs =
|
||||||
cmake
|
[
|
||||||
ninja
|
cmake
|
||||||
git
|
ninja
|
||||||
qt6.wrapQtAppsHook
|
setuptools
|
||||||
doxygen
|
]
|
||||||
graphviz-nox
|
++ lib.optionals withDocs [
|
||||||
|
git
|
||||||
|
graphviz-nox
|
||||||
|
doxygen
|
||||||
|
]
|
||||||
|
++ lib.optionals withUsdView [ qt6.wrapQtAppsHook ];
|
||||||
|
|
||||||
|
buildInputs =
|
||||||
|
[
|
||||||
|
alembic.dev
|
||||||
|
bison
|
||||||
|
boost
|
||||||
|
draco
|
||||||
|
embree
|
||||||
|
flex
|
||||||
|
imath
|
||||||
|
opencolorio
|
||||||
|
openimageio
|
||||||
|
opensubdiv
|
||||||
|
ptex
|
||||||
|
tbb
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.isLinux [
|
||||||
|
libGL
|
||||||
|
libX11
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ Cocoa ])
|
||||||
|
++ lib.optionals withOsl [ osl ]
|
||||||
|
++ lib.optionals withUsdView [ qt6.qtbase ]
|
||||||
|
++ lib.optionals (withUsdView && stdenv.isLinux) [
|
||||||
|
qt6.qtbase
|
||||||
|
qt6.qtwayland
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs =
|
||||||
|
[
|
||||||
|
boost
|
||||||
|
jinja2
|
||||||
|
numpy
|
||||||
|
pyopengl
|
||||||
|
]
|
||||||
|
++ lib.optionals (withTools || withUsdView) [
|
||||||
|
pyside-tools-uic
|
||||||
|
pyside6
|
||||||
|
]
|
||||||
|
++ lib.optionals withUsdView [ pyqt6 ];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
"pxr"
|
||||||
|
"pxr.Usd"
|
||||||
];
|
];
|
||||||
buildInputs = [
|
|
||||||
tbb
|
|
||||||
opensubdiv
|
|
||||||
openimageio
|
|
||||||
opencolorio
|
|
||||||
osl
|
|
||||||
ptex
|
|
||||||
embree
|
|
||||||
alembic.dev
|
|
||||||
imath
|
|
||||||
flex
|
|
||||||
bison
|
|
||||||
boost
|
|
||||||
draco
|
|
||||||
qt6.qtbase
|
|
||||||
]
|
|
||||||
++ lib.optionals stdenv.isLinux [ qt6.qtwayland ]
|
|
||||||
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk_11_0.frameworks; [
|
|
||||||
Cocoa
|
|
||||||
])
|
|
||||||
;
|
|
||||||
|
|
||||||
pythonImportsCheck = [ "pxr" "pxr.Usd" ];
|
postInstall =
|
||||||
|
''
|
||||||
postInstall = ''
|
# Make python lib properly accessible
|
||||||
# Make python lib properly accessible
|
target_dir=$out/${python.sitePackages}
|
||||||
target_dir=$out/${python.sitePackages}
|
mkdir -p $(dirname $target_dir)
|
||||||
mkdir -p $(dirname $target_dir)
|
mv $out/lib/python $target_dir
|
||||||
mv $out/lib/python $target_dir
|
''
|
||||||
|
+ lib.optionalString withDocs ''
|
||||||
mv $out/docs $doc
|
mv $out/docs $doc
|
||||||
|
''
|
||||||
rm $out/share -r # only examples
|
+ ''
|
||||||
rm $out/tests -r
|
rm $out/share -r # only examples
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Universal Scene Description";
|
description = "Universal Scene Description";
|
||||||
|
|
|
@ -2001,6 +2001,11 @@ with pkgs;
|
||||||
|
|
||||||
openbugs = pkgsi686Linux.callPackage ../applications/science/machine-learning/openbugs { };
|
openbugs = pkgsi686Linux.callPackage ../applications/science/machine-learning/openbugs { };
|
||||||
|
|
||||||
|
openusd = python3Packages.openusd.override {
|
||||||
|
withTools = true;
|
||||||
|
withUsdView = true;
|
||||||
|
};
|
||||||
|
|
||||||
osquery = callPackage ../tools/system/osquery { };
|
osquery = callPackage ../tools/system/osquery { };
|
||||||
|
|
||||||
paperview = callPackage ../tools/X11/paperview { };
|
paperview = callPackage ../tools/X11/paperview { };
|
||||||
|
|
Loading…
Reference in a new issue