saunafs: 4.6.0 -> 4.7.0 (#379649)
[NixPkgs.git] / pkgs / development / python-modules / materialx / default.nix
blobe6adc281de8e85375638de6cd880a4cb88022a3d
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   cmake,
7   setuptools,
8   libX11,
9   libXt,
10   libGL,
11   openimageio,
12   imath,
13   python,
14   apple-sdk_14,
17 buildPythonPackage rec {
18   pname = "materialx";
19   version = "1.39.1";
21   src = fetchFromGitHub {
22     owner = "AcademySoftwareFoundation";
23     repo = "MaterialX";
24     tag = "v${version}";
25     hash = "sha256-WzzsY1hOWwJEqT/ZRLIoZDfKNvx1Yf6aFhA3ZcSPx+s=";
26   };
28   format = "other";
30   nativeBuildInputs = [
31     cmake
32     setuptools
33   ];
35   buildInputs =
36     [
37       openimageio
38       imath
39     ]
40     ++ lib.optionals stdenv.hostPlatform.isDarwin [
41       apple-sdk_14
42     ]
43     ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
44       libX11
45       libXt
46       libGL
47     ];
49   cmakeFlags = [
50     (lib.cmakeBool "MATERIALX_BUILD_OIIO" true)
51     (lib.cmakeBool "MATERIALX_BUILD_PYTHON" true)
52     (lib.cmakeBool "MATERIALX_BUILD_GEN_MSL" (
53       stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin
54     ))
55   ];
57   pythonImportsCheck = [ "MaterialX" ];
59   postInstall = ''
60     # Make python lib properly accessible
61     target_dir=$out/${python.sitePackages}
62     mkdir -p $(dirname $target_dir)
63     # required for cmake to find the bindings, when included in other projects
64     ln -s $out/python $target_dir
65   '';
67   meta = {
68     changelog = "https://github.com/AcademySoftwareFoundation/MaterialX/blob/${src.tag}/CHANGELOG.md";
69     description = "Open standard for representing rich material and look-development content in computer graphics";
70     homepage = "https://materialx.org";
71     maintainers = [ lib.maintainers.gador ];
72     platforms = lib.platforms.unix;
73     license = lib.licenses.mpl20;
74   };