%global forgeurl https://github.com/dreamworksanimation %global cmodver 1.0.0.5 %bcond tests 1 Name: moonshine_usd Version: 13.36.0.0 Release: %autorelease Summary: Usd-specific Moonray shaders License: Apache-2.0 URL: https://openmoonray.org/ Source0: %{forgeurl}/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz Source1: %{forgeurl}/cmake_modules/archive/refs/tags/cmake_modules-%{cmodver}.tar.gz Patch0: %{name}-usd-monolithic.patch BuildRequires: cmake >= 3.23.1 BuildRequires: gcc-c++ BuildRequires: cppunit-devel BuildRequires: ispc Requires: usd BuildRequires: usd-devel # Needed by USD BuildRequires: tbb-devel BuildRequires: cmake(Alembic) BuildRequires: hdf5-devel BuildRequires: draco-devel BuildRequires: openshadinglanguage BuildRequires: pkgconfig(oslexec) BuildRequires: cmake(OpenImageIO) BuildRequires: libX11-devel BuildRequires: libglvnd-devel BuildRequires: opensubdiv-devel BuildRequires: openvdb-devel BuildRequires: pkgconfig(ptex) BuildRequires: cmake(OpenColorIO) BuildRequires: embree-devel BuildRequires: double-conversion-devel BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(libavif) BuildRequires: cmake(Moonshine) = 13.36.0.0 Requires: Moonshine = 13.36.0.0 Provides: MoonshineUsd = %{version} %description Usd-specific Moonray shaders %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: cmake(Moonshine) = 13.36.0.0 %description devel The %{name}-devel package contains libraries and header files of %{name}, required to build other parts of OpenMoonRay. %prep %autosetup -p1 -n %{name}-%{name}-%{version} mkdir -p cmake_modules tar -xzf %{SOURCE1} --strip-components=1 -C $_ # Include minor releases sed -i "14s|'[^']*'|'%{version}'|" \ package.py # Restructure sed -i 's|\bcoredata\b|%{_libdir}/openmoonray/coredata|g' \ cmake_modules/cmake/MoonrayDso.cmake sed -i 's|rdl2dso)|%{_libdir}/openmoonray/rdl2dso)|g' \ CMakeLists.txt %build ARRAS_SESSION_PATH=%{_libdir}/openmoonray/sessions \ %cmake \ -DCMAKE_MODULE_PATH=%{_builddir}/%{buildsubdir}/cmake_modules/cmake \ -DBUILD_TESTING=%{expr:%{with tests}?"ON":"OFF"} \ -DMOONRAY_USE_OPTIX=OFF \ -DCMAKE_POLICY_DEFAULT_CMP0012=NEW %cmake_build %install %cmake_install # List shaders. It will be used to remove the generated json files on post-uninstall scriptlet. ls %{buildroot}%{_libdir}/openmoonray/rdl2dso \ | grep -v '\.proxy$' \ | sed 's/\.[^.]*$/.json/' \ > %{buildroot}%{_libdir}/openmoonray/%{name}_shaders.txt %post # Build shader class descriptions RDL2_DSO_PATH=%{_libdir}/openmoonray/rdl2dso \ %{_bindir}/rdl2_json_exporter --rdl2_version "14.22.0.0" --moonray_version "16.36.0.0" --out %{_libdir}/openmoonray/shader_json/ --sparse %preun cd %{_libdir}/openmoonray/shader_json xargs rm < %{_libdir}/openmoonray/%{name}_shaders.txt find %{_libdir}/openmoonray -maxdepth 0 -type d -empty -exec rmdir {} \; %files %license LICENSE %{_libdir}/libgeometry_usd.so %{_libdir}/openmoonray/{rdl2dso,coredata} %{_libdir}/openmoonray/%{name}_shaders.txt %files devel %{_includedir}/%{name} %{_libdir}/cmake/MoonshineUsd-%{version} %changelog %autochangelog