From 1451f700162dff261762f3623ed01afa2c24b0c7 Mon Sep 17 00:00:00 2001 From: Sébastien Fabbro Date: Mon, 23 Nov 2015 23:16:13 +0000 Subject: sci-libs/vtk: version bump with a few patches and fixes for xdmf Package-Manager: portage-2.2.25 --- sci-libs/vtk/Manifest | 4 + sci-libs/vtk/files/vtk-6.1.0-glext.patch | 13 + sci-libs/vtk/files/vtk-6.1.0-memset.patch | 147 ++++++++++ sci-libs/vtk/files/vtk-6.3.0-gdal.patch | 31 ++ sci-libs/vtk/files/vtk-6.3.0-xdmf3-libxml2.patch | 42 +++ sci-libs/vtk/files/vtk-6.3.0-xdmf3-linking.patch | 40 +++ sci-libs/vtk/metadata.xml | 26 ++ sci-libs/vtk/vtk-6.3.0.ebuild | 352 +++++++++++++++++++++++ 8 files changed, 655 insertions(+) create mode 100644 sci-libs/vtk/Manifest create mode 100644 sci-libs/vtk/files/vtk-6.1.0-glext.patch create mode 100644 sci-libs/vtk/files/vtk-6.1.0-memset.patch create mode 100644 sci-libs/vtk/files/vtk-6.3.0-gdal.patch create mode 100644 sci-libs/vtk/files/vtk-6.3.0-xdmf3-libxml2.patch create mode 100644 sci-libs/vtk/files/vtk-6.3.0-xdmf3-linking.patch create mode 100644 sci-libs/vtk/metadata.xml create mode 100644 sci-libs/vtk/vtk-6.3.0.ebuild diff --git a/sci-libs/vtk/Manifest b/sci-libs/vtk/Manifest new file mode 100644 index 0000000..ecb1e84 --- /dev/null +++ b/sci-libs/vtk/Manifest @@ -0,0 +1,4 @@ +DIST VTK-6.3.0.tar.gz 30385070 SHA256 92a493354c5fa66bea73b5fc014154af5d9f3f6cee8d20a826f4cd5d4b0e8a5e SHA512 a05598ed2a70fae9f07a8d9172cb963194cf75d0fcd995c9ebb614a488d4272988212494b1e9aa87272c0ed732161bba8ff97a0cf6874391c1c5fcf7dc22c309 WHIRLPOOL 4c90c338526e25c6d9496010b917cf98de2e8ba451a70aab015120f5403493e7a7205e43918e93fb286320265e44266f3ea22029654e805077619f4ddb68683f +DIST VTKData-6.3.0.tar.gz 171222218 SHA256 e1166f71158073358d89c26efbbce144aa89275dc99f7108b113efa08a7a3c25 SHA512 49cbdcb98093fa265c0bfda71bb3cc6116c898a9381bf895361ea70392054bda1e676c805121a6add287a95cd9084318d3e0884412e86a755331e2c2fd1e3d8a WHIRLPOOL 5517ae7ecfd23f64ab4cfecee79577f21ac29741c2e2af76a31296379b20847ba2720809c5762d843099b62a3eba1636d39a6fb207a46b9816f684336b3d0d8c +DIST VTKLargeData-6.3.0.tar.gz 166679850 SHA256 960d01980375e507ba250081551dd67587ee4eca5fd454022e370cc15ba4de3a SHA512 9486033c5729c265d2d96193f0c839e4961e25dcedbbdd905b1a3852779665db4e0dde68c78a2562725d540eec7c4b497cae65db426df9aa46cb7db4b1deb4f6 WHIRLPOOL b88cdbd87c26b9eaf97aa261f0c5b560d897269e5f7738461fc76509f3955f88738867c6828b1152776475bc861efa34468da6b63ebfe9e707688161d391a114 +DIST vtkDocHtml-6.3.0.tar.gz 112708222 SHA256 f1597ea4a1a1e2360dd3515d0cf9370e289c74361987cb43a088f52a6628f24d SHA512 3b98365ebceae4630a091df9e02e71e29f822c08f2f07feb69211b25f230544b9df325ececf3e55402f1e1ba5ad28fa2c4d71ec03bbe0baef90a2ca64d5d613e WHIRLPOOL 6059d266b71ac9b2eba4ec657fb3fbb15ebabb0e03cea0ab2800e06d90a42f49d1e502f4af9cec705448577a381ffc6b1220d725b9bb991df64ab8a0023439f4 diff --git a/sci-libs/vtk/files/vtk-6.1.0-glext.patch b/sci-libs/vtk/files/vtk-6.1.0-glext.patch new file mode 100644 index 0000000..b5529a5 --- /dev/null +++ b/sci-libs/vtk/files/vtk-6.1.0-glext.patch @@ -0,0 +1,13 @@ +diff -up VTK-6.1.0/Rendering/OpenGL/vtkOpenGL.h.glext VTK-6.1.0/Rendering/OpenGL/vtkOpenGL.h +--- VTK-6.1.0/Rendering/OpenGL/vtkOpenGL.h.glext 2014-01-22 08:55:41.000000000 -0700 ++++ VTK-6.1.0/Rendering/OpenGL/vtkOpenGL.h 2014-11-19 10:27:12.349345199 -0700 +@@ -19,7 +19,8 @@ + #include "vtkConfigure.h" + + // To prevent gl.h to include glext.h provided by the system +-#define GL_GLEXT_LEGACY ++// https://bugzilla.redhat.com/show_bug.cgi?id=1138466 ++// #define GL_GLEXT_LEGACY + #if defined(__APPLE__) && (defined(VTK_USE_CARBON) || defined(VTK_USE_COCOA)) + # include // Include OpenGL API. + #else diff --git a/sci-libs/vtk/files/vtk-6.1.0-memset.patch b/sci-libs/vtk/files/vtk-6.1.0-memset.patch new file mode 100644 index 0000000..362022e --- /dev/null +++ b/sci-libs/vtk/files/vtk-6.1.0-memset.patch @@ -0,0 +1,147 @@ +From ef22d3d69421581b33bc0cd94b647da73b61ba96 Mon Sep 17 00:00:00 2001 +From: Anton Gladky +Date: Fri, 30 May 2014 23:16:26 +0200 +Subject: [PATCH] Fix compilation by gcc-4.9 + +VTK fails to build during compilation by gcc-4.9 with the +following message: + +CMakeFiles/vtkFiltersParallelMPI.dir/vtkDistributedDataFilter.cxx.o: In +function `memset': +/usr/include/x86_64-linux-gnu/bits/string3.h:81: warning: memset used +with constant zero length parameter; this could be due to transposed +parameters +collect2: error: ld returned 1 exit status + +This patch sets if-condition before all "memsets" in +vtkDistributedDataFilter and checkes, whether the number +of bytes to be set by memset is more than 0 to escape this +error. +--- + Filters/ParallelMPI/vtkDistributedDataFilter.cxx | 48 ++++++++++++++++++------ + 1 file changed, 37 insertions(+), 11 deletions(-) + +diff --git a/Filters/ParallelMPI/vtkDistributedDataFilter.cxx b/Filters/ParallelMPI/vtkDistributedDataFilter.cxx +index 3c1ff30..df4b5d3 100644 +--- a/Filters/ParallelMPI/vtkDistributedDataFilter.cxx ++++ b/Filters/ParallelMPI/vtkDistributedDataFilter.cxx +@@ -1091,7 +1091,10 @@ vtkDataSet *vtkDistributedDataFilter::TestFixTooFewInputFiles(vtkDataSet *input) + vtkIdType cellsPerNode = numTotalCells / nprocs; + + vtkIdList **sendCells = new vtkIdList * [ nprocs ]; +- memset(sendCells, 0, sizeof(vtkIdList *) * nprocs); ++ ++ if (sizeof(vtkIdList *) * nprocs > 0) { ++ memset(sendCells, 0, sizeof(vtkIdList *) * nprocs); ++ } + + if (numConsumers == nprocs - 1) + { +@@ -1582,7 +1585,9 @@ vtkFloatArray ** + // Exchange int arrays + + float **recvArrays = new float * [nprocs]; +- memset(recvArrays, 0, sizeof(float *) * nprocs); ++ if (sizeof(float *) * nprocs > 0) { ++ memset(recvArrays, 0, sizeof(float *) * nprocs); ++ } + + if (sendSize[me] > 0) // sent myself an array + { +@@ -1703,7 +1708,9 @@ vtkIdTypeArray ** + // Exchange int arrays + + vtkIdType **recvArrays = new vtkIdType * [nprocs]; +- memset(recvArrays, 0, sizeof(vtkIdType *) * nprocs); ++ if (sizeof(vtkIdType *) * nprocs > 0) { ++ memset(recvArrays, 0, sizeof(vtkIdType *) * nprocs); ++ } + + if (sendSize[me] > 0) // sent myself an array + { +@@ -2807,7 +2814,9 @@ void vtkDistributedDataFilter::AddConstantUnsignedCharPointArray( + + unsigned char *vals = new unsigned char [npoints]; + +- memset(vals, val, npoints); ++ if (npoints > 0) { ++ memset(vals, val, npoints); ++ } + + vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New(); + Array->SetName(arrayName); +@@ -2827,7 +2836,9 @@ void vtkDistributedDataFilter::AddConstantUnsignedCharCellArray( + + unsigned char *vals = new unsigned char [ncells]; + +- memset(vals, val, ncells); ++ if (ncells > 0) { ++ memset(vals, val, ncells); ++ } + + vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New(); + Array->SetName(arrayName); +@@ -3026,7 +3037,9 @@ int vtkDistributedDataFilter::AssignGlobalNodeIds(vtkUnstructuredGrid *grid) + vtkIdType nGridPoints = grid->GetNumberOfPoints(); + + vtkIdType *numPointsOutside = new vtkIdType [nprocs]; +- memset(numPointsOutside, 0, sizeof(vtkIdType) * nprocs); ++ if (sizeof(vtkIdType) * nprocs > 0) { ++ memset(numPointsOutside, 0, sizeof(vtkIdType) * nprocs); ++ } + + vtkIdTypeArray *globalIds = vtkIdTypeArray::New(); + globalIds->SetNumberOfValues(nGridPoints); +@@ -3108,10 +3121,16 @@ int vtkDistributedDataFilter::AssignGlobalNodeIds(vtkUnstructuredGrid *grid) + // global ID back? + + vtkFloatArray **ptarrayOut = new vtkFloatArray * [nprocs]; +- memset(ptarrayOut, 0, sizeof(vtkFloatArray *) * nprocs); ++ ++ if (sizeof(vtkFloatArray *) * nprocs > 0) { ++ memset(ptarrayOut, 0, sizeof(vtkFloatArray *) * nprocs); ++ } + + vtkIdTypeArray **localIds = new vtkIdTypeArray * [nprocs]; +- memset(localIds, 0, sizeof(vtkIdTypeArray *) * nprocs); ++ ++ if (sizeof(vtkIdTypeArray *) * nprocs > 0) { ++ memset(localIds, 0, sizeof(vtkIdTypeArray *) * nprocs); ++ } + + vtkIdType *next = new vtkIdType [nprocs]; + vtkIdType *next3 = new vtkIdType [nprocs]; +@@ -3286,7 +3305,9 @@ vtkIdTypeArray **vtkDistributedDataFilter::FindGlobalPointIds( + { + // There are no cells in my assigned region + +- memset(gids, 0, sizeof(vtkIdTypeArray *) * nprocs); ++ if (sizeof(vtkIdTypeArray *) * nprocs > 0) { ++ memset(gids, 0, sizeof(vtkIdTypeArray *) * nprocs); ++ } + + return gids; + } +@@ -3491,7 +3512,10 @@ vtkIdTypeArray **vtkDistributedDataFilter::MakeProcessLists( + std::multimap::iterator mapIt; + + vtkIdTypeArray **processList = new vtkIdTypeArray * [nprocs]; +- memset(processList, 0, sizeof (vtkIdTypeArray *) * nprocs); ++ ++ if (sizeof (vtkIdTypeArray *) * nprocs > 0) { ++ memset(processList, 0, sizeof (vtkIdTypeArray *) * nprocs); ++ } + + for (int i=0; iGetNumberOfPoints(); + + vtkIdTypeArray **ghostPtIds = new vtkIdTypeArray * [nprocs]; +- memset(ghostPtIds, 0, sizeof(vtkIdTypeArray *) * nprocs); ++ if (sizeof(vtkIdTypeArray *) * nprocs) { ++ memset(ghostPtIds, 0, sizeof(vtkIdTypeArray *) * nprocs); ++ } + + if (numPoints < 1) + { diff --git a/sci-libs/vtk/files/vtk-6.3.0-gdal.patch b/sci-libs/vtk/files/vtk-6.3.0-gdal.patch new file mode 100644 index 0000000..36c33ee --- /dev/null +++ b/sci-libs/vtk/files/vtk-6.3.0-gdal.patch @@ -0,0 +1,31 @@ +diff --git a/IO/GDAL/vtkGDALVectorReader.cxx b/IO/GDAL/vtkGDALVectorReader.cxx +index 86854a0..a0e234a 100644 +--- a/IO/GDAL/vtkGDALVectorReader.cxx ++++ b/IO/GDAL/vtkGDALVectorReader.cxx +@@ -44,7 +44,7 @@ class vtkGDALVectorReader::Internal + public: + Internal( const char* srcName, int srcMode, int appendFeatures, int addFeatIds ) + { +- this->Source = OGRSFDriverRegistrar::Open( srcName, srcMode, &this->Driver ); ++ this->Source = (GDALDataset*) OGROpen( srcName, srcMode, NULL ); + if ( ! this->Source ) + { + this->LastError = CPLGetLastErrorMsg(); +@@ -61,7 +61,7 @@ public: + { + if ( this->Source ) + { +- OGRDataSource::DestroyDataSource( this->Source ); ++ GDALClose( (GDALDatasetH) this->Source ); + } + } + +@@ -304,7 +304,7 @@ public: + return nCells; + } + +- OGRDataSource* Source; ++ GDALDataset* Source; + OGRSFDriver* Driver; + const char* LastError; + int LayerIdx; diff --git a/sci-libs/vtk/files/vtk-6.3.0-xdmf3-libxml2.patch b/sci-libs/vtk/files/vtk-6.3.0-xdmf3-libxml2.patch new file mode 100644 index 0000000..a382a0f --- /dev/null +++ b/sci-libs/vtk/files/vtk-6.3.0-xdmf3-libxml2.patch @@ -0,0 +1,42 @@ +From 6216f98a7124e12a2c1cefd113347f94b51f3c51 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= +Date: Thu, 18 Jun 2015 13:30:30 +0200 +Subject: [PATCH] clarify logic for finding libxml2 in xdmf3 + +--- + ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt | 21 ++++++++++----------- + 1 file changed, 10 insertions(+), 11 deletions(-) + +diff --git a/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt b/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt +index 241fa0a..15955b7 100644 +--- a/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt ++++ b/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt +@@ -93,18 +93,17 @@ if(HDF5_FOUND) + endif() + + +-set(LIBXML2_LIBRARIES ${vtklibxml2_LIBRARIES}) +-set(LIBXML2_INCLUDE_DIR ${vtklibxml2_INCLUDE_DIRS}) +-set(LIBXML2_FOUND TRUE) +-find_package(LibXml2 REQUIRED) +-if(LIBXML2_FOUND) +- include_directories(${LIBXML2_INCLUDE_DIR}) +- get_filename_component(LIBXML2_ROOT "${LIBXML2_INCLUDE_DIR}/../" REALPATH) +- set(LIBXML2_BINARY_DIRS ${LIBXML2_ROOT}/bin) +- set(LIBXML2_BINARY_DIRS ${LIBXML2_BINARY_DIRS} PARENT_SCOPE) +- set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${LIBXML2_LIBRARIES}) +- set(XDMF_BINARIES ${XDMF_BINARIES} ${LIBXML2_BINARY_DIRS}) ++find_package(LibXml2) ++if(NOT LIBXML2_FOUND) ++ set(LIBXML2_LIBRARIES ${vtklibxml2_LIBRARIES}) ++ set(LIBXML2_INCLUDE_DIR ${vtklibxml2_INCLUDE_DIRS}) + endif() ++include_directories(${LIBXML2_INCLUDE_DIR}) ++get_filename_component(LIBXML2_ROOT "${LIBXML2_INCLUDE_DIR}/../" REALPATH) ++set(LIBXML2_BINARY_DIRS ${LIBXML2_ROOT}/bin) ++set(LIBXML2_BINARY_DIRS ${LIBXML2_BINARY_DIRS} PARENT_SCOPE) ++set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${LIBXML2_LIBRARIES}) ++set(XDMF_BINARIES ${XDMF_BINARIES} ${LIBXML2_BINARY_DIRS}) + + # Perform compile-time checks and generate XdmfCoreConfig.hpp + diff --git a/sci-libs/vtk/files/vtk-6.3.0-xdmf3-linking.patch b/sci-libs/vtk/files/vtk-6.3.0-xdmf3-linking.patch new file mode 100644 index 0000000..9f49f77 --- /dev/null +++ b/sci-libs/vtk/files/vtk-6.3.0-xdmf3-linking.patch @@ -0,0 +1,40 @@ +From a98527dfe9ce23beebf386fab07caef99b911ede Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= +Date: Thu, 18 Jun 2015 13:25:14 +0200 +Subject: [PATCH] remove superfluous vtkxdmf3_LINK_DEPENDS from Xdmf3 link line + +This caused VTK-compiled HDF5 and LibXML2 libraries to appear on the link line +even if VTK_USE_SYSTEM_{HDF5,LIBXML2} was on, immediately resulting in a link +error of the type +``` +/usr/bin/ld: cannot find -lvtkhdf5 +/usr/bin/ld: cannot find -lvtklibxml2 +``` +This commit fixes things by simply removing vtkxdmf3_LINK_DEPENDS from the link +line. The dependencies are already taken care of. +--- + ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt b/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt +index ff045a6..241fa0a 100644 +--- a/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt ++++ b/ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt +@@ -8,7 +8,7 @@ include(CheckCXXSourceCompiles) + include(SetUpVersion) + include(TestBigEndian) + +-if(VERSION_CONTROL_AUTOUPDATE OR ++if(VERSION_CONTROL_AUTOUPDATE OR + NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/XdmfVersion.hpp) + VersionCreate("Xdmf" "2" "XDMFCORE_EXPORT" "XdmfCore.hpp") + endif() +@@ -154,7 +154,7 @@ set(XdmfCoreSources + add_library(XdmfCore ${LIBTYPE} ${XdmfCoreSources}) + link_directories(${XDMF_LIBRARY_DIRS}) + +-target_link_libraries(XdmfCore ${XDMF_LIBRARIES} ${vtkxdmf3_LINK_DEPENDS}) ++target_link_libraries(XdmfCore ${XDMF_LIBRARIES}) + vtk_target_install(XdmfCore) + + if(WIN32) diff --git a/sci-libs/vtk/metadata.xml b/sci-libs/vtk/metadata.xml new file mode 100644 index 0000000..50ec9f7 --- /dev/null +++ b/sci-libs/vtk/metadata.xml @@ -0,0 +1,26 @@ + + + + sci + java + + jlec@gentoo.org + Justin Lecher + + + Build all modules + Add support for boost + Use nvidia's cg shaders + Support for gdal formated data + Building Imaging modules + Support for json formated data + Use sci-libs/xkaapi to handle smp support + Offscreen rendering through OSMesa + Building Redering modules + Use dev-cpp/tbb to handle smp support + Building Views modules + Install web component + Support for xdmf2 formated data + Enable support for dev-lang/R + + diff --git a/sci-libs/vtk/vtk-6.3.0.ebuild b/sci-libs/vtk/vtk-6.3.0.ebuild new file mode 100644 index 0000000..d5f986a --- /dev/null +++ b/sci-libs/vtk/vtk-6.3.0.ebuild @@ -0,0 +1,352 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) +CMAKE_MAKEFILE_GENERATOR=ninja +WEBAPP_OPTIONAL=yes +WEBAPP_MANUAL_SLOT=yes + +inherit eutils flag-o-matic java-pkg-opt-2 python-single-r1 qmake-utils versionator toolchain-funcs cmake-utils virtualx webapp + +# Short package version +SPV="$(get_version_component_range 1-2)" + +DESCRIPTION="High level 3D visualization toolkit and library" +HOMEPAGE="http://www.vtk.org/" +SRC_URI=" + http://www.${PN}.org/files/release/${SPV}/VTK-${PV}.tar.gz + doc? ( http://www.${PN}.org/files/release/${SPV}/${PN}DocHtml-${PV}.tar.gz ) + test? ( + http://www.${PN}.org/files/release/${SPV}/VTKData-${PV}.tar.gz + http://www.${PN}.org/files/release/${SPV}/VTKLargeData-${PV}.tar.gz + ) + " + +LICENSE="BSD LGPL-2" +KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux" +SLOT="0" +IUSE=" + all-modules aqua boost cg doc examples imaging ffmpeg gdal java json kaapi mpi + mysql odbc offscreen postgres python qt4 rendering smp tbb test theora tk tcl + video_cards_nvidia views web R +X" + +REQUIRED_USE=" + all-modules? ( ffmpeg gdal mysql python ) + java? ( qt4 ) + python? ( ${PYTHON_REQUIRED_USE} ) + tcl? ( rendering ) + smp? ( ^^ ( kaapi tbb ) ) + test? ( python ) + tk? ( tcl ) + web? ( python ) + ^^ ( X aqua offscreen ) + " + +RDEPEND=" + dev-libs/expat + dev-libs/jsoncpp + dev-libs/libxml2:2 + >=media-libs/freetype-2.5.4 + media-libs/glew:0 + media-libs/libpng:0 + media-libs/mesa + media-libs/libtheora + media-libs/tiff:0 + sci-libs/exodusii + sci-libs/hdf5:= + sci-libs/netcdf-cxx:3 + !sci-libs/xdmf2 + sys-libs/zlib + virtual/jpeg:0 + virtual/opengl + >=x11-libs/gl2ps-1.3.8 + x11-libs/libX11 + x11-libs/libXmu + x11-libs/libXt + boost? ( >=dev-libs/boost-1.40.0[mpi?] ) + cg? ( media-gfx/nvidia-cg-toolkit ) + examples? ( + dev-qt/qtcore:4 + dev-qt/qtgui:4 + sci-libs/vtkdata + ) + ffmpeg? ( virtual/ffmpeg ) + gdal? ( sci-libs/gdal ) + java? ( >=virtual/jre-1.5:* ) + kaapi? ( > "${T}"/40${PN} <<- EOF + VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data + VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV} + VTKHOME=${EPREFIX}/usr + EOF + doenvd "${T}"/40${PN} + + use web && webapp_src_install +} + +# webapp.eclass exports these but we want it optional #534036 +pkg_postinst() { + use web && webapp_pkg_postinst +} + +pkg_prerm() { + use web && webapp_pkg_prerm +} -- cgit v1.2.3-65-gdbad