%bcond openimageio 1 %bcond python 1 Name: materialx Version: 1.38.8 Release: %autorelease Summary: Open standard of rich material # All third-party components imported or incorporated are under MIT except the following: # ambientcg CC0-1.0 # catch BSL-1.0 # glfw Zlib # nanogui BSD-4-Clause # openimageio BSD-3-Clause # openshadinglanguage BSD-3-Clause # poly-haven CC0-1.0 # pybind11 BSD-4-Clause License: MIT AND Apache-2.0 AND BSD-4-Clause AND CC0-1.0 AND BSD-3-Clause AND BSL-1.0 URL: https://materialx.org/ Source0: https://github.com/AcademySoftwareFoundation/MaterialX/releases/download/MaterialX-%{version}.tar.gz BuildRequires: chrpath BuildRequires: cmake(pybind11) BuildRequires: dos2unix BuildRequires: gcc-c++ BuildRequires: libasan BuildRequires: libubsan BuildRequires: pkgconfig(gl) %if %{with openimageio} BuildRequires: pkgconfig(OpenImageIO) %endif BuildRequires: pkgconfig(oslcomp) %if %{with python} BuildRequires: pkgconfig(python3) >= 3.7 BuildRequires: pkgconfig(pybind11) #BuildRequires: python3dist(setuptools) %endif BuildRequires: pkgconfig(xt) %description MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderings. %package devel Summary: Development files for %{name} License: Apache-2.0 Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package -n python3-%{name} Summary: %{summary} License: Apache-2.0 Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python3-%{name} %{description} %package tools Summary: Tools for handling MaterialX License: Apache-2.0 Requires: python3-%{name}%{?_isa} = %{version}-%{release} %description tools Tools for handling MaterialX %prep %autosetup -n MaterialX-%{version} # Fix path sed -i 's|CMAKE_INSTALL_PREFIX|CMAKE_BINARY_DIR|g' python/CMakeLists.txt sed -i 's|"DESTINATION ."|"DESTINATION %{_datadir}/%{name}"|g' CMakeLists.txt #sed -i 's|"resources"|%%{_datadir}/%%{name}/resources|g' resources/CMakeLists.txt # Fix all Python shebangs recursively in . %py3_shebang_fix . dos2unix python/Scripts/* %build %cmake \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_SKIP_RPATH=ON \ %if %{with python} -DMATERIALX_BUILD_PYTHON=ON \ %endif -DMATERIALX_BUILD_TESTS=OFF \ -DMATERIALX_BUILD_SHARED_LIBS=ON \ %if %{with openimageio} -DMATERIALX_BUILD_OIIO=%{oiio}} \ %endif -DMATERIALX_COVERAGE_ANALYSIS=ON \ -DMATERIALX_DYNAMIC_ANALYSIS=ON \ -DMATERIALX_INSTALL_INCLUDE_PATH=%{_includedir} \ -DMATERIALX_INSTALL_LIB_PATH=%{_libdir} \ -DMATERIALX_INSTALL_STDLIB_PATH=%{_datadir}/%{name} %cmake_build %install %cmake_install # Relocate resources folder cp -pr %{buildroot}%{_prefix}/resources %{buildroot}%{_datadir}/%{name}/ rm -rf %{buildroot}%{_prefix}/resources # Fix location of licenses mkdir -p %{buildroot}%{_datadir}/{doc,licenses}/%{name}/ mv %{buildroot}%{_prefix}/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/ # Relocate changelog, licenses and remove executable permission chmod -x %{buildroot}%{_prefix}/*.md mv %{buildroot}%{_prefix}/{CHANGELOG,README}.md %{buildroot}%{_docdir}/%{name}/ mv %{buildroot}%{_prefix}/THIRD-PARTY.md %{buildroot}%{_datadir}/licenses/%{name}/ %if %{with python} # Fix python path mkdir -p %{buildroot}%{_bindir} chmod +x %{buildroot}%{_prefix}/python/Scripts/*.py cp %{buildroot}%{_prefix}/python/Scripts/*.py %{buildroot}%{_bindir}/ rm -r %{buildroot}%{_prefix}/python/Scripts mkdir -p %{buildroot}%{python3_sitearch} # Remove duplicare data share path rm -rf %{buildroot}%{_prefix}/python/MaterialX/%{_prefix} mv %{buildroot}%{_prefix}/python/MaterialX %{buildroot}%{python3_sitearch} %endif %files %license LICENSE THIRD-PARTY.md %doc CHANGELOG.md README.md SECURITY.md %{_datadir}/%{name} %{_libdir}/libMaterialXCore.so.{1,%{version}} %{_libdir}/libMaterialXFormat.so.{1,%{version}} %{_libdir}/libMaterialXGen{,Glsl,Mdl,Msl,Osl,Shader}.so.{1,%{version}} %{_libdir}/libMaterialXRender{,Glsl,Hw,Osl}.so.{1,%{version}} %files devel %doc README.md %{_includedir}/MaterialX{Core,Format}/ %{_includedir}/MaterialXGen{Glsl,Mdl,Msl,Osl,Shader}/ %{_includedir}/MaterialXRender{,Glsl,Hw,Osl} %{_libdir}/cmake/MaterialX/ %{_libdir}/libMaterialXCore.so %{_libdir}/libMaterialXFormat.so %{_libdir}/libMaterialXGen{,Glsl,Mdl,Msl,Osl,Shader}.so %{_libdir}/libMaterialXRender{,Glsl,Hw,Osl}.so %if %{with python} %files -n python3-%{name} %{python3_sitearch}/{%{name},MaterialX} %files tools %{_bindir}/baketextures.py %{_bindir}/{generate,translate}shader.py %{_bindir}/genmdl.py %{_bindir}/mxdoc.py %{_bindir}/mx{format,validate}.py %{_bindir}/writenodegraphs.py %endif %changelog %autochangelog