Blame opensubdiv.spec

4e9b194
# Force out of source build
4e9b194
%undefine __cmake_in_source_build
4e9b194
819b164
%global		upstream_version 3_5_0
0bda181
#%%global       prerelease RC1
729861a
%global		documentation 1
6aa1232
6aa1232
Name:           opensubdiv
819b164
Version:        3.5.0
b923fc7
Release:        %autorelease
4e9b194
Summary:        High performance subdivision surface libraries
6aa1232
819b164
License:        Apache-2.0
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
57594f4
%if 0%{?documentation}
6aa1232
BuildRequires:  doxygen
57594f4
BuildRequires:	python3dist(docutils)
57594f4
%endif
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)
4e9b194
BuildRequires:  pkgconfig(tbb)
6aa1232
BuildRequires:  pkgconfig(zlib)
4e9b194
BuildRequires:	python3dist(pygments)
2bc0d25
# Drop libs subpackage
2bc0d25
Obsoletes:	%{name}-libs < %{version}-%{release}
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
57594f4
%if 0%{?documentation}
4e9b194
%package doc
4e9b194
Summary:	High performance subdivision surface libraries
4e9b194
BuildArch:	noarch
4e9b194
57594f4
4e9b194
%description doc
4e9b194
OpenSubdiv is a set of open source libraries that implement high
4e9b194
performance subdivision surface (subdiv) evaluation on massively
4e9b194
parallel CPU and GPU architectures. 
4e9b194
This code path is optimized for
4e9b194
drawing deforming surfaces with static topology at interactive
4e9b194
frame rates.
4e9b194
4e9b194
This package includes the documentation of OpenSubdiv.
57594f4
%endif
4e9b194
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
4e9b194
	
6aa1232
%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
%if 0%{?documentation}
57594f4
       -DNO_DOC=0 \
57594f4
%else
57594f4
       -DNO_DOC=1\
57594f4
%endif
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
57594f4
%if 0%{?documentation}
4e9b194
%files doc
819b164
%{_docdir}/%{name}/
57594f4
%endif
4e9b194
6aa1232
%changelog
b923fc7
%autochangelog