[Fink-devel] patch video-oct to use newer

2015-02-14 Thread Hanspeter Niederstrasser
Attached are .info/.patch files to update video-oct to use newer 
versions of ffmpeg and not the really old libavcodec53 library.


The patch is primarily from here (unreleased upstream):
https://sourceforge.net/p/octave/video/ci/7caa40bb8a47ba943d63f16896b4771854ebfd68/

But I also added the chunk around line 124 from here:
https://github.com/tufei/octave-forge-video/commit/19119e2ec936285c6e7e4fc903d97d7f3efc8648#diff-ee390d07771903074cab05b278a4bf4aL123

because av_set_parameters no longer exists and I couldn't find a 
replacement for that function


I also removed -D__STDC_CONSTANT_MACROS from CXXFLAGS because it was 
giving a lot of __STDC_CONSTANT_MACROS macro redefined warnings. There 
are still UINT64_C redefined issues which might be taken care of with 
https://sourceforge.net/p/octave/video/ci/c341586726c96ca5aa5821b38792b1bf7fe8adc0/#diff-8 
from a later commit, but I didn't test it in order to minimize the 
cherry picking.


This built with ffmpeg-1.2, -2.0, and -2.4, but I have no way of knowing 
if the resulting build actually works and doesn't cause total protonic 
reversal.


Hanspeter
Info2: 
Package: video-oct%type_pkg[oct]
Version: 1.0.2
Type: oct (3.0.5 3.2.4 3.4.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4), forge (video), gcc 
(4.9)
Revision: 6
Distribution: (%type_pkg[oct]  364) 10.7, (%type_pkg[oct]  364) 10.8

Maintainer: Alexander Hansen alexkhan...@users.sourceforge.net
Homepage: http://octave.sourceforge.net/video/index.html 
Description: FFmpeg interface for Octave
DescDetail: 
Implements addframe, avifile, aviinfo, and aviread, using ffmpeg. (and
approximately conforms to the Matlab interface)

This package provides the following functions:
addframe
avifile
aviinfo
aviread


License: BSD

# reported to have issues with ffmpeg suite newer than avcodec53
# possible fixes:
#   https://github.com/tufei/octave-forge-video
#   http://lists.gnu.org/archive/html/help-octave/2011-12/msg00405.html
BuildDepends: 
  ( %type_pkg[oct]  360 ) liboctave%type_pkg[oct]-gcc%type_pkg[gcc]-dev, 
  ( %type_pkg[oct] = 360 ) liboctave%type_pkg[oct]-dev,
  fftw3,
  ( %type_pkg[oct] = 305 ) hdf5.9-oldapi,
  ( %type_pkg[oct] != 305 ) hdf5.9,
  libavcodec56-2.4-dev,
  libavformat56-2.4-dev,
  libavutil54-2.4-dev,
  libswscale3-2.4-dev,
  pkgconfig,
  fink-octave-scripts (= 0.3.0-1)

Depends: 
  octave%type_pkg[oct]-interpreter,
  libavcodec56-2.4-shlibs,
  libavformat56-2.4-shlibs,
  libavutil54-2.4-shlibs,
  libswscale3-2.4-shlibs,
  ( %type_pkg[oct]  360 ) gcc%type_pkg[gcc]-shlibs

Conflicts: octave-forge

Source: 
mirror:sourceforge:octave/Octave%%20Forge%%20Packages/R2009-05-08/%type_raw[forge]-%v.tar.gz
Source-MD5: e45e827ce5f409191aa9e9a61058e4ce

PatchFile: %{ni}.patch
PatchFile-MD5: b50739043be90e99f33ae10de3b8c7be
PatchScript: 
%{default_script}


NoSetCPPFLAGS: true
NoSetLDFLAGS: true
UseMaxBuildJobs: false
BuildAsNobody: false

CompileScript: 
#!/bin/sh -ev
pkgsrc=%type_raw[forge]-%v

# Invariant stuff begins here #
%p/share/fink-octave-scripts/octave-forge-patch.sh %type_raw[forge] %v 
%type_raw[oct] %b %i $pkgsrc
export PKG_CONFIG_PATH=%p/lib/ffmpeg-2.4/lib/pkgconfig:$PKG_CONFIG_PATH
./octave-forge-compile.sh


InstallScript: ./octave-forge-install.sh
PostInstScript:  
%p/share/octave/%type_raw[oct]/%type_raw[forge]/octave-forge-postinst.sh
PreRmScript: 
%p/share/octave/%type_raw[oct]/%type_raw[forge]/octave-forge-prerm.sh

DescPackaging: 
For this package:
Numerous patches to use ffmpeg-0.8.4.

Common for all octave-forge packages:
Preinst and postinst scripts are dynamically set up via 
%p/share/fink-octave-scripts/octave-forge-patch.sh because Octave's package 
manager 
can't cope with non-literal arguments.

The Type: forge (pkgname) is used to minimize what needs to be changed when
using this .info file as a template, or when the package name contains 
underscores.


