4e9b194
# Force out of source build
4e9b194
%undefine __cmake_in_source_build
4e9b194
5fcdd67
%global		upstream_version 3_6_0
0bda181
#%%global       prerelease RC1
6aa1232
6aa1232
Name:           opensubdiv
5fcdd67
Version:        3.6.0
b923fc7
Release:        %autorelease
4e9b194
Summary:        High performance subdivision surface libraries
6aa1232
c188b58
# The entire source is Pixar except:
c188b58
#
c188b58
# MIT:
c188b58
#   - glLoader/khrplatform.h
c188b58
#   - documentation/tipuesearch/
c188b58
License:        Pixar AND MIT
4e9b194
#URL:            http://graphics.pixar.com/%%{name}
4e9b194
Url:		https://github.com/PixarAnimationStudios/OpenSubdiv
0bda181
Source:	        https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v%{upstream_version}%{?prerelease}/%{name}-%{version}%{?prerelease}.tar.gz
6aa1232
4e9b194
# fix linking against libdl (see https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1196)
082d628
Patch:         	%{name}-rpath.patch
6aa1232
729861a
# make doxygen generated files consistent across builds & architectures
729861a
Patch:          opensubdiv-3.5.0-reproducible-docs.patch
729861a
6aa1232
BuildRequires:  cmake
6aa1232
BuildRequires:  gcc-c++
6aa1232
BuildRequires:  graphviz-devel
4e9b194
BuildRequires:  pkgconfig(glew)
4e9b194
BuildRequires:  pkgconfig(glfw3)
082d628
BuildRequires:	pkgconfig(OpenCL)
082d628
BuildRequires:	pkgconfig(Ptex)
6aa1232
BuildRequires:  pkgconfig(python3)
f881919
BuildRequires:  tbb2020.3-devel
6aa1232
BuildRequires:  pkgconfig(zlib)
4e9b194
BuildRequires:	python3dist(pygments)
2bc0d25
# Drop libs subpackage
2bc0d25
Obsoletes:	%{name}-libs < %{version}-%{release}
49dca20
# Doxygen-generated HTML documentation is not suitable for packaging; see
49dca20
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
49dca20
Obsoletes:      %{name}-doc < 3.5.0-10
6aa1232
6aa1232
%description
6aa1232
OpenSubdiv is a set of open source libraries that implement high performance
6aa1232
subdivision surface (subdiv) evaluation on massively parallel CPU and
6aa1232
GPU architectures. 
6aa1232
This codepath is optimized for drawing deforming subdivs with static topology
6aa1232
at interactive framerates.
6aa1232
6aa1232
%package        devel
6aa1232
Summary:        Development files for %{name}
6aa1232
Requires:       %{name}%{?_isa} = %{version}-%{release}
6aa1232
6aa1232
%description    devel
6aa1232
The %{name}-devel package contains libraries and header files for
6aa1232
developing applications that use %{name}.
6aa1232
6aa1232
%prep
0bda181
%autosetup -p1 -n OpenSubdiv-%{upstream_version}%{?prerelease}
6aa1232
4e9b194
# work around linking glitch
4e9b194
# https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1196
4e9b194
sed -i 's|${PLATFORM_GPU_LIBRARIES}|${PLATFORM_GPU_LIBRARIES} ${CMAKE_DL_LIBS}|' opensubdiv/CMakeLists.txt
3d031ab
3d031ab
# https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/#_compilationminification
49dca20
find . -type f -name '*.min.js' -print -delete
3d031ab
49dca20
%build
6aa1232
%cmake \
6aa1232
       -DCMAKE_INSTALL_PREFIX=%{_prefix} \
6aa1232
       -DCMAKE_LIBDIR_BASE=%{_libdir} \
6aa1232
       -DGLEW_LOCATION=%{_libdir} \
6aa1232
       -DGLFW_LOCATION=%{_libdir} \
4e9b194
       -DNO_CLEW=1 \
6aa1232
       -DNO_CUDA=1 \
57594f4
       -DNO_DOC=1\
4e9b194
       -DNO_EXAMPLES=1 \
4e9b194
       -DNO_GLFW_X11=1 \
eb94b75
       -DNO_OPENCL=1 \
082d628
       -DNO_METAL=1 \
4e9b194
       -DNO_REGRESSION=1 \
4e9b194
       -DNO_TUTORIALS=1 \
6aa1232
       -DOpenGL_GL_PREFERENCE=GLVND \
4e9b194
       -DTBB_LOCATION=%{_libdir}
4e9b194
%cmake_build
6aa1232
6aa1232
%{?_with_tests:
6aa1232
%check
6aa1232
make test V=1
6aa1232
}
6aa1232
6aa1232
%install
4e9b194
%cmake_install
6aa1232
6aa1232
# Remove static files
6aa1232
find %{buildroot} -name '*.la' -delete
6aa1232
find %{buildroot} -name '*.a' -delete
6aa1232
2bc0d25
%files
6aa1232
%license LICENSE.txt
6aa1232
%doc README.md
6aa1232
%{_libdir}/*.so.%{version}
6aa1232
6aa1232
%files devel
4e9b194
%doc NOTICE.txt README.md
6aa1232
%{_includedir}/*
6aa1232
%{_libdir}/*.so
819b164
%{_libdir}/cmake/OpenSubdiv/
6aa1232
6aa1232
%changelog
b923fc7
%autochangelog