Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Nov 2016 05:38:39 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r425288 - in branches/2016Q4/multimedia/pHash: . files
Message-ID:  <201611040538.uA45cd3j060207@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Nov  4 05:38:39 2016
New Revision: 425288
URL: https://svnweb.freebsd.org/changeset/ports/425288

Log:
  MFH: r425287
  
  multimedia/pHash: unbreak build with ffmpeg 3.x
  
    =======================<phase: configure      >============================
    [...]
    *** Configuring video Hash ***
  
    checking whether FFmpeg is present... checking for avcodec_alloc_frame in -lavcodec... no
    configure: error:
  
    *** libavcodec not found.
  
  PR:		214178
  Approved by:	Naram Qashat <cyberbotx@cyberbotx.com> (maintainer)
  Approved by:	ports-secteam (delphij)

Added:
  branches/2016Q4/multimedia/pHash/files/patch-ffmpeg30
     - copied unchanged from r425287, head/multimedia/pHash/files/patch-ffmpeg30
Modified:
  branches/2016Q4/multimedia/pHash/Makefile
Directory Properties:
  branches/2016Q4/   (props changed)

Modified: branches/2016Q4/multimedia/pHash/Makefile
==============================================================================
--- branches/2016Q4/multimedia/pHash/Makefile	Fri Nov  4 04:48:11 2016	(r425287)
+++ branches/2016Q4/multimedia/pHash/Makefile	Fri Nov  4 05:38:39 2016	(r425288)
@@ -3,6 +3,7 @@
 
 PORTNAME=	pHash
 PORTVERSION=	0.9.6
+PORTREVISION=	1
 CATEGORIES=	multimedia devel
 MASTER_SITES=	http://phash.org/releases/ \
 		http://www.cyberbotx.com/pHash/
@@ -54,4 +55,8 @@ VIDEO_BUILD_DEPENDS=	${LOCALBASE}/includ
 VIDEO_RUN_DEPENDS=	${LOCALBASE}/include/CImg.h:graphics/cimg
 VIDEO_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
 
+post-patch:
+# Avoid USES=autoreconf while keeping configure.ac patch for reference
+	@${TOUCH} -r ${WRKSRC}/aclocal.m4 ${WRKSRC}/configure.ac
+
 .include <bsd.port.mk>

