From owner-svn-ports-all@freebsd.org Fri Nov 4 04:48:13 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04E10C2E076; Fri, 4 Nov 2016 04:48:13 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D40721664; Fri, 4 Nov 2016 04:48:12 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA44mCuF040924; Fri, 4 Nov 2016 04:48:12 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA44mB6p040923; Fri, 4 Nov 2016 04:48:11 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201611040448.uA44mB6p040923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Fri, 4 Nov 2016 04:48:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r425287 - in head/multimedia/pHash: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2016 04:48:13 -0000 Author: jbeich Date: Fri Nov 4 04:48:11 2016 New Revision: 425287 URL: https://svnweb.freebsd.org/changeset/ports/425287 Log: multimedia/pHash: unbreak build with ffmpeg 3.x =================================================== [...] *** 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 (maintainer) MFH: 2016Q4 Added: head/multimedia/pHash/files/patch-ffmpeg30 (contents, props changed) Modified: head/multimedia/pHash/Makefile (contents, props changed) Modified: head/multimedia/pHash/Makefile ============================================================================== --- head/multimedia/pHash/Makefile Fri Nov 4 03:39:42 2016 (r425286) +++ head/multimedia/pHash/Makefile Fri Nov 4 04:48:11 2016 (r425287) @@ -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 Added: head/multimedia/pHash/files/patch-ffmpeg30 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/pHash/files/patch-ffmpeg30 Fri Nov 4 04:48:11 2016 (r425287) @@ -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 ])]) +--- 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 *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 *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;