# This package produce a libusd_ms.so library used in blender. # Upgrade accordingly to the blender's usd supported version. %define pkgname USD %define usdname usd %define libmajor 0 %define libname %mklibname %{usdname} %{libmajor} %define develname %mklibname -d %{usdname} %define staticdevname %mklibname -d -s %{usdname} %global vpath_builddir _build # actually enabling python compiles correctly but # resulting python binaries seems to not work properly # with provided examples (python3?). To be reviewed. %bcond_with python Name: usd Version: 20.05 Release: %mkrel 6 Summary: 3D VFX pipeline interchange file format Group: Graphics/3D License: ASL 2.0 URL: https://graphics.pixar.com/usd/docs/index.html Source: https://github.com/PixarAnimationStudios/%{pkgname}/archive/v%{version}/%{pkgname}-%{version}.tar.gz # Patch 100.. (from git) Patch100: 0001-hdEmbree-Convert-hdEmbree-to-Embree-3.patch Patch101: 0001-fix-errors-with-PXR_OVERRIDE_PLUGINPATH_NAME-and-tes.patch Patch102: 0001-Set-Boost_NO_BOOST_CMAKE-On.patch Patch103: 0001-Update-path-to-sample-asset-in-README.md.patch Patch104: 0034-usdImagingGL-use-PYTHON_LIBRARIES-instead-of-PYTHON_.patch Patch105: 0142-usdview-Fix-_reopenStage-for-cases-when-launched-wit.patch Patch106: 0009-tf-remove-unneeded-using-namespace-std.patch # Patch 200.. (custom) # fix tbb detecting Patch200: %{pkgname}-%{version}-tbb.patch # see https://developer.blender.org/D6287 # and https://github.com/blender/blender/commit/ec62413f803ee506633f0e52d1e52b0980c0ed0d Patch201: %{pkgname}-%{version}-blender-fix.patch # ajdust libraries installation paths Patch202: %{pkgname}-%{version}-fix-building.patch Patch203: %{pkgname}-%{version}-soversion.patch Patch204: %{pkgname}-%{version}-cmake-gnuinstalldirs.patch Patch205: %{pkgname}-%{version}-libdir.patch Patch206: %{pkgname}-%{version}-pxrconfig-cmake.patch Patch207: %{pkgname}-%{version}-python-dir.patch Patch208: %{pkgname}-%{version}-python-path.patch Patch209: %{pkgname}-%{version}-libdir-plugin.patch BuildRequires: bison BuildRequires: boost BuildRequires: boost-devel BuildRequires: cmake BuildRequires: cmake(Alembic) BuildRequires: flex BuildRequires: gcc-c++ BuildRequires: ninja BuildRequires: embree3-devel BuildRequires: GL-devel BuildRequires: openimageio BuildRequires: opensubdiv-devel >= 3.0 BuildRequires: openshadinglanguage1.10 BuildRequires: openshadinglanguage-devel BuildRequires: openvdb-devel BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(glew) BuildRequires: pkgconfig(glu) BuildRequires: GL-devel %if %{mgaversion} >= 8 BuildRequires: pkgconfig(hdf5) BuildRequires: pkgconfig(OpenImageIO) %else BuildRequires: hdf5-devel BuildRequires: openimageio-devel %endif BuildRequires: pkgconfig(jemalloc) BuildRequires: pkgconfig(OpenEXR) BuildRequires: pkgconfig(OpenColorIO) BuildRequires: pkgconfig(python2) BuildRequires: pkgconfig(tbb) BuildRequires: pkgconfig(xkbcommon-x11) BuildRequires: pkgconfig(xkbfile) BuildRequires: pkgconfig(xcb-icccm) BuildRequires: pkgconfig(xpm) BuildRequires: pkgconfig(xres) BuildRequires: pkgconfig(xscrnsaver) BuildRequires: pkgconfig(xtst) BuildRequires: pkgconfig(xv) BuildRequires: pkgconfig(xxf86misc) BuildRequires: python-jinja2 BuildRequires: pyside2-devel BuildRequires: pyside2-tools BuildRequires: python3-opengl %description Universal Scene Description (USD) is an efficient, scalable system for authoring, reading, and streaming time-sampled scene description for interchange between graphics applications. %package -n %{libname} Summary: 3D VFX pipeline interchange file format libraries Group: System/Libraries %description -n %{libname} This package contains the library needed to run programs dynamically linked with USD. %package -n %{develname} Summary: Headers and development files of the USD library Group: Development/C Requires: %{libname} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} %description -n %{develname} Development files for the USD library. Install this package if you want to compile applications using the USD library. %prep %setup -q -n %{pkgname}-%{version} # from git %patch100 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1 %patch104 -p1 %patch105 -p1 %patch106 -p1 # custom %patch200 -p1 -b .tbb %patch201 -p1 -b .blender %patch202 -p1 -b .fixbuild %patch203 -p1 -b .soversion %patch204 -p1 -b .gnuinstall %patch205 -p1 -b .libdir %patch206 -p1 -b .cmk %patch207 -p1 -b .python %patch208 -p1 -b .pythonpath %patch209 -p1 -b .libplug %build CFLAGS="$(echo %{optflags} | sed -e 's@-Wformat -Werror=format-security@@g')" CXXFLAGS="${CFLAGS} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" # See https://github.com/PixarAnimationStudios/USD/blob/release/BUILDING.md # for building options %cmake \ %if %{mgaversion} >= 8 -G Ninja \ %endif -DPXR_BUILD_IMAGING:BOOL=ON \ -DPXR_BUILD_MONOLITHIC:BOOL=ON \ -DPXR_BUILD_ALEMBIC_PLUGIN:BOOL=ON \ -DPXR_BUILD_OPENCOLORIO_PLUGIN:BOOL=ON \ -DPXR_BUILD_OPENIMAGEIO_PLUGIN:BOOL=ON \ -DPXR_BUILD_EMBREE_PLUGIN:BOOL=ON \ -DEMBREE_INCLUDE_DIR:FILEPATH="%{_includedir}/embree3" \ -DEMBREE_LIBRARY:FILEPATH="%{_libdir}/libembree3.so" \ -DPXR_ENABLE_HDF5_SUPPORT:BOOL=ON \ -DPXR_ENABLE_OPENVDB_SUPPORT:BOOL=OFF \ -DPXR_ENABLE_OSL_SUPPORT:BOOL=ON \ -DPXR_ENABLE_PTEX_SUPPORT:BOOL=OFF \ -DPYTHON_EXECUTABLE:FILEPATH="%{_bindir}/python3" \ -DPXR_USE_PYTHON_3:BOOL=ON \ %if %{with python} -DPXR_ENABLE_PYTHON_SUPPORT:BOOL=ON \ -DPXR_BUILD_USDVIEW:BOOL=ON \ %else -DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF \ -DPXR_BUILD_USDVIEW:BOOL=OFF \ %endif -DPXR_SET_INTERNAL_NAMESPACE=usdBlender \ -DTBB_tbb_LIBRARY=%{_libdir}/libtbb.so \ -DBoost_NO_BOOST_CMAKE:BOOL=ON \ -DCMAKE_DEBUG_POSTFIX:STRING=_d \ -DOpenGL_GL_PREFERENCE=LEGACY \ %if %{mgaversion} >= 8 -DPYSIDEUICBINARY:FILEPATH="%{_bindir}/uic" \ %else -DPYSIDEUICBINARY:FILEPATH="%{_bindir}/pyside2-uic" \ %endif -DPXR_MALLOC_LIBRARY:FILEPATH="%{_libdir}/libjemalloc.so" \ -DPXR_VALIDATE_GENERATED_CODE:BOOL=ON \ -DPXR_HEADLESS_TEST_MODE:BOOL=ON \ -DPXR_BUILD_TESTS:BOOL=OFF \ -DPXR_BUILD_USD_TOOLS:BOOL=ON \ -DPXR_INSTALL_LOCATION:STRING="%{_libdir}/usd_plugin" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \ -DCMAKE_EXE_LINKER_FLAGS:STRING="-pie" \ -DCMAKE_CXX_FLAGS_RELEASE:STRING="${CFLAGS}" \ -DCMAKE_C_FLAGS_RELEASE:STRING="${CXXFLAGS}" %if %{mgaversion} >= 8 %ninja_build all -C %{_vpath_builddir} %else %make_build cd .. %endif %install %if %{mgaversion} >= 8 %ninja_install -C %{_vpath_builddir} %else %make_install -C build %endif # check if %{_prefix}/lib/usd can be moved patching the CMakefiles #mv -f %{buildroot}%{_prefix}/lib/usd %{buildroot}%{_libdir}/ # relocate plugins according to the PXR_INSTALL_LOCATION above #mv -f %{buildroot}%{_prefix}/plugin/* %{buildroot}%{_libdir}/usd_plugin/ %files %doc CHANGELOG.md CONTRIBUTING.md README.md VERSIONS.md %license LICENSE.txt %{_bindir}/* %dir %{_libdir}/usd %dir %{_libdir}/usd_plugin %{_libdir}/usd %{_libdir}/usd_plugin %dir %{_datadir}/usd %{_datadir}/usd/examples %if %{with python} %{_datadir}/usd/tutorials %{python3_sitearch}/pxr/* %endif %files -n %{libname} %{_libdir}/*.so.%{libmajor}{,.*} %files -n %{develname} %{_libdir}/lib*.so %{_includedir}/* %{_libdir}/cmake/pxr/*.cmake %changelog * Fri Sep 18 2020 ghibo 20.05-1.mga8 - initial release.