diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..76ceb80 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/opensubdiv-3.4.0.tar.gz diff --git a/opensubdiv-rpath.patch b/opensubdiv-rpath.patch new file mode 100644 index 0000000..3063229 --- /dev/null +++ b/opensubdiv-rpath.patch @@ -0,0 +1,21 @@ +--- OpenSubdiv-3_4_0/CMakeLists.txt.orig 2019-10-20 12:02:15.905162264 +0200 ++++ OpenSubdiv-3_4_0/CMakeLists.txt 2019-10-20 12:27:26.934582395 +0200 +@@ -132,18 +132,6 @@ + endif() + + +-if (NOT CMAKE_COMPILER_IS_ICC) +- # Currently icc has a bug that asserts when linking rpaths containing long +- # sequences of ':' that this command causes. The consequence is that examples +- # built and installed using icc will not have an rpath pointing to the built +- # OSD library which they depend on and will have to set LD_LIBRARY_PATH instead. +- list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") +-endif() +- +-# add the automatically determined parts of the RPATH +-# which point to directories outside the build tree to the install RPATH +-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +- + # ensure that ARC is shown as enabled in the Xcode UI + if(CMAKE_GENERATOR STREQUAL "Xcode") + set (CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES") diff --git a/opensubdiv.spec b/opensubdiv.spec new file mode 100644 index 0000000..5109bf9 --- /dev/null +++ b/opensubdiv.spec @@ -0,0 +1,136 @@ +%global upstream_version 3_4_0 + +Name: opensubdiv +Version: 3.4.0 +Release: 3%{?dist} +Summary: An Open-Source subdivision surface library + +License: ASL 2.0 +URL: http://graphics.pixar.com/%{name} +Source0: https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v%{upstream_version}.tar.gz#/%{name}-%{version}.tar.gz/%{name}-%{version}.tar.gz +Patch0: %{name}-rpath.patch + + +BuildRequires: cmake +BuildRequires: doxygen +BuildRequires: gcc-c++ +BuildRequires: glew-devel +BuildRequires: glfw-devel +BuildRequires: graphviz-devel +BuildRequires: opencl-headers +BuildRequires: pkgconfig(python3) +BuildRequires: pkgconfig(zlib) +BuildRequires: python3-docutils +BuildRequires: tbb-devel + + +%description +OpenSubdiv is a set of open source libraries that implement high performance +subdivision surface (subdiv) evaluation on massively parallel CPU and +GPU architectures. +This codepath is optimized for drawing deforming subdivs with static topology +at interactive framerates. + +%package libs +Summary: Core OpenSubdiv libraries +Requires: %{name}%{?_isa} = %{version}-%{release} +%description libs +%{summary} + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 -n OpenSubdiv-%{upstream_version} + +%build +mkdir cmake-build +pushd cmake-build + +%cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_LIBDIR_BASE=%{_libdir} \ + -DGLEW_LOCATION=%{_libdir} \ + -DGLFW_LOCATION=%{_libdir} \ + -DNO_CUDA=1 \ + -DNO_GLFW_X11=1 // disable X11 dependencies\ + -DNO_PTEX=1 \ + -DOPENCL_INCLUDE_DIRS=%{_includedir} \ + -DOpenGL_GL_PREFERENCE=GLVND \ + -DTBB_LOCATION=%{_libdir} \ + .. +%make_build + +popd + +%{?_with_tests: +%check +pushd cmake-build +make test V=1 +popd +} + +%install +pushd cmake-build +%make_install + +# Let rpmbuild pick up documentation +mv %{buildroot}%{_docdir}/%{name} docs + +# Move tutorials out of subdirectory +mv %{buildroot}%{_bindir}/tutorials/* %{buildroot}%{_bindir}/ +rm -fr %{buildroot}%{_bindir}/tutorials + +# Remove static files +find %{buildroot} -name '*.la' -delete +find %{buildroot} -name '*.a' -delete + +popd + +%files +%{_bindir}/far_perf +%{_bindir}/far_regression +%{_bindir}/hbr_baseline +%{_bindir}/hbr_regression +%{_bindir}/osd_regression +%{_bindir}/stringify + +%files libs +%license LICENSE.txt +%doc README.md +%{_libdir}/*.so.%{version} + +%files devel +%doc NOTICE.txt cmake-build/docs/* +%{_bindir}/farViewer +%{_bindir}/glEvalLimit +%{_bindir}/glFVarViewer +%{_bindir}/glImaging +%{_bindir}/glPaintTest +%{_bindir}/glShareTopology +%{_bindir}/glStencilViewer +%{_bindir}/glViewer +%{_bindir}/far_tutorial* +%{_bindir}/hbr_tutorial* +%{_bindir}/osd_tutorial* +%{_includedir}/* +%{_libdir}/*.so + +%changelog +* Mon Oct 14 2019 Luya Tshimbalanga - 3.4.0-3 +- Remove rpath +- Remove unneeded ldconfig_scriptlets macro +- Improve spec file upon review (rhbz #1762155) + +* Mon Oct 14 2019 Luya Tshimbalanga - 3.4.0-2 +- Adjust maximum line limit on description + +* Mon Oct 14 2019 Luya Tshimbalanga - 3.4.0-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..d77ea87 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (opensubdiv-3.4.0.tar.gz) = b80311aebd74e0c5ce4d185e1baf3626b2a14e9ca113ce7346f06d7506832a7ccdc0e3731c468fa1ebe890099847e808981dfe051bd2ee85fd4dc53c1f10c28c