Add patch to use system netcdf

This commit is contained in:
Orion Poplawski 2013-12-27 16:47:47 -07:00
parent d5d33e8513
commit 62eb30503f
2 changed files with 88 additions and 1 deletions

75
vtk-6.0.0-netcdf.patch Normal file
View File

@ -0,0 +1,75 @@
diff -up VTK/IO/NetCDF/CMakeLists.txt.netcdf VTK/IO/NetCDF/CMakeLists.txt
--- VTK/IO/NetCDF/CMakeLists.txt.netcdf 2013-01-28 14:44:35.000000000 -0700
+++ VTK/IO/NetCDF/CMakeLists.txt 2013-01-28 15:40:00.825176295 -0700
@@ -10,5 +10,5 @@ set(Module_SRCS
vtk_module_library(vtkIONetCDF ${Module_SRCS})
-target_link_libraries(vtkIONetCDF vtkNetCDF_cxx)
+target_link_libraries(vtkIONetCDF netcdf_c++ netcdf)
set_target_properties(vtkIONetCDF PROPERTIES LINK_INTERFACE_LIBRARIES "")
diff -up VTK/IO/ParallelNetCDF/CMakeLists.txt.netcdf VTK/IO/ParallelNetCDF/CMakeLists.txt
--- VTK/IO/ParallelNetCDF/CMakeLists.txt.netcdf 2013-01-28 14:44:35.000000000 -0700
+++ VTK/IO/ParallelNetCDF/CMakeLists.txt 2013-01-28 15:40:00.825176295 -0700
@@ -8,4 +8,4 @@ set(Module_SRCS
vtk_module_library(vtkIOParallelNetCDF ${Module_SRCS})
-target_link_libraries(vtkIOParallelNetCDF vtkNetCDF_cxx)
+target_link_libraries(vtkIOParallelNetCDF netcdf)
diff -up VTK/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt.netcdf VTK/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt
--- VTK/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt.netcdf 2013-01-28 14:44:36.000000000 -0700
+++ VTK/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt 2013-01-28 15:40:27.534030910 -0700
@@ -241,7 +241,7 @@ ENDIF(APPLE)
VTK_ADD_LIBRARY(vtkexoIIc ${cbind_SRCS})
-TARGET_LINK_LIBRARIES(vtkexoIIc vtkNetCDF)
+TARGET_LINK_LIBRARIES(vtkexoIIc netcdf)
#INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
diff -up VTK/ThirdParty/netcdf/CMakeLists.txt.netcdf VTK/ThirdParty/netcdf/CMakeLists.txt
--- VTK/ThirdParty/netcdf/CMakeLists.txt.netcdf 2013-01-28 14:44:36.000000000 -0700
+++ VTK/ThirdParty/netcdf/CMakeLists.txt 2013-01-28 15:40:00.825176295 -0700
@@ -1,8 +1,12 @@
set(vtknetcdf_THIRD_PARTY 1)
-set(vtknetcdf_LIBRARIES vtkNetCDF vtkNetCDF_cxx)
-set(vtknetcdf_INCLUDE_DIRS
- ${vtknetcdf_SOURCE_DIR}/vtknetcdf/include
- ${vtknetcdf_BINARY_DIR}/vtknetcdf
- )
+if(NOT VTK_USE_SYSTEM_NETCDF)
+ set(vtknetcdf_LIBRARIES vtkNetCDF vtkNetCDF_cxx)
+ set(vtknetcdf_INCLUDE_DIRS
+ ${vtknetcdf_SOURCE_DIR}/vtknetcdf/include
+ ${vtknetcdf_BINARY_DIR}/vtknetcdf
+ )
+ add_subdirectory(vtknetcdf)
+else(NOT VTK_USE_SYSTEM_NETCDF)
+ set(vtknetcdf_LIBRARIES netcdf)
+endif()
vtk_module_export_info()
-add_subdirectory(vtknetcdf)
diff -up VTK/ThirdParty/netcdf/vtk_netcdfcpp.h.netcdf VTK/ThirdParty/netcdf/vtk_netcdfcpp.h
--- VTK/ThirdParty/netcdf/vtk_netcdfcpp.h.netcdf 2013-01-28 14:44:36.000000000 -0700
+++ VTK/ThirdParty/netcdf/vtk_netcdfcpp.h 2013-01-28 15:40:00.826176289 -0700
@@ -16,6 +16,6 @@
#define __vtk_netcdfcpp_h
/* Use the netcdf library configured for VTK. */
-#include <vtknetcdf/cxx/netcdfcpp.h>
+#include <netcdfcpp.h>
#endif
diff -up VTK/ThirdParty/netcdf/vtk_netcdf.h.netcdf VTK/ThirdParty/netcdf/vtk_netcdf.h
--- VTK/ThirdParty/netcdf/vtk_netcdf.h.netcdf 2013-01-28 14:44:36.000000000 -0700
+++ VTK/ThirdParty/netcdf/vtk_netcdf.h 2013-01-28 15:40:00.826176289 -0700
@@ -16,6 +16,6 @@
#define __vtk_netcdf_h
/* Use the netcdf library configured for VTK. */
-#include <vtknetcdf/include/netcdf.h>
+#include <netcdf.h>
#endif

View File

@ -14,7 +14,7 @@
Summary: The Visualization Toolkit - A high level 3D visualization library
Name: vtk
Version: 6.0.0
Release: 9%{?dist}
Release: 10%{?dist}
# This is a variant BSD license, a cross between BSD and ZLIB.
# For all intents, it has the same rights and restrictions as BSD.
# http://fedoraproject.org/wiki/Licensing/BSD#VTKBSDVariant
@ -29,6 +29,8 @@ Patch0: vtk-6.0.0-system.patch
Patch1: vtk-install.patch
# Upsream patch to install vtkpython
Patch2: vtk-vtkpython.patch
#Patch to vtk to use system netcdf library
Patch3: vtk-6.0.0-netcdf.patch
URL: http://vtk.org/
@ -58,6 +60,7 @@ BuildRequires: boost-devel
BuildRequires: hdf5-devel
BuildRequires: libtheora-devel
BuildRequires: mysql-devel
BuildRequires: netcdf-cxx-devel
BuildRequires: postgresql-devel
BuildRequires: R-devel
BuildRequires: PyQt4-devel
@ -172,6 +175,12 @@ programming languages.
%patch0 -p1 -b .system
%patch1 -p1 -b .install
%patch2 -p1 -b .vtkpython
%patch3 -p1 -b .netcdf
# Remove included thirdparty sources just to be sure
for x in expat freetype gl2ps hdf5 jpeg libxml2 netcdf oggtheora png sqlite tiff zlib
do
rm -r ThirdParty/${x}/vtk${x}
done
# Replace relative path ../../../VTKData with %{_datadir}/vtkdata-%{version}
# otherwise it will break on symlinks.
@ -441,6 +450,9 @@ cp -pr --parents Wrapping/*/README* _docs/
%doc vtk-examples/Examples
%changelog
* Fri Dec 27 2013 Orion Poplawski <orion@cora.nwra.com> - 6.0.0-10
- Add patch to use system netcdf
* Sun Dec 22 2013 Kevin Fenzi <kevin@scrye.com> 6.0.0-9
- Add BuildRequires on blas-devel and lapack-devel