From b23225c6b1039e1ec16ab3e4367b9f35e8fc0339 Mon Sep 17 00:00:00 2001 From: David Spencer Date: Thu, 14 Jul 2016 12:17:17 +0100 Subject: libraries/VTK: Moved to /usr from /opt. Signed-off-by: David Spencer --- libraries/VTK/VTK.SlackBuild | 40 +++++++++++++++++++++++----------------- libraries/VTK/patch-gdal2.diff | 31 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 libraries/VTK/patch-gdal2.diff (limited to 'libraries') diff --git a/libraries/VTK/VTK.SlackBuild b/libraries/VTK/VTK.SlackBuild index 1a1c905e7d..88497e9a2a 100644 --- a/libraries/VTK/VTK.SlackBuild +++ b/libraries/VTK/VTK.SlackBuild @@ -26,10 +26,11 @@ # 2014-02-16 Update to 6.1.0 # 2014-11-16 Support VTK features # 2015-12-12 Update to 6.3.0, use external deps, move to /opt +# 2016-07-14 Move back to /usr PRGNAM=VTK VERSION=${VERSION:-6.3.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -62,13 +63,13 @@ fi # configure VTK features # (defaults suitable for OpenCASCADE, it's the only SBo package that depends on VTK) group_imaging="" ; [ "${IMAGING:-yes}" != "no" ] && group_imaging="-DVTK_Group_Imaging=true" -group_mpi="" ; [ "${MPI:-no}" != "no" ] && group_mpi="-DVTK_Group_MPI=true" -group_qt="" ; [ "${QT:-yes}" != "no" ] && group_qt="-DVTK_Group_Qt=true" +group_mpi="" ; [ "${MPI:-no}" != "no" ] && group_mpi="-DVTK_Group_MPI=true" +group_qt="" ; [ "${QT:-yes}" != "no" ] && group_qt="-DVTK_Group_Qt=true" group_tk="" ; [ "${TK:-yes}" != "no" ] && group_tk="-DVTK_Group_Tk=true" -group_views="" ; [ "${VIEWS:-no}" != "no" ] && group_views="-DVTK_Group_Views=true" -group_web="" ; [ "${WEB:-no}" != "no" ] && group_web="-DVTK_Group_Web=true" -wrap_python="" ; [ "${PYTHON:-yes}" != "no" ] && wrap_python="-DVTK_WRAP_PYTHON=true" -wrap_java="" ; [ "${JAVA:-no}" != "no" ] && wrap_java="-DVTK_WRAP_JAVA=true" +group_views="" ; [ "${VIEWS:-no}" != "no" ] && group_views="-DVTK_Group_Views=true" +group_web="" ; [ "${WEB:-no}" != "no" ] && group_web="-DVTK_Group_Web=true" +wrap_python="" ; [ "${PYTHON:-yes}" != "no" ] && wrap_python="-DVTK_WRAP_PYTHON=true" +wrap_java="" ; [ "${JAVA:-no}" != "no" ] && wrap_java="-DVTK_WRAP_JAVA=true" wrap_tcl="" ; [ "${TCL:-yes}" != "no" ] && wrap_tcl="-DVTK_WRAP_TCL=true" set -e @@ -88,9 +89,9 @@ find -L . \ # patch CMakefile first for lib64 issue patch -p0 <$CWD/patch-handle-64bit.diff +# patch for gdal-2.x (gdal is an optional dep) - thanks to Arch +patch -p1 <$CWD/patch-gdal2.diff -# -DCMAKE_INSTALL_PREFIX=/opt -# Installing to /usr creates /usr/plugins, /usr/src/vtk, /usr/lib64/www :-( # -DVTK_CUSTOM_LIBRARY_SUFFIX and -DVTK_INSTALL_INCLUDE_DIR # See https://bugs.archlinux.org/task/43378?project=5&cat[0]=33&string=vtk # -DVTK_USE_SYSTEM_* @@ -104,11 +105,11 @@ cd build cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_INSTALL_PREFIX=/opt/$PRGNAM \ + -DCMAKE_INSTALL_PREFIX=/usr \ -DLIB_SUFFIX=$LIBDIRSUFFIX \ -DBUILD_SHARED_LIBS=ON \ -DVTK_CUSTOM_LIBRARY_SUFFIX="" \ - -DVTK_INSTALL_INCLUDE_DIR:PATH=include \ + -DVTK_INSTALL_INCLUDE_DIR:PATH=include/VTK \ $group_imaging \ $group_mpi \ $group_qt \ @@ -134,21 +135,26 @@ cd build make install DESTDIR=$PKG cd .. -mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/ -mv \ - $PKG/opt/VTK/lib$LIBDIRSUFFIX/python2.7/site-packages/vtk \ - $PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/ -rm -rf $PKG/opt/VTK/lib$LIBDIRSUFFIX/python2.7 - find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/qt +mv \ + $PKG/usr/plugins/ \ + $PKG/usr/lib${LIBDIRSUFFIX}/qt + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ CONTRIBUTING.md Copyright.txt README.md \ $PKG/usr/doc/$PRGNAM-$VERSION +mv \ + $PKG/usr/share/doc/vtk-6.3/verdict/ \ + $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +rm -rf $PKG/usr/share/doc +rm -rf $PKG/usr/share/cmake + mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/libraries/VTK/patch-gdal2.diff b/libraries/VTK/patch-gdal2.diff new file mode 100644 index 0000000000..36c33ee14c --- /dev/null +++ b/libraries/VTK/patch-gdal2.diff @@ -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; -- cgit v1.2.3