%global plugdir %{_libdir}/usd/plugin %global fbx 202037 %global sh_commit ccb6c7fec875a1cd5ce5eb1315a9fa7603e0919a %global spz_commit fd4e2a57bd6b7462657d41eebda330eca0f35159 %bcond fbx 1 %bcond gltf 1 %bcond obj 1 %bcond ply 1 %bcond spz 1 %bcond stl 1 %bcond sbsar 0 # Seems to have problems from boost when enabling tests %bcond tests 0 Name: usd-fileformat-plugins Version: 1.1.1 Release: %autorelease Summary: Adobe collection of USD fileformat plugins License: Apache-2.0 URL: https://github.com/adobe/USD-Fileformat-plugins Source0: %{url}/archive/refs/tags/v%{version}.tar.gz Source1: https://damassets.autodesk.net/content/dam/autodesk/www/files/fbx%{fbx}_fbxsdk_gcc_linux.tar.gz # SPZ Deps Source2: https://github.com/google/spherical-harmonics/archive/%{sh_commit}.tar.gz Source3: https://github.com/raymondyfei/spz/archive/%{spz_commit}.tar.gz # Monolithic patch # https://github.com/adobe/USD-Fileformat-plugins/pull/33 Patch: monolithic.patch Patch: gltf.patch BuildRequires: cmake >= 3.16.10 BuildRequires: gcc-c++ BuildRequires: glibc-devel BuildRequires: git Requires: usd BuildRequires: usd-devel BuildRequires: python3-devel BuildRequires: libxml2-devel BuildRequires: gtest-devel BuildRequires: fmt-devel BuildRequires: fast_float-devel BuildRequires: libglvnd-devel %if %{with gltf} BuildRequires: cmake(TinyGLTF) BuildRequires: json-devel BuildRequires: stb_image-devel BuildRequires: stb_image_write-devel %endif %if %{with ply} BuildRequires: happly-devel BuildRequires: eigen3-devel %endif # USD Deps %if 0%{?fedora} > 40 BuildRequires: pkgconfig(tbb) %else BuildRequires: pkgconfig(tbb) = 2020.3 %endif BuildRequires: cmake(Imath) BuildRequires: cmake(OpenImageIO) BuildRequires: cmake(double-conversion) BuildRequires: cmake(Alembic) BuildRequires: hdf5-devel BuildRequires: draco-devel BuildRequires: openshadinglanguage BuildRequires: pkgconfig(oslexec) BuildRequires: libX11-devel BuildRequires: opensubdiv-devel >= 3.6.0 BuildRequires: openvdb-devel BuildRequires: pkgconfig(ptex) BuildRequires: cmake(OpenColorIO) BuildRequires: cmake(OpenImageIO) BuildRequires: embree-devel BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(libavif) Provides: bundled(fbx) = 2020.3.7 Provides: bundled(spherical-harmonics) = 0^20201206gitccb6c7f Provides: bundled(spz) = 0^20241210gitfd4e2a5 %description Adobe collection of USD fileformat plugins. Allows USD to read various 3D fileformats. %prep %autosetup -p1 -n USD-Fileformat-plugins-%{version} sed -i 's|plugin/usd|%{plugdir}|g' \ {fbx,gltf,obj,ply,spz,sbsar,stl}/src/CMakeLists.txt %if %{with fbx} # Unpack FBX SDK tar -xzf %{SOURCE1} mkdir -p fbx-sdk printf "yes\nn\n" | ./fbx%{fbx}_fbxsdk_linux fbx-sdk sed -i 's|mLefttChild|mLeftChild|g' \ fbx-sdk/include/fbxsdk/core/base/fbxredblacktree.h %endif %if %{with spz} # Unpack FBX SDK tar -xzf %{SOURCE2} tar -xzf %{SOURCE3} %endif sed -i '/# Install rules/,$d' cmake/FindEigen3.cmake %build export CPLUS_INCLUDE_PATH=%{_includedir}/python%{__python3_version}:%{_includedir}/eigen3:%{_builddir}/%{buildsubdir}/spherical-harmonics-%{sh_commit}:%{_builddir}/%{buildsubdir}/spz-%{spz_commit}/src/cc %cmake \ -DCMAKE_INSTALL_LIBDIR=lib64 \ -DUSD_FILEFORMATS_ENABLE_CXX11_ABI=ON \ -DUSD_FILEFORMATS_BUILD_TESTS=%{expr:%{with tests}?"ON":"OFF"} \ -DUSD_FILEFORMATS_STANDALONE=ON \ -DUSD_FILEFORMATS_FETCH_DRACO=OFF \ -DUSD_FILEFORMATS_FETCH_FASTFLOAT=OFF \ -DUSD_FILEFORMATS_FETCH_FMT=OFF \ -DUSD_FILEFORMATS_FETCH_GTEST=OFF \ -DUSD_FILEFORMATS_FETCH_HAPPLY=OFF \ -DUSD_FILEFORMATS_FETCH_LIBXML2=OFF \ -DUSD_FILEFORMATS_FETCH_TINYGLTF=OFF \ -DUSD_FILEFORMATS_FETCH_SPHERICAL_HARMONICS=OFF \ -DUSD_FILEFORMATS_FETCH_SPZ=OFF \ \ -DUSD_FILEFORMATS_ENABLE_FBX=%{expr:%{with fbx}?"ON":"OFF"} \ -DUSD_FILEFORMATS_ENABLE_GLTF=%{expr:%{with gltf}?"ON":"OFF"} \ -DUSD_FILEFORMATS_ENABLE_OBJ=%{expr:%{with obj}?"ON":"OFF"} \ -DUSD_FILEFORMATS_ENABLE_PLY=%{expr:%{with ply}?"ON":"OFF"} \ -DUSD_FILEFORMATS_ENABLE_SPZ=%{expr:%{with spz}?"ON":"OFF"} \ -DUSD_FILEFORMATS_ENABLE_STL=%{expr:%{with stl}?"ON":"OFF"} \ -DUSD_FILEFORMATS_ENABLE_SBSAR=%{expr:%{with sbsar}?"ON":"OFF"} \ -DUSD_FILEFORMATS_ENABLE_DRACO=ON \ \ -DFMT_INSTALL=OFF \ -Dpxr_ROOT=%{_prefix} \ -Dfmt_ROOT=%{_prefix} \ %if %{with fbx} -DFBXSDK_ROOT=%{_builddir}/%{buildsubdir}/fbx-sdk \ %endif %if %{with spz} -DSH_INCLUDE_DIR=%{_builddir}/%{buildsubdir}/spherical-harmonics-%{sh_commit} \ -DSPZ_INCLUDE_DIR=%{_builddir}/%{buildsubdir}/spz-%{spz_commit}/src/cc \ %endif -DTinyGLTF_ROOT=%{_prefix} \ -DEIGEN_ROOT=%{_prefix} %cmake_build %install %cmake_install # Already provided by usd rm %{buildroot}%{plugdir}/plugInfo.json %check %ctest --verbose || exit 0 %files %doc README.md %license LICENSE-2.0.txt %{_libdir}/libfileformatUtils.so %if %{with fbx} %{_libdir}/usd/plugin/usdFbx %{_libdir}/usd/plugin/libusdFbx.so %endif %if %{with gltf} %{_libdir}/usd/plugin/usdGltf %{_libdir}/usd/plugin/libusdGltf.so %endif %if %{with obj} %{_libdir}/usd/plugin/usdObj %{_libdir}/usd/plugin/libusdObj.so %endif %if %{with ply} %{_libdir}/usd/plugin/usdPly %{_libdir}/usd/plugin/libusdPly.so %endif %if %{with spz} %{_libdir}/usd/plugin/usdSpz %{_libdir}/usd/plugin/libusdSpz.so %endif %if %{with sbsar} %{_libdir}/usd/plugin/usdSbsar %{_libdir}/usd/plugin/libusdSbsar.so %endif %if %{with stl} %{_libdir}/usd/plugin/usdStl %{_libdir}/usd/plugin/libusdStl.so %endif %changelog %autochangelog