diff options
author | Sébastien Fabbro <bicatali@gentoo.org> | 2015-11-23 23:16:13 +0000 |
---|---|---|
committer | Sébastien Fabbro <bicatali@gentoo.org> | 2015-11-23 23:16:13 +0000 |
commit | 1451f700162dff261762f3623ed01afa2c24b0c7 (patch) | |
tree | c855302847197fefd3626ea48da1a586bce2170b /sci-libs | |
parent | sci-libs/vtkdata: version bump (diff) | |
download | bicatali-1451f700162dff261762f3623ed01afa2c24b0c7.tar.gz bicatali-1451f700162dff261762f3623ed01afa2c24b0c7.tar.bz2 bicatali-1451f700162dff261762f3623ed01afa2c24b0c7.zip |
sci-libs/vtk: version bump with a few patches and fixes for xdmf
Package-Manager: portage-2.2.25
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/vtk/Manifest | 4 | ||||
-rw-r--r-- | sci-libs/vtk/files/vtk-6.1.0-glext.patch | 13 | ||||
-rw-r--r-- | sci-libs/vtk/files/vtk-6.1.0-memset.patch | 147 | ||||
-rw-r--r-- | sci-libs/vtk/files/vtk-6.3.0-gdal.patch | 31 | ||||
-rw-r--r-- | sci-libs/vtk/files/vtk-6.3.0-xdmf3-libxml2.patch | 42 | ||||
-rw-r--r-- | sci-libs/vtk/files/vtk-6.3.0-xdmf3-linking.patch | 40 | ||||
-rw-r--r-- | sci-libs/vtk/metadata.xml | 26 | ||||
-rw-r--r-- | sci-libs/vtk/vtk-6.3.0.ebuild | 352 |
8 files changed, 655 insertions, 0 deletions
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 <OpenGL/gl.h> // 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 <gladk@debian.org> +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<int, int>::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; i<nprocs; i++) + { +@@ -3581,7 +3605,9 @@ vtkIdTypeArray **vtkDistributedDataFilter::GetGhostPointIds( + vtkIdType numPoints = grid->GetNumberOfPoints(); + + 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?= <nico.schloemer@gmail.com> +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?= <nico.schloemer@gmail.com> +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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>sci</herd> + <herd>java</herd> + <maintainer> + <email>jlec@gentoo.org</email> + <name>Justin Lecher</name> + </maintainer> + <use> + <flag name="all-modules">Build all modules</flag> + <flag name="boost">Add support for boost</flag> + <flag name="cg">Use nvidia's cg shaders</flag> + <flag name="gdal">Support for gdal formated data</flag> + <flag name="imaging">Building Imaging modules</flag> + <flag name="json">Support for json formated data</flag> + <flag name="kaapi">Use <pkg>sci-libs/xkaapi</pkg> to handle smp support</flag> + <flag name="offscreen">Offscreen rendering through OSMesa</flag> + <flag name="rendering">Building Redering modules</flag> + <flag name="tbb">Use <pkg>dev-cpp/tbb</pkg> to handle smp support</flag> + <flag name="views">Building Views modules</flag> + <flag name="web">Install web component</flag> + <flag name="xdmf2">Support for xdmf2 formated data</flag> + <flag name="R">Enable support for dev-lang/R</flag> + </use> +</pkgmetadata> 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? ( <sci-libs/xkaapi-3 ) + mpi? ( + virtual/mpi[cxx,romio] + python? ( dev-python/mpi4py[${PYTHON_USEDEP}] ) + mysql? ( virtual/mysql ) + odbc? ( dev-db/unixODBC ) + offscreen? ( media-libs/mesa[osmesa] ) + postgres? ( dev-db/postgresql:= ) + python? ( + ${PYTHON_DEPS} + dev-python/sip[${PYTHON_USEDEP}] + ) + ) + qt4? ( + dev-qt/designer:4 + dev-qt/qtcore:4 + dev-qt/qtgui:4 + dev-qt/qtopengl:4 + dev-qt/qtsql:4 + dev-qt/qtwebkit:4 + python? ( dev-python/PyQt4[${PYTHON_USEDEP}] ) + ) + tbb? ( dev-cpp/tbb ) + tcl? ( dev-lang/tcl:0= ) + tk? ( dev-lang/tk:0= ) + video_cards_nvidia? ( media-video/nvidia-settings ) + web? ( + ${WEBAPP_DEPEND} + python? ( + dev-python/autobahn[${PYTHON_USEDEP}] + dev-python/twisted-core[${PYTHON_USEDEP}] + dev-python/zope-interface[${PYTHON_USEDEP}] + ) + ) + R? ( dev-lang/R )" + +DEPEND="${RDEPEND} + doc? ( app-doc/doxygen[dot] ) + java? ( >=virtual/jdk-1.5 )" + +S="${WORKDIR}"/VTK-${PV} + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.0-glext.patch + "${FILESDIR}"/${PN}-6.1.0-memset.patch + "${FILESDIR}"/${PN}-6.3.0-gdal.patch + "${FILESDIR}"/${PN}-6.3.0-xdmf3-linking.patch + "${FILESDIR}"/${PN}-6.3.0-xdmf3-libxml2.patch +) + +RESTRICT=test + +pkg_setup() { + use java && java-pkg-opt-2_pkg_setup + use python && python-single-r1_pkg_setup + use web && webapp_pkg_setup + + append-cppflags -D__STDC_CONSTANT_MACROS -D_UNICODE +} + +src_prepare() { + sed -e 's:libproj4:libproj:g' \ + -e 's:lib_proj.h:proj_api.h:g' \ + -i "${S}"/CMake/FindLIBPROJ4.cmake || die + + use java && export JAVA_HOME="${EPREFIX}/etc/java-config-2/current-system-vm" + + if use mpi; then + export CC=mpicc + export CXX=mpicxx + export FC=mpif90 + export F90=mpif90 + export F77=mpif77 + fi + + cmake-utils_src_prepare +} + +src_configure() { + # general configuration + local mycmakeargs=( + -Wno-dev +# -DCMAKE_SKIP_RPATH=YES + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DVTK_DIR="${S}" + -DVTK_INSTALL_LIBRARY_DIR=$(get_libdir) + -DVTK_INSTALL_ARCHIVE_DIR=$(get_libdir) + -DVTK_INSTALL_PACKAGE_DIR=$(get_libdir)/cmake/${PN} + -DVTK_INSTALL_DATA_DIR="share/${PN}" + -DVTK_INSTALL_DOC_DIR="share/${PF}" + -DVTK_DATA_ROOT="${EPREFIX}/usr/share/${PN}/data" + -DVTK_CUSTOM_LIBRARY_SUFFIX="" + -DBUILD_SHARED_LIBS=ON + -DVTK_USE_LARGE_DATA=ON + -DVTK_USE_PARALLEL=ON + -DVTK_EXTRA_COMPILER_WARNINGS=ON + -DVTK_Group_StandAlone=ON + ) + # use system libraries + local x + for x in AUTOBAHN EXPAT FREETYPE GL2PS GLEW HDF5 JPEG JSONCPP LIBRARIES \ + LIBXML2 MPI4PY NETCDF OGGTHEORA PNG SIX TIFF TWISTED ZLIB ZOPE; do + mycmakeargs+=( -DVTK_USE_SYSTEM_${x}=ON ) + done + # some need work, mostly upstream: XDMF2 XDMF3 LIBPROJ4 + for x in LIBPROJ4 XDMF2 XDMF3; do + mycmakeargs+=( -DVTK_USE_SYSTEM_${x}=OFF ) + done + + # optional stuff + mycmakeargs+=( + $(cmake-utils_use_build doc DOCUMENTATION) + $(cmake-utils_use_build examples EXAMPLES) + $(cmake-utils_use_build test VTK_BUILD_ALL_MODULES_FOR_TESTS) + $(cmake-utils_use all-modules VTK_BUILD_ALL_MODULES) + $(cmake-utils_use doc DOCUMENTATION_HTML_HELP) + $(cmake-utils_use imaging VTK_Group_Imaging) + $(cmake-utils_use mpi VTK_Group_MPI) + $(cmake-utils_use qt4 VTK_Group_Qt) + $(cmake-utils_use rendering VTK_Group_Rendering) + $(cmake-utils_use tk VTK_Group_Tk) + $(cmake-utils_use views VTK_Group_Views) + $(cmake-utils_use web VTK_Group_Web) + $(cmake-utils_use web VTK_WWW_DIR="${ED}/${MY_HTDOCSDIR}") + $(cmake-utils_use java VTK_WRAP_JAVA) + $(cmake-utils_use python VTK_WRAP_PYTHON) + $(cmake-utils_use python VTK_WRAP_PYTHON_SIP) + $(cmake-utils_use tcl VTK_WRAP_TCL) + ) + + mycmakeargs+=( + $(cmake-utils_use boost VTK_USE_BOOST) + $(cmake-utils_use cg VTK_USE_CG_SHADERS) + $(cmake-utils_use odbc VTK_USE_ODBC) + $(cmake-utils_use offscreen VTK_USE_OFFSCREEN) + $(cmake-utils_use offscreen VTK_OPENGL_HAS_OSMESA) + $(cmake-utils_use smp vtkFiltersSMP) + $(cmake-utils_use theora VTK_USE_OGGTHEORA_ENCODER) + $(cmake-utils_use video_cards_nvidia VTK_USE_NVCONTROL) + $(cmake-utils_use R Module_vtkFiltersStatisticsGnuR) + $(cmake-utils_use X VTK_USE_X) + ) + + # IO + mycmakeargs+=( + $(cmake-utils_use ffmpeg VTK_USE_FFMPEG_ENCODER) + $(cmake-utils_use gdal Module_vtkIOGDAL) + $(cmake-utils_use json Module_vtkIOGeoJSON) + ) + # Apple stuff, does it really work? + mycmakeargs+=( $(cmake-utils_use aqua VTK_USE_COCOA) ) + + if use examples || use test; then + mycmakeargs+=( -DBUILD_TESTING=ON ) + fi + + if use kaapi; then + mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="Kaapi" ) + elif use tbb; then + mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="TBB" ) + else + mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="Sequential" ) + fi + + if use java; then + if [ "${ARCH}" == "amd64" ]; then + mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so;${JAVA_HOME}/jre/lib/${ARCH}/xawt/libmawt.so" ) + else + mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/i386/libjawt.so;${JAVA_HOME}/jre/lib/i386/xawt/libmawt.so" ) + fi + fi + if use python; then + mycmakeargs+=( + -DVTK_INSTALL_PYTHON_MODULE_DIR="$(python_get_sitedir)" + -DPYTHON_INCLUDE_DIR="$(python_get_includedir)" + -DPYTHON_LIBRARY="$(python_get_library_path)" + -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip" + -DSIP_INCLUDE_DIR="$(python_get_includedir)" + -DVTK_PYTHON_INCLUDE_DIR="$(python_get_includedir)" + -DVTK_PYTHON_LIBRARY="$(python_get_library_path)" + -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${PREFIX} --root=${D}" + ) + fi + + if use qt4; then + mycmakeargs+=( + -DVTK_USE_QVTK=ON + -DVTK_USE_QVTK_OPENGL=ON + -DVTK_USE_QVTK_QTOPENGL=ON + -DQT_WRAP_CPP=ON + -DQT_WRAP_UI=ON + -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/designer + -DDESIRED_QT_VERSION=4 + -DVTK_QT_VERSION=4 + -DQT_MOC_EXECUTABLE="$(qt4_get_bindir)/moc" + -DQT_UIC_EXECUTABLE="$(qt4_get_bindir)/uic" + -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4" + -DQT_QMAKE_EXECUTABLE="$(qt4_get_bindir)/qmake" + ) + fi + + if use R; then + mycmakeargs+=( +# -DR_LIBRARY_BLAS=$($(tc-getPKG_CONFIG) --libs blas) +# -DR_LIBRARY_LAPACK=$($(tc-getPKG_CONFIG) --libs lapack) + -DR_LIBRARY_BLAS=/usr/$(get_libdir)/R/lib/libR.so + -DR_LIBRARY_LAPACK=/usr/$(get_libdir)/R/lib/libR.so + ) + fi + + cmake-utils_src_configure +} + +src_test() { + local tcllib + ln -sf "${BUILD_DIR}"/lib "${BUILD_DIR}"/lib/Release || die + for tcllib in "${BUILD_DIR}"/lib/lib*TCL*so; do + ln -sf $(basename "${tcllib}").1 "${tcllib/.so/-${SPV}.so}" || die + done + export LD_LIBRARY_PATH="${BUILD_DIR}"/lib:"${JAVA_HOME}"/jre/lib/${ARCH}/:"${JAVA_HOME}"/jre/lib/${ARCH}/xawt/ + local VIRTUALX_COMMAND="cmake-utils_src_test" +# local VIRTUALX_COMMAND="cmake-utils_src_test -R Java" +# local VIRTUALX_COMMAND="cmake-utils_src_test -I 364,365" + virtualmake +} + +src_install() { + use web && webapp_src_preinst + + cmake-utils_src_install + + use java && java-pkg_regjar "${ED}"/usr/$(get_libdir)/${PN}.jar + + if use tcl; then + # install Tcl docs + docinto vtk_tcl + dodoc "${S}"/Wrapping/Tcl/README + fi + + # install examples + if use examples; then + insinto /usr/share/${PN} + mv -v Examples examples || die + doins -r examples + fi + + #install big docs + if use doc; then + cd "${WORKDIR}"/html || die + rm -f *.md5 || die "Failed to remove superfluous hashes" + einfo "Installing API docs. This may take some time." + docinto html + dodoc -r ./* + fi + + # environment + cat >> "${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 +} |