From 3aaebbe74354300c9079bcc0a5cad91798161ce1 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Mon, 29 Apr 2024 22:15:51 +0200 Subject: [PATCH] materialx: init at 1.38.10 Signed-off-by: Florian Brandes Co-authored-by: Alexis Hildebrandt --- pkgs/by-name/ma/materialx/package.nix | 74 +++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 pkgs/by-name/ma/materialx/package.nix diff --git a/pkgs/by-name/ma/materialx/package.nix b/pkgs/by-name/ma/materialx/package.nix new file mode 100644 index 000000000000..551e21abfd61 --- /dev/null +++ b/pkgs/by-name/ma/materialx/package.nix @@ -0,0 +1,74 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + darwin, + libX11, + libXt, + libGL, + openimageio, + imath, + python3Packages, + python3 +}: + +python3Packages.buildPythonPackage rec { + pname = "materialx"; + version = "1.38.10"; + + src = fetchFromGitHub { + owner = "AcademySoftwareFoundation"; + repo = "MaterialX"; + rev = "v${version}"; + sha256 = "sha256-/kMHmW2dptZNtjuhE5s+jvPRIdtY+FRiVtMU+tiBgQo="; + }; + + format = "other"; + + nativeBuildInputs = [ + cmake + python3Packages.setuptools + ]; + + buildInputs = + [ + openimageio + imath + ] + ++ lib.optionals stdenv.isDarwin ( + with darwin.apple_sdk.frameworks; + [ + OpenGL + Cocoa + ] + ) + ++ lib.optionals (!stdenv.isDarwin) [ + libX11 + libXt + libGL + ]; + + cmakeFlags = [ + (lib.cmakeBool "MATERIALX_BUILD_OIIO" true) + (lib.cmakeBool "MATERIALX_BUILD_PYTHON" true) + ]; + + pythonImportsCheck = [ "MaterialX" ]; + + postInstall = '' + # Make python lib properly accessible + target_dir=$out/${python3.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 = { + 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; + }; +}