diff options
-rw-r--r-- | .SRCINFO | 51 | ||||
-rw-r--r-- | PKGBUILD | 114 | ||||
-rw-r--r-- | cmake-fixes.patch | 53 | ||||
-rw-r--r-- | ffmpeg3_compat.patch | 62 | ||||
-rw-r--r-- | gdal2.patch | 31 |
5 files changed, 311 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..aee5dd72eaad --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,51 @@ +pkgbase = vtk6-legacy + pkgdesc = A software system for 3D computer graphics, image processing, and visualization. Legacy 6.3 version, Tcl wrapper only. + pkgver = 6.3.0 + pkgrel = 1 + url = https://www.vtk.org/ + arch = x86_64 + license = BSD + makedepends = boost + makedepends = cmake + makedepends = ninja + makedepends = doxygen + makedepends = gnuplot + makedepends = tk + makedepends = wget + makedepends = unixodbc + makedepends = gdal + makedepends = openmpi + makedepends = mariadb + makedepends = glew + makedepends = ffmpeg + makedepends = qt5-base + makedepends = jsoncpp + makedepends = qt5-webkit + makedepends = qt5-tools + depends = gcc-libs + depends = gl2ps + optdepends = tk: tcl bindings + optdepends = gnuplot: plotting tools + optdepends = graphviz: drawing tools + optdepends = openmpi: OpenMPI support + optdepends = unixodbc + optdepends = glew + optdepends = gdal + optdepends = mariadb + provides = vtk6 + conflicts = vtk6 + options = staticlibs + source = https://www.vtk.org/files/release/6.3/VTK-6.3.0.tar.gz + source = remove-vtkxdmf3.patch::https://github.com/Kitware/VTK/pull/21/commits/a98527dfe9ce23beebf386fab07caef99b911ede.patch + source = find-libxml2.patch::https://github.com/Kitware/VTK/pull/21/commits/6216f98a7124e12a2c1cefd113347f94b51f3c51.patch + source = ffmpeg3_compat.patch + source = gdal2.patch + source = cmake-fixes.patch + sha1sums = 452efab1eedf6202f2d9a3362b5f69adfc44edda + sha1sums = 191a9393dc0e2e8c40e5042611102cd5e421dfaa + sha1sums = c643961234e66ee94f86795f10cea2634ad046cc + sha1sums = a78177f8dd6dedd9ad189fa12730ec53c7d02508 + sha1sums = c60610e7c8cf0ad93d7c02cbf8a20fc415f59b3e + sha1sums = 46cec3cfb4691c8f7ab42e2de963cb3362f0f13b + +pkgname = vtk6-legacy diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..665107d9ecf6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,114 @@ +# Maintainer: Albert Gräf <aggraef@gmail.com> +# Contributor: Gabriel Souza Franco <Z2FicmllbGZyYW5jb3NvdXphQGdtYWlsLmNvbQ==> +# Contributor: Florian Pritz <bluewind@xinu.at> +# Contributor: Ray Rashif <schiv@archlinux.org> +# Contributor: Andrzej Giniewicz <gginiu@gmail.com> +# Contributor: Thomas Dziedzic < gostrc at gmail > + +# This is based on the earlier vtk6 package maintained by Gabriel Souza Franco +# which was deleted some time ago. The present package is a stripped-down +# version which compiles on current Arch and just includes the Tcl wrapper (no +# Java, no Python). It includes everything needed for Tcl-based VTK +# development, is lighter on dependencies, and builds fairly quickly. + +# This package is for people who need to run legacy VTK applications which +# require a full set of VTK Tcl libraries which can be loaded straight into +# *any* (possibly embedded) instance of the Tcl interpreter. This isn't +# supported by newer VTK versions any more, which forces you to use the +# programming languages directly supported by VTK. In contrast, this package +# lets you use VTK in *any* programming environment which has a Tcl interface, +# of which there are many. + +# NOTE: To prevent conflicts with other VTK installations, like the old vtk6 +# package, vtk6-legacy installs into /opt/vtk6. This also encompasses the Tcl +# libraries, so in order to make the vtk package load properly in the Tcl +# interpreter, you need to set the TCLLIBPATH environment variable +# accordingly. E.g., in bash do: export TCLLIBPATH=/opt/vtk6/lib/tcltk. + +# To test that the package loads properly, run tclsh and input the command +# `package require vtk`. You should see `6.3` displayed in response. + +pkgname=vtk6-legacy +pkgver=6.3.0 +_majorver=6.3 +pkgrel=1 +pkgdesc='A software system for 3D computer graphics, image processing, and visualization. Legacy 6.3 version, Tcl wrapper only.' +arch=('x86_64') +url='https://www.vtk.org/' +license=('BSD') +depends=('gcc-libs' 'gl2ps') +makedepends=('boost' 'cmake' 'ninja' 'doxygen' 'gnuplot' 'tk' 'wget' 'unixodbc' 'gdal' 'openmpi' 'mariadb' 'glew' 'ffmpeg' 'qt5-base' 'jsoncpp' 'qt5-webkit' 'qt5-tools') +optdepends=('tk: tcl bindings' + 'gnuplot: plotting tools' + 'graphviz: drawing tools' + 'openmpi: OpenMPI support' + 'unixodbc' + 'glew' + 'gdal' + 'mariadb') +provides=('vtk6') +conflicts=('vtk6') +source=("https://www.vtk.org/files/release/${_majorver}/VTK-${pkgver}.tar.gz" + remove-vtkxdmf3.patch::https://github.com/Kitware/VTK/pull/21/commits/a98527dfe9ce23beebf386fab07caef99b911ede.patch + find-libxml2.patch::https://github.com/Kitware/VTK/pull/21/commits/6216f98a7124e12a2c1cefd113347f94b51f3c51.patch + ffmpeg3_compat.patch + gdal2.patch + cmake-fixes.patch) +options=(staticlibs) +sha1sums=('452efab1eedf6202f2d9a3362b5f69adfc44edda' + '191a9393dc0e2e8c40e5042611102cd5e421dfaa' + 'c643961234e66ee94f86795f10cea2634ad046cc' + 'a78177f8dd6dedd9ad189fa12730ec53c7d02508' + 'c60610e7c8cf0ad93d7c02cbf8a20fc415f59b3e' + '46cec3cfb4691c8f7ab42e2de963cb3362f0f13b') + +prepare() { + cd "${srcdir}"/VTK-$pkgver + + # fix compilation errors: + patch -Np1 -i "${srcdir}"/remove-vtkxdmf3.patch + patch -Np1 -i "${srcdir}"/find-libxml2.patch + patch -Np1 -i "${srcdir}"/gdal2.patch + patch -Np1 -i "${srcdir}"/ffmpeg3_compat.patch + patch -Np1 -i "${srcdir}"/cmake-fixes.patch +} + +build() { + cd "${srcdir}" + rm -rf build + mkdir build + cd build + + cmake \ + -Wno-dev \ + -DCMAKE_SKIP_RPATH=ON \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DCMAKE_INSTALL_PREFIX:FILEPATH=/opt/vtk6 \ + -DBUILD_DOCUMENTATION:BOOL=OFF \ + -DBUILD_EXAMPLES:BOOL=OFF \ + -DVTK_USE_TK:BOOL=ON \ + -DVTK_WRAP_JAVA:BOOL=OFF \ + -DVTK_WRAP_PYTHON:BOOL=OFF \ + -DVTK_WRAP_TCL:BOOL=ON \ + -DVTK_Group_Tk=ON \ + -DCMAKE_CXX_FLAGS="-std=c++14 -D__STDC_CONSTANT_MACROS" \ + -DCMAKE_BUILD_TYPE=Release \ + -DModule_vtkRenderingExternal=ON \ + "${srcdir}/VTK-${pkgver}" \ + -GNinja + + ninja +} + +package() { + cd "${srcdir}/build" + + DESTDIR="${pkgdir}" ninja install + + mkdir -p "$pkgdir/etc/ld.so.conf.d/" + printf "%s\n" "/opt/vtk6/lib" > "$pkgdir/etc/ld.so.conf.d/vtk6.conf" + + # install license file + install -dv "${pkgdir}/opt/vtk6/share/licenses/vtk" + install -m644 "${srcdir}/VTK-${pkgver}/Copyright.txt" "${pkgdir}/opt/vtk6/share/licenses/vtk" +} diff --git a/cmake-fixes.patch b/cmake-fixes.patch new file mode 100644 index 000000000000..a15d335c1bfa --- /dev/null +++ b/cmake-fixes.patch @@ -0,0 +1,53 @@ +diff -ru VTK-6.3.0.orig/CMake/GenerateExportHeader.cmake VTK-6.3.0/CMake/GenerateExportHeader.cmake +--- VTK-6.3.0.orig/CMake/GenerateExportHeader.cmake 2015-09-01 23:41:26.000000000 +0200 ++++ VTK-6.3.0/CMake/GenerateExportHeader.cmake 2022-07-04 08:21:30.683900813 +0200 +@@ -163,19 +163,7 @@ + macro(_test_compiler_hidden_visibility) + + if(CMAKE_COMPILER_IS_GNUCXX) +- execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version +- OUTPUT_VARIABLE _gcc_version_info +- ERROR_VARIABLE _gcc_version_info) +- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" +- _gcc_version "${_gcc_version_info}") +- # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the +- # patch level, handle this here: +- if(NOT _gcc_version) +- string(REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0" +- _gcc_version "${_gcc_version_info}") +- endif() +- +- if(${_gcc_version} VERSION_LESS "4.2") ++ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2) + set(GCC_TOO_OLD TRUE) + endif() + endif() +diff -ru VTK-6.3.0.orig/CMake/vtkCompilerExtras.cmake VTK-6.3.0/CMake/vtkCompilerExtras.cmake +--- VTK-6.3.0.orig/CMake/vtkCompilerExtras.cmake 2015-09-01 23:41:26.000000000 +0200 ++++ VTK-6.3.0/CMake/vtkCompilerExtras.cmake 2022-07-04 08:27:15.275317476 +0200 +@@ -27,24 +27,12 @@ + "${VTK_EXTRA_SHARED_LINKER_FLAGS} -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") + endif() + +- # Now check if we can use visibility to selectively export symbols +- execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version +- OUTPUT_VARIABLE _gcc_version_info +- ERROR_VARIABLE _gcc_version_info) +- +- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" +- _gcc_version "${_gcc_version_info}") +- if(NOT _gcc_version) +- string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0" +- _gcc_version "${_gcc_version_info}") +- endif() +- + # GCC visibility support, on by default and in testing. + check_cxx_compiler_flag(-fvisibility=hidden HAVE_GCC_VISIBILITY) + option(VTK_USE_GCC_VISIBILITY "Use GCC visibility support if available." OFF) + mark_as_advanced(VTK_USE_GCC_VISIBILITY) + +- if(${_gcc_version} VERSION_GREATER 4.2.0 AND BUILD_SHARED_LIBS ++ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.2 AND BUILD_SHARED_LIBS + AND HAVE_GCC_VISIBILITY AND VTK_USE_GCC_VISIBILITY + AND NOT MINGW AND NOT CYGWIN) + # Should only be set if GCC is newer than 4.2.0 diff --git a/ffmpeg3_compat.patch b/ffmpeg3_compat.patch new file mode 100644 index 000000000000..bf9100ce351c --- /dev/null +++ b/ffmpeg3_compat.patch @@ -0,0 +1,62 @@ +diff --git a/IO/FFMPEG/vtkFFMPEGWriter.cxx b/IO/FFMPEG/vtkFFMPEGWriter.cxx +index d3fd421..294b421 100644 +--- a/IO/FFMPEG/vtkFFMPEGWriter.cxx ++++ b/IO/FFMPEG/vtkFFMPEGWriter.cxx +@@ -191,11 +191,11 @@ int vtkFFMPEGWriterInternal::Start() + c->height = this->Dim[1]; + if (this->Writer->GetCompression()) + { +- c->pix_fmt = PIX_FMT_YUVJ422P; ++ c->pix_fmt = AV_PIX_FMT_YUVJ422P; + } + else + { +- c->pix_fmt = PIX_FMT_BGR24; ++ c->pix_fmt = AV_PIX_FMT_BGR24; + } + + //to do playback at actual recorded rate, this will need more work see also below +@@ -274,13 +274,13 @@ int vtkFFMPEGWriterInternal::Start() + #endif + + //for the output of the writer's input... +- this->rgbInput = avcodec_alloc_frame(); ++ this->rgbInput = av_frame_alloc(); + if (!this->rgbInput) + { + vtkGenericWarningMacro (<< "Could not make rgbInput avframe." ); + return 0; + } +- int RGBsize = avpicture_get_size(PIX_FMT_RGB24, c->width, c->height); ++ int RGBsize = avpicture_get_size(AV_PIX_FMT_RGB24, c->width, c->height); + unsigned char *rgb = (unsigned char *)av_malloc(sizeof(unsigned char) * RGBsize); + if (!rgb) + { +@@ -288,10 +288,10 @@ int vtkFFMPEGWriterInternal::Start() + return 0; + } + //The rgb buffer should get deleted when this->rgbInput is. +- avpicture_fill((AVPicture *)this->rgbInput, rgb, PIX_FMT_RGB24, c->width, c->height); ++ avpicture_fill((AVPicture *)this->rgbInput, rgb, AV_PIX_FMT_RGB24, c->width, c->height); + + //and for the output to the codec's input. +- this->yuvOutput = avcodec_alloc_frame(); ++ this->yuvOutput = av_frame_alloc(); + if (!this->yuvOutput) + { + vtkGenericWarningMacro (<< "Could not make yuvOutput avframe." ); +@@ -349,12 +349,12 @@ int vtkFFMPEGWriterInternal::Write(vtkImageData *id) + //convert that to YUV for input to the codec + #ifdef VTK_FFMPEG_HAS_IMG_CONVERT + img_convert((AVPicture *)this->yuvOutput, cc->pix_fmt, +- (AVPicture *)this->rgbInput, PIX_FMT_RGB24, ++ (AVPicture *)this->rgbInput, AV_PIX_FMT_RGB24, + cc->width, cc->height); + #else + //convert that to YUV for input to the codec + SwsContext* convert_ctx = sws_getContext( +- cc->width, cc->height, PIX_FMT_RGB24, ++ cc->width, cc->height, AV_PIX_FMT_RGB24, + cc->width, cc->height, cc->pix_fmt, + SWS_BICUBIC, NULL, NULL, NULL); + diff --git a/gdal2.patch b/gdal2.patch new file mode 100644 index 000000000000..36c33ee14caf --- /dev/null +++ b/gdal2.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; |