nixpkgs/pkgs/development/python-modules/materialx/default.nix
Florian Brandes 27810f1018
Revert "python3Packages.materialx: 1.38.10 -> 1.39.1"
This reverts commit 993ec32985.
MaterialX has some upstream issues which haven't been quite
worked out, yet[1]. It is therefore reasonable to wait
with an update in nixpkgs. It also breaks downstream packages
like python312Packages.openusd as well as blender[2]

[1]: https://github.com/PixarAnimationStudios/OpenUSD/pull/3159
[2]: https://github.com/NixOS/nixpkgs/pull/326466#issuecomment-2293033805

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
2024-11-03 20:11:01 +01:00

78 lines
1.7 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
cmake,
setuptools,
libX11,
libXt,
libGL,
openimageio,
imath,
python,
darwinMinVersionHook,
apple-sdk_14,
}:
buildPythonPackage rec {
pname = "materialx";
version = "1.38.10";
src = fetchFromGitHub {
owner = "AcademySoftwareFoundation";
repo = "MaterialX";
rev = "v${version}";
hash = "sha256-/kMHmW2dptZNtjuhE5s+jvPRIdtY+FRiVtMU+tiBgQo=";
};
format = "other";
nativeBuildInputs = [
cmake
setuptools
];
buildInputs =
[
openimageio
imath
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_14
(darwinMinVersionHook "10.15")
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libX11
libXt
libGL
];
cmakeFlags = [
(lib.cmakeBool "MATERIALX_BUILD_OIIO" true)
(lib.cmakeBool "MATERIALX_BUILD_PYTHON" true)
(lib.cmakeBool "MATERIALX_BUILD_GEN_MSL" (
stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin
))
];
pythonImportsCheck = [ "MaterialX" ];
postInstall = ''
# Make python lib properly accessible
target_dir=$out/${python.sitePackages}
mkdir -p $(dirname $target_dir)
# required for cmake to find the bindings, when included in other projects
ln -s $out/python $target_dir
'';
meta = {
changelog = "https://github.com/AcademySoftwareFoundation/MaterialX/blob/${src.rev}/CHANGELOG.md";
description = "Open standard for representing rich material and look-development content in computer graphics";
homepage = "https://materialx.org";
maintainers = [ lib.maintainers.gador ];
platforms = lib.platforms.unix;
license = lib.licenses.mpl20;
};
}