Copied: branches/2016Q4/multimedia/pHash/files/patch-ffmpeg30 (from r425287, head/multimedia/pHash/files/patch-ffmpeg30)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q4/multimedia/pHash/files/patch-ffmpeg30	Fri Nov  4 05:38:39 2016	(r425288, copy of r425287, head/multimedia/pHash/files/patch-ffmpeg30)
@@ -0,0 +1,139 @@
+--- configure.orig	2013-04-23 18:48:24 UTC
++++ configure
+@@ -16009,9 +16009,9 @@ if test "x$enable_video_hash" != "xno"; 
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FFmpeg is present" >&5
+ $as_echo_n "checking whether FFmpeg is present... " >&6; }
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_alloc_frame in -lavcodec" >&5
+-$as_echo_n "checking for avcodec_alloc_frame in -lavcodec... " >&6; }
+-if ${ac_cv_lib_avcodec_avcodec_alloc_frame+:} false; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_decode_video2 in -lavcodec" >&5
++$as_echo_n "checking for avcodec_decode_video2 in -lavcodec... " >&6; }
++if ${ac_cv_lib_avcodec_avcodec_decode_video2+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+@@ -16025,27 +16025,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char avcodec_alloc_frame ();
++char avcodec_decode_video2 ();
+ int
+ main ()
+ {
+-return avcodec_alloc_frame ();
++return avcodec_decode_video2 ();
+   ;
+   return 0;
+ }
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+-  ac_cv_lib_avcodec_avcodec_alloc_frame=yes
++  ac_cv_lib_avcodec_avcodec_decode_video2=yes
+ else
+-  ac_cv_lib_avcodec_avcodec_alloc_frame=no
++  ac_cv_lib_avcodec_avcodec_decode_video2=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_alloc_frame" >&5
+-$as_echo "$ac_cv_lib_avcodec_avcodec_alloc_frame" >&6; }
+-if test "x$ac_cv_lib_avcodec_avcodec_alloc_frame" = xyes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_decode_video2" >&5
++$as_echo "$ac_cv_lib_avcodec_avcodec_decode_video2" >&6; }
++if test "x$ac_cv_lib_avcodec_avcodec_decode_video2" = xyes; then :
+   cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBAVCODEC 1
+ _ACEOF
+--- configure.ac.orig	2013-04-23 18:47:49 UTC
++++ configure.ac
+@@ -122,7 +122,7 @@ fi])
+ AC_DEFUN([AC_CHECK_FFMPEG],
+ [
+ AC_MSG_CHECKING([whether FFmpeg is present])
+-AC_CHECK_LIB([avcodec], [avcodec_alloc_frame], [], [AC_MSG_ERROR([
++AC_CHECK_LIB([avcodec], [avcodec_decode_video2], [], [AC_MSG_ERROR([
+ 
+ *** libavcodec not found.
+ You need FFmpeg. Get it at <http://ffmpeg.org/>])])
+--- src/cimgffmpeg.cpp.orig	2012-11-23 20:58:01 UTC
++++ src/cimgffmpeg.cpp
+@@ -39,11 +39,11 @@ void vfinfo_close(VFInfo  *vfinfo){
+ int ReadFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList, unsigned int low_index, unsigned int hi_index)
+ {
+         //target pixel format
+-	PixelFormat ffmpeg_pixfmt;
++	AVPixelFormat ffmpeg_pixfmt;
+ 	if (st_info->pixelformat == 0)
+-	    ffmpeg_pixfmt = PIX_FMT_GRAY8;
++	    ffmpeg_pixfmt = AV_PIX_FMT_GRAY8;
+ 	else 
+-	    ffmpeg_pixfmt = PIX_FMT_RGB24;
++	    ffmpeg_pixfmt = AV_PIX_FMT_RGB24;
+ 
+ 	st_info->next_index = low_index;
+ 
+@@ -100,12 +100,12 @@ int ReadFrames(VFInfo *st_info, CImgList
+         AVFrame *pFrame;
+ 
+ 	// Allocate video frame
+-	pFrame=avcodec_alloc_frame();
++	pFrame=av_frame_alloc();
+ 	if (pFrame==NULL)
+ 	    return -1;
+ 
+ 	// Allocate an AVFrame structure
+-	AVFrame *pConvertedFrame = avcodec_alloc_frame();
++	AVFrame *pConvertedFrame = av_frame_alloc();
+ 	if(pConvertedFrame==NULL)
+ 	  return -1;
+ 		
+@@ -123,7 +123,7 @@ int ReadFrames(VFInfo *st_info, CImgList
+ 	int size = 0;
+ 	
+ 
+-        int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3;
++        int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3;
+ 
+ 	AVPacket packet;
+ 	int result = 1;
+@@ -189,11 +189,11 @@ int ReadFrames(VFInfo *st_info, CImgList
+ 
+ int NextFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList)
+ {
+-        PixelFormat ffmpeg_pixfmt;
++        AVPixelFormat ffmpeg_pixfmt;
+ 	if (st_info->pixelformat == 0)
+-	    ffmpeg_pixfmt = PIX_FMT_GRAY8;
++	    ffmpeg_pixfmt = AV_PIX_FMT_GRAY8;
+         else 
+-	    ffmpeg_pixfmt = PIX_FMT_RGB24;
++	    ffmpeg_pixfmt = AV_PIX_FMT_RGB24;
+ 
+ 	if (st_info->pFormatCtx == NULL)
+ 	{
+@@ -254,10 +254,10 @@ int NextFrames(VFInfo *st_info, CImgList
+ 	AVFrame *pFrame;
+ 
+ 	// Allocate video frame
+-	pFrame=avcodec_alloc_frame();
++	pFrame=av_frame_alloc();
+ 		
+ 	// Allocate an AVFrame structure
+-	AVFrame *pConvertedFrame = avcodec_alloc_frame();
++	AVFrame *pConvertedFrame = av_frame_alloc();
+ 	if(pConvertedFrame==NULL){
+ 	  return -1;
+ 	}
+@@ -287,7 +287,7 @@ int NextFrames(VFInfo *st_info, CImgList
+ 			break;
+ 		if(packet.stream_index == st_info->videoStream) {
+ 			
+-		int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3;
++		int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3;
+  		AVPacket avpkt;
+                 av_init_packet(&avpkt);
+                 avpkt.data = packet.data;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611040538.uA45cd3j060207>