2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
alembic,
|
|
|
|
bison,
|
|
|
|
boost,
|
|
|
|
buildPythonPackage,
|
|
|
|
cmake,
|
|
|
|
darwin,
|
|
|
|
doxygen,
|
|
|
|
draco,
|
|
|
|
embree,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
flex,
|
|
|
|
git,
|
|
|
|
graphviz-nox,
|
|
|
|
imath,
|
|
|
|
jinja2,
|
|
|
|
lib,
|
|
|
|
libGL,
|
|
|
|
libX11,
|
|
|
|
ninja,
|
|
|
|
numpy,
|
|
|
|
opencolorio,
|
|
|
|
openimageio,
|
|
|
|
opensubdiv,
|
|
|
|
osl,
|
|
|
|
ptex,
|
|
|
|
pyopengl,
|
|
|
|
pyqt6,
|
|
|
|
pyside6,
|
|
|
|
python,
|
|
|
|
qt6,
|
|
|
|
setuptools,
|
|
|
|
tbb,
|
|
|
|
withDocs ? false,
|
|
|
|
withOsl ? true,
|
|
|
|
withTools ? false,
|
|
|
|
withUsdView ? false,
|
|
|
|
writeShellScriptBin,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
let
|
|
|
|
# Matches the pyside6-uic implementation
|
|
|
|
# https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside-tools/pyside_tool.py?id=e501cad66146a49c7a259579c7bb94bc93a67a08#n82
|
|
|
|
pyside-tools-uic = writeShellScriptBin "pyside6-uic" ''
|
|
|
|
exec ${qt6.qtbase}/libexec/uic -g python "$@"
|
|
|
|
'';
|
|
|
|
in
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "openusd";
|
|
|
|
version = "24.03";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PixarAnimationStudios";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "OpenUSD";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-EYf8GhXhsAx0Wxz9ibDZEV4E5scL3GPiu3Nje7N5C/I=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv = if python.stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else python.stdenv;
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
outputs = [ "out" ] ++ lib.optional withDocs "doc";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "port-to-embree-4.patch";
|
|
|
|
url = "https://github.com/PixarAnimationStudios/OpenUSD/pull/2266/commits/4b6c23d459c602fdac5e0ebc9b7722cbd5475e86.patch";
|
|
|
|
hash = "sha256-yjqdGAVqfEsOX1W/tG6c+GgQLYya5U9xgUe/sNIuDbw=";
|
|
|
|
})
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DPXR_BUILD_ALEMBIC_PLUGIN=ON"
|
|
|
|
"-DPXR_BUILD_DRACO_PLUGIN=ON"
|
2024-04-21 15:54:59 +00:00
|
|
|
"-DPXR_BUILD_EMBREE_PLUGIN=ON"
|
|
|
|
"-DPXR_BUILD_EXAMPLES=OFF"
|
|
|
|
"-DPXR_BUILD_IMAGING=ON"
|
2024-01-02 11:29:13 +00:00
|
|
|
"-DPXR_BUILD_MONOLITHIC=ON" # Seems to be commonly linked to monolithically
|
2024-04-21 15:54:59 +00:00
|
|
|
"-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))
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
[
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
setuptools
|
|
|
|
]
|
|
|
|
++ lib.optionals withDocs [
|
|
|
|
git
|
|
|
|
graphviz-nox
|
|
|
|
doxygen
|
|
|
|
]
|
|
|
|
++ lib.optionals withUsdView [ qt6.wrapQtAppsHook ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
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
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[
|
|
|
|
boost
|
|
|
|
jinja2
|
|
|
|
numpy
|
|
|
|
pyopengl
|
|
|
|
]
|
|
|
|
++ lib.optionals (withTools || withUsdView) [
|
|
|
|
pyside-tools-uic
|
|
|
|
pyside6
|
|
|
|
]
|
|
|
|
++ lib.optionals withUsdView [ pyqt6 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pxr"
|
|
|
|
"pxr.Usd"
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
# Make python lib properly accessible
|
|
|
|
target_dir=$out/${python.sitePackages}
|
|
|
|
mkdir -p $(dirname $target_dir)
|
|
|
|
mv $out/lib/python $target_dir
|
|
|
|
''
|
|
|
|
+ lib.optionalString withDocs ''
|
|
|
|
mv $out/docs $doc
|
|
|
|
'';
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Universal Scene Description";
|
|
|
|
longDescription = ''
|
|
|
|
Universal Scene Description (USD) is an efficient, scalable system
|
|
|
|
for authoring, reading, and streaming time-sampled scene description
|
|
|
|
for interchange between graphics applications.
|
|
|
|
'';
|
|
|
|
homepage = "https://openusd.org/";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ shaddydc ];
|
|
|
|
};
|
|
|
|
}
|