%global plugdir %{_libdir}/usd/plugin %global fbx 202037 %bcond fbx 1 # TODO Make tinygltf package or fetch it manually %bcond gltf 0 %bcond obj 1 # TODO Same as gltf but with happly %bcond ply 0 %bcond sbsar 0 %bcond stl 1 # Seems to have problems when enabling tests %bcond tests 0 Name: usd-fileformat-plugins Version: 1.0.10 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 # Monolithic patch # https://github.com/adobe/USD-Fileformat-plugins/pull/33 Patch: monolithic.patch BuildRequires: cmake >= 3.16.10 BuildRequires: gcc-c++ Requires: usd BuildRequires: usd-devel BuildRequires: python3-devel BuildRequires: libxml2-devel BuildRequires: gtest-devel BuildRequires: fmt-devel BuildRequires: fast_float-devel BuildRequires: tbb # 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) %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,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 %endif %build %cmake \ -DCPLUS_INCLUDE_PATH=%{_includedir}/python%{python3_version} \ -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=%{expr:%{with ply}?"ON":"OFF"} \ -DUSD_FILEFORMATS_FETCH_LIBXML2=OFF \ -DUSD_FILEFORMATS_FETCH_TINYGLTF=%{expr:%{with gltf}?"ON":"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_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=/usr \ -Dfmt_ROOT=/usr \ %if %{with fbx} -DFBXSDK_ROOT=%{_builddir}/%{buildsubdir}/fbx-sdk \ %endif -DTinyGLTF_ROOT=/usr %cmake_build %install %cmake_install # Already provided by usd rm %{buildroot}%{plugdir}/plugInfo.json %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 %{_includedir}/tiny_gltf.h %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 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