[149255] trunk/dports/science/paraview

dstrubbe at macports.org dstrubbe at macports.org
Tue Jun 7 14:52:42 PDT 2016


Revision: 149255
          https://trac.macports.org/changeset/149255
Author:   dstrubbe at macports.org
Date:     2016-06-07 14:52:42 -0700 (Tue, 07 Jun 2016)
Log Message:
-----------
paraview: Re-enable +ffmpeg with upstream patch. Fixes #51578 (maintainer).

Modified Paths:
--------------
    trunk/dports/science/paraview/Portfile

Added Paths:
-----------
    trunk/dports/science/paraview/files/ffmpeg3_compat.patch

Modified: trunk/dports/science/paraview/Portfile
===================================================================
--- trunk/dports/science/paraview/Portfile	2016-06-07 19:12:06 UTC (rev 149254)
+++ trunk/dports/science/paraview/Portfile	2016-06-07 21:52:42 UTC (rev 149255)
@@ -9,9 +9,7 @@
 
 name                paraview
 version             5.0.1
-# versions 4.3.1 and 4.4.0 have some issues; see Notes section of https://github.com/OpenFOAM/ThirdParty-dev/
-# so just patch them?
-revision            0
+revision            1
 
 categories          science graphics
 platforms           darwin
@@ -40,9 +38,11 @@
 
 #:info:build ld: file not found: @rpath/libIceTMPI.dylib for architecture x86_64
 # https://github.com/OpenFOAM/ThirdParty-dev/
+# http://www.paraview.org/Bug/view.php?id=16001
 patchfiles          patch-ThirdParty-IceT-vtkicet-CMakeLists.txt.diff \
     patch-VTK-Cmake-GenerateExportHeader.cmake \
-    patch-VTK-Cmake-vtkCompilerExtras.cmake
+    patch-VTK-Cmake-vtkCompilerExtras.cmake \
+    ffmpeg3_compat.patch
 
 depends_build-append    port:readline \
     port:netcdf \
@@ -126,15 +126,12 @@
         "\n Currently Paraview installs as an app, including the Python modules. To use with macports python, add /Applications/Macports/paraview.app/Contents/Python/:/Applications/MacPorts/paraview.app/Contents/Libraries/ to PYTHONPATH and /Applications/MacPorts/paraview.app/Contents/Libraries/ to DYLD_LIBRARY_PATH. Also, simultaneous use of Mayavi may result in segfault."
 }
 
-# does not work, gives:
-# VTK/IO/FFMPEG/vtkFFMPEGWriter.cxx:281:36: error: use of undeclared identifier 'PIX_FMT_RGB24'; did you mean 'AV_PIX_FMT_RGB24'?
-#variant ffmpeg description {Add support for FFMPEG} {
-#    depends_lib-append port:ffmpeg
-#    configure.args-append -DPARAVIEW_ENABLE_FFMPEG:BOOL=ON
-#}
+variant ffmpeg description {Add support for FFMPEG} {
+   depends_lib-append port:ffmpeg
+   configure.args-append -DPARAVIEW_ENABLE_FFMPEG:BOOL=ON
+}
 
-default_variants-append    +python27
-#+ffmpeg
+default_variants-append    +python27 +ffmpeg
 
 livecheck.type      regex
 livecheck.url       ${homepage}

Added: trunk/dports/science/paraview/files/ffmpeg3_compat.patch
===================================================================
--- trunk/dports/science/paraview/files/ffmpeg3_compat.patch	                        (rev 0)
+++ trunk/dports/science/paraview/files/ffmpeg3_compat.patch	2016-06-07 21:52:42 UTC (rev 149255)
@@ -0,0 +1,60 @@
+--- VTK/IO/FFMPEG/vtkFFMPEGWriter.cxx
++++ VTK/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);
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160607/d2eeaf0f/attachment.html>


More information about the macports-changes mailing list