diff -Nurd video-1.0.2/src/AVHandler.cc video-1.0.2.patched/src/AVHandler.cc
--- video-1.0.2/src/AVHandler.cc2009-05-08 08:17:36.0 -0500
+++ video-1.0.2.patched/src/AVHandler.cc2015-02-14 05:56:20.0 
-0600
@@ -64,7 +64,7 @@
if (av_output-pb-buf_ptr) {
while (write_frame()  0) {}
av_write_trailer(av_output);
-   if (url_fclose( av_output-pb )  0)
+   if (avio_close( av_output-pb )  0)
(*out)  AVHandler: cannot close output file  std::endl;
}
av_free(av_output);
@@ -78,7 +78,7 @@
 }
 
 if (av_input) {
-   av_close_input_file(av_input);
+   avformat_close_input(av_input);
 } else {
// close output stream
if (vstream) av_freep(vstream);
@@ -94,8 +94,8 @@
 AVHandler::setup_write() {
 av_register_all();
 
-AVOutputFormat *avifmt;   
-for (avifmt = first_oformat; avifmt != NULL; avifmt = avifmt-next) {
+AVOutputFormat *avifmt = NULL;   
+while (NULL != (avifmt = av_oformat_next(avifmt))) {
if (std::string(avifmt-name) == avi) 

Re: [Fink-devel] patch video-oct to use newer

2015-02-14 Thread Alexander Hansen

 On Feb 14, 2015, at 5:08 AM, Hanspeter Niederstrasser 
 f...@snaggledworks.com wrote:
 
 Attached are .info/.patch files to update video-oct to use newer versions of 
 ffmpeg and not the really old libavcodec53 library.
 
 The patch is primarily from here (unreleased upstream):
 https://sourceforge.net/p/octave/video/ci/7caa40bb8a47ba943d63f16896b4771854ebfd68/
 
 But I also added the chunk around line 124 from here:
 https://github.com/tufei/octave-forge-video/commit/19119e2ec936285c6e7e4fc903d97d7f3efc8648#diff-ee390d07771903074cab05b278a4bf4aL123
 
 because av_set_parameters no longer exists and I couldn't find a replacement 
 for that function
 
 I also removed -D__STDC_CONSTANT_MACROS from CXXFLAGS because it was giving a 
 lot of __STDC_CONSTANT_MACROS macro redefined warnings. There are still 
 UINT64_C redefined issues which might be taken care of with 
 https://sourceforge.net/p/octave/video/ci/c341586726c96ca5aa5821b38792b1bf7fe8adc0/#diff-8
  from a later commit, but I didn't test it in order to minimize the cherry 
 picking.
 
 This built with ffmpeg-1.2, -2.0, and -2.4, but I have no way of knowing if 
 the resulting build actually works and doesn't cause total protonic reversal.
 
 Hanspeter
 video-oct.infovideo-oct.patch

The Octave video package hasn’t gotten a lot of upstream love, so I’m not too 
worried.  Go ahead and commit something that builds—I’m going to be doing a lot 
of running around this weekend.

-- 
Alexander Hansen, Ph.D.
Fink User Liaison


--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] patch video-oct to use newer

2015-02-14 Thread Hanspeter Niederstrasser
On 2/14/2015 11:01 AM, Alexander Hansen wrote:

 On Feb 14, 2015, at 5:08 AM, Hanspeter Niederstrasser 
 f...@snaggledworks.com wrote:

 Attached are .info/.patch files to update video-oct to use newer versions of 
 ffmpeg and not the really old libavcodec53 library.

 The patch is primarily from here (unreleased upstream):
 https://sourceforge.net/p/octave/video/ci/7caa40bb8a47ba943d63f16896b4771854ebfd68/

 But I also added the chunk around line 124 from here:
 https://github.com/tufei/octave-forge-video/commit/19119e2ec936285c6e7e4fc903d97d7f3efc8648#diff-ee390d07771903074cab05b278a4bf4aL123

 because av_set_parameters no longer exists and I couldn't find a replacement 
 for that function

 I also removed -D__STDC_CONSTANT_MACROS from CXXFLAGS because it was giving 
 a lot of __STDC_CONSTANT_MACROS macro redefined warnings. There are still 
 UINT64_C redefined issues which might be taken care of with 
 https://sourceforge.net/p/octave/video/ci/c341586726c96ca5aa5821b38792b1bf7fe8adc0/#diff-8
  from a later commit, but I didn't test it in order to minimize the cherry 
 picking.

 This built with ffmpeg-1.2, -2.0, and -2.4, but I have no way of knowing if 
 the resulting build actually works and doesn't cause total protonic reversal.

 Hanspeter
 video-oct.infovideo-oct.patch

 The Octave video package hasn’t gotten a lot of upstream love, so I’m not too 
 worried.  Go ahead and commit something that builds—I’m going to be doing a 
 lot of running around this weekend.

Committed to CVS.  And libavcodec53 is now EOL.

Hanspeter


--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel