[arch-commits] Commit in vtk/repos (4 files)
Antonio Rojas
arojas at gemini.archlinux.org
Mon Feb 14 11:45:10 UTC 2022
Date: Monday, February 14, 2022 @ 11:45:10
Author: arojas
Revision: 1133128
archrelease: copy trunk to community-staging-x86_64
Added:
vtk/repos/community-staging-x86_64/
vtk/repos/community-staging-x86_64/.contrib
(from rev 1133127, vtk/trunk/.contrib)
vtk/repos/community-staging-x86_64/PKGBUILD
(from rev 1133127, vtk/trunk/PKGBUILD)
vtk/repos/community-staging-x86_64/ffmpeg5.patch
(from rev 1133127, vtk/trunk/ffmpeg5.patch)
---------------+
.contrib | 6 ++
PKGBUILD | 131 ++++++++++++++++++++++++++++++++++++++++++++++
ffmpeg5.patch | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 295 insertions(+)
Copied: vtk/repos/community-staging-x86_64/.contrib (from rev 1133127, vtk/trunk/.contrib)
===================================================================
--- community-staging-x86_64/.contrib (rev 0)
+++ community-staging-x86_64/.contrib 2022-02-14 11:45:10 UTC (rev 1133128)
@@ -0,0 +1,6 @@
+# Contributor: Christofer Bertonha <christoferbertonha at gmail dot com>
+# Contributor: leepesjee <lpeschier at xs4all dot nl>
+# Contributor: Olivier Medoc
+# Contributor: ignotus
+# Contributor: Fabian Moser
+# Contributor: djscholl
Copied: vtk/repos/community-staging-x86_64/PKGBUILD (from rev 1133127, vtk/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2022-02-14 11:45:10 UTC (rev 1133128)
@@ -0,0 +1,131 @@
+# Maintainer: Evgeniy Alekseev <arcanis at archlinux dot org>
+# Maintainer: Bruno Pagani <archange at archlinux dot org>
+# Contributor: Michael Migliore <mcmigliore+aur at gmail.com>
+# Contributor: Ray Rashif <schiv at archlinux dot org>
+# Contributor: Andrzej Giniewicz <gginiu at gmail dot com>
+# Contributor: Thomas Dziedzic <gostrc at gmail>
+
+pkgname=vtk
+pkgver=9.1.0
+pkgrel=10
+pkgdesc="Software system for 3D computer graphics, image processing, and visualization"
+arch=(x86_64)
+url="https://www.vtk.org/"
+license=(BSD)
+depends=(gcc-libs double-conversion tbb)
+makedepends=(adios2 cmake boost doxygen ffmpeg gdal git gnuplot java-environment=11
+ liblas libxt openimagedenoise openmp openmpi openvdb openvr ospray pdal
+ postgresql python-matplotlib qt5-base qt5-tools qt5-webkit
+ qt5-x11extras tk unixodbc wget
+ cgns double-conversion eigen expat fmt freetype2 gl2ps glew hdf5 libjpeg
+ jsoncpp libharu proj libxml2 lz4 xz python-mpi4py netcdf libogg
+ libpng pugixml rapidjson sqlite libtheora libtiff utf8cpp zfp zlib)
+# pegtl https://gitlab.kitware.com/vtk/vtk/-/issues/18151
+optdepends=('gnuplot: plotting tools'
+ 'graphviz: drawing tools'
+ 'java-runtime=11: java bindings'
+ 'python: python bindings'
+ 'python-mpi4py: OpenMPI python support'
+ 'python-matplotlib: for Matplotlib rendering'
+ 'openmpi: OpenMPI support'
+ 'qt5-x11extras'
+ 'qt5-webkit: WebKit support'
+ 'tk: tcl bindings'
+ adios2
+ cgns
+ ffmpeg
+ gdal
+ gl2ps
+ glew
+ hdf5
+ jsoncpp
+ libarchive
+ libharu
+ liblas
+ lz4
+ netcdf
+ openimagedenoise
+ openvdb
+ openvr
+ ospray
+ pdal
+ postgresql
+ pugixml
+ proj
+ sqlite
+ unixodbc)
+source=(${url}/files/release/${pkgver%.*}/VTK-${pkgver}.tar.gz
+ vtk-tbb-2021.patch::https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/2509.patch
+ ffmpeg5.patch)
+options=(staticlibs)
+sha256sums=('8fed42f4f8f1eb8083107b68eaa9ad71da07110161a3116ad807f43e5ca5ce96'
+ '37cff664c4eaacf44ecb995e62e9e54e54880bae0857d598c74660a2159ccb2e'
+ '066ad5eb3f7cd101c4bbbe4d91ba97419f18537f9dadf6654776b7151c7c6a8d')
+
+prepare() {
+ cd VTK-${pkgver}
+ # We have a patched libharu
+ sed -i "s|2.4.0|2.3.0|" ThirdParty/libharu/CMakeLists.txt
+ # We have a patched fmt
+ sed -i "s|8.1.0|8.0.1|" ThirdParty/fmt/CMakeLists.txt
+ # Fix build with TBB 2021
+ patch -d ThirdParty/vtkm/vtkvtkm/vtk-m -p1 -i "$srcdir"/vtk-tbb-2021.patch
+ # Fix build with FFmpeg 5 https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8863
+ patch -p1 -i "$srcdir"/ffmpeg5.patch
+}
+
+build() {
+ # To help cmake find java
+ export JAVA_HOME=/usr/lib/jvm/default
+ # To set tcl lib path
+ local _tkver=$(echo 'puts $tcl_version' | tclsh)
+ # We do not have packages for cli11, exprtk, ioss
+ cmake -B build -S VTK-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LICENSEDIR=share/licenses/vtk \
+ -DCMAKE_SKIP_RPATH=OFF \
+ -DCMAKE_SKIP_INSTALL_RPATH=ON \
+ -DBUILD_SHARED_LIBS=ON \
+ -DVTK_BUILD_ALL_MODULES=ON \
+ -DVTK_INSTALL_TCL_DIR=/usr/lib/tcl${_tkver}/vtk/ \
+ -DVTK_LEGACY_REMOVE=ON \
+ -DVTK_SMP_ENABLE_OPENMP=ON \
+ -DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
+ -DVTK_PYTHON_VERSION=3 \
+ -DVTK_USE_MPI=ON \
+ -DVTK_USE_TK=ON \
+ -DVTK_VERSIONED_INSTALL=OFF \
+ -DVTK_WRAP_JAVA=ON \
+ -DVTK_WRAP_PYTHON=ON \
+ -DVTKOSPRAY_ENABLE_DENOISER=ON \
+ -DVTKm_ENABLE_HDF5_IO=ON \
+ -DVTKm_ENABLE_MPI=ON \
+ -DVTKm_ENABLE_OPENMP=ON \
+ -DVTK_USE_EXTERNAL=ON \
+ -DVTK_MODULE_USE_EXTERNAL_VTK_cli11=OFF \
+ -DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF \
+ -DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF \
+ -DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF \
+ -DVTK_MODULE_ENABLE_VTK_DomainsMicroscopy=NO \
+ -DVTK_MODULE_ENABLE_VTK_FiltersOpenTURNS=NO \
+ -Wno-dev
+# -DFIDES_USE_EXTERNAL_RAPIDJSON=ON \
+ make -C build
+}
+
+package() {
+ make -C build DESTDIR="${pkgdir}" install
+
+ # Move the vtk.jar to the arch-specific location…
+ install -dv "${pkgdir}"/usr/share/java/vtk
+ mv -v "${pkgdir}"/usr/lib/java/vtk.jar "${pkgdir}"/usr/share/java/vtk
+ # …and the libs to the proper place
+ mv "${pkgdir}"/usr/lib/java/vtk-Linux-x86_64/*.so "${pkgdir}"/usr/lib/
+ rmdir "${pkgdir}"/usr/lib/java/{vtk-Linux-x86_64/,}
+
+ # Remove third party CMake patching for older versions than ours
+ rm -rv "${pkgdir}"/usr/lib/cmake/vtk/patches/3.{1{3,6,8,9},20}
+ # … as well as duplicate copies
+ rm -rv "${pkgdir}"/usr/lib/cmake/vtk/vtkm/{Find*.cmake,cmake/{Find*.cmake,3.15}}
+}
Copied: vtk/repos/community-staging-x86_64/ffmpeg5.patch (from rev 1133127, vtk/trunk/ffmpeg5.patch)
===================================================================
--- community-staging-x86_64/ffmpeg5.patch (rev 0)
+++ community-staging-x86_64/ffmpeg5.patch 2022-02-14 11:45:10 UTC (rev 1133128)
@@ -0,0 +1,158 @@
+From bad8f3e9d0aad03e8f2aff9524cb3c5f2d10ccaf Mon Sep 17 00:00:00 2001
+From: Ben Boeckel <ben.boeckel at kitware.com>
+Date: Fri, 28 Jan 2022 10:44:28 -0500
+Subject: [PATCH] IO/FFMPEG: support FFmpeg 5.0 API changes
+
+Fixes: #18445
+---
+ Documentation/release/dev/ffmpeg-5.0.md | 3 +++
+ IO/FFMPEG/CMakeLists.txt | 18 +++++++++++++++--
+ IO/FFMPEG/vtkFFMPEGVideoSource.cxx | 4 ++--
+ IO/FFMPEG/vtkFFMPEGWriter.cxx | 27 +++++++++++++------------
+ 4 files changed, 35 insertions(+), 17 deletions(-)
+ create mode 100644 Documentation/release/dev/ffmpeg-5.0.md
+
+diff --git a/Documentation/release/dev/ffmpeg-5.0.md b/Documentation/release/dev/ffmpeg-5.0.md
+new file mode 100644
+index 00000000000..02ebd3ff840
+--- /dev/null
++++ b/Documentation/release/dev/ffmpeg-5.0.md
+@@ -0,0 +1,3 @@
++## FFmpeg 5.0 support
++
++FFmpeg 5.0 API changes are now supported.
+diff --git a/IO/FFMPEG/CMakeLists.txt b/IO/FFMPEG/CMakeLists.txt
+index f6900843ac0..ed43978cfc6 100644
+--- a/IO/FFMPEG/CMakeLists.txt
++++ b/IO/FFMPEG/CMakeLists.txt
+@@ -6,7 +6,9 @@ vtk_module_find_package(
+ avformat
+ avcodec
+ avutil
+- swscale)
++ swscale
++ OPTIONAL_COMPONENTS
++ swresample)
+
+ set(classes
+ vtkFFMPEGWriter)
+@@ -21,6 +23,17 @@ if (NOT FFMPEG_VERSION VERSION_LESS "3.1")
+ vtkFFMPEGVideoSource)
+ endif ()
+
++set(ffmpeg_libraries)
++if (NOT FFMPEG_VERSION VERSION_LESS "5.0")
++ if (NOT FFMPEG_swresample_FOUND)
++ message(FATAL_ERROR
++ "FFMPEG 5.0 requires the `swresample` library.")
++ endif ()
++
++ list(APPEND ffmpeg_libraries
++ FFMPEG::swresample)
++endif ()
++
+ vtk_module_add_module(VTK::IOFFMPEG
+ CLASSES ${classes})
+ vtk_module_link(VTK::IOFFMPEG
+@@ -28,4 +41,5 @@ vtk_module_link(VTK::IOFFMPEG
+ FFMPEG::avformat
+ FFMPEG::avcodec
+ FFMPEG::avutil
+- FFMPEG::swscale)
++ FFMPEG::swscale
++ ${ffmpeg_libraries})
+diff --git a/IO/FFMPEG/vtkFFMPEGVideoSource.cxx b/IO/FFMPEG/vtkFFMPEGVideoSource.cxx
+index 45900ee02bc..f3169d3545d 100644
+--- a/IO/FFMPEG/vtkFFMPEGVideoSource.cxx
++++ b/IO/FFMPEG/vtkFFMPEGVideoSource.cxx
+@@ -205,7 +205,7 @@ void vtkFFMPEGVideoSource::Initialize()
+
+ this->Internal->VideoStream = fcontext->streams[this->Internal->VideoStreamIndex];
+
+- AVCodec* dec = avcodec_find_decoder(this->Internal->VideoStream->codecpar->codec_id);
++ const AVCodec* dec = avcodec_find_decoder(this->Internal->VideoStream->codecpar->codec_id);
+ if (!dec)
+ {
+ vtkErrorMacro("Failed to find codec for video");
+@@ -271,7 +271,7 @@ void vtkFFMPEGVideoSource::Initialize()
+ {
+ this->Internal->AudioStream = fcontext->streams[this->Internal->AudioStreamIndex];
+
+- AVCodec* adec = avcodec_find_decoder(this->Internal->AudioStream->codecpar->codec_id);
++ const AVCodec* adec = avcodec_find_decoder(this->Internal->AudioStream->codecpar->codec_id);
+ if (!adec)
+ {
+ vtkErrorMacro("Failed to find codec for audio");
+diff --git a/IO/FFMPEG/vtkFFMPEGWriter.cxx b/IO/FFMPEG/vtkFFMPEGWriter.cxx
+index 5011b40f579..5d284b088ed 100644
+--- a/IO/FFMPEG/vtkFFMPEGWriter.cxx
++++ b/IO/FFMPEG/vtkFFMPEGWriter.cxx
+@@ -21,10 +21,17 @@
+
+ extern "C"
+ {
++#include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+ #include <libswscale/swscale.h>
+ }
+
++#if LIBAVFORMAT_VERSION_MAJOR < 59
++#define vtk_ff_const59
++#else
++#define vtk_ff_const59 const
++#endif
++
+ #if defined(LIBAVFORMAT_VERSION_MAJOR) && LIBAVFORMAT_VERSION_MAJOR >= 57
+ extern "C"
+ {
+@@ -51,7 +58,7 @@ private:
+
+ AVFormatContext* avFormatContext;
+
+- AVOutputFormat* avOutputFormat;
++ vtk_ff_const59 AVOutputFormat* avOutputFormat;
+
+ AVStream* avStream;
+
+@@ -115,15 +122,9 @@ int vtkFFMPEGWriterInternal::Start()
+ return 0;
+ }
+
+- if (this->Writer->GetCompression())
+- {
+- // choose a codec that is easily playable on windows
+- this->avOutputFormat->video_codec = AV_CODEC_ID_MJPEG;
+- }
+- else
+- {
+- this->avOutputFormat->video_codec = AV_CODEC_ID_RAWVIDEO;
+- }
++ enum AVCodecID video_codec = this->Writer->GetCompression()
++ ? AV_CODEC_ID_MJPEG // choose a codec that is easily playable on windows
++ : AV_CODEC_ID_RAWVIDEO;
+
+ // create the format context that wraps all of the media output structures
+ if (avformat_alloc_output_context2(
+@@ -133,8 +134,8 @@ int vtkFFMPEGWriterInternal::Start()
+ return 0;
+ }
+
+- AVCodec* codec;
+- if (!(codec = avcodec_find_encoder(this->avOutputFormat->video_codec)))
++ vtk_ff_const59 AVCodec* codec;
++ if (!(codec = avcodec_find_encoder(video_codec)))
+ {
+ vtkGenericWarningMacro(<< "Failed to get video codec.");
+ return 0;
+@@ -155,7 +156,7 @@ int vtkFFMPEGWriterInternal::Start()
+ return 0;
+ }
+
+- this->avStream->codecpar->codec_id = static_cast<AVCodecID>(this->avOutputFormat->video_codec);
++ this->avStream->codecpar->codec_id = video_codec;
+ this->avStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ this->avStream->codecpar->width = this->Dim[0];
+ this->avStream->codecpar->height = this->Dim[1];
+--
+GitLab
+
More information about the arch-commits
mailing list