Bug 188317 - emulators/vice fails to build due to ffmpeg error
emulators/vice fails to build due to ffmpeg error
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Dirk Meyer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-06 17:00 UTC by Jens Grassel
Modified: 2014-04-07 16:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Grassel 2014-04-06 17:00:00 UTC
If I try to build the vice port it fails to compile with the following error message:

In file included from ffmpegdrv.c:35:
ffmpeglib.h:73: warning: 'enum CodecID' declared inside parameter list
ffmpeglib.h:73: warning: its scope is only this definition or declaration, which is probably
 not what you want
ffmpeglib.h:83: error: expected declaration specifiers or '...' before 'AVFormatParameters'
ffmpeglib.h:87: error: expected ')' before '*' token
ffmpeglib.h:88: error: expected ')' before '*' token
ffmpeglib.h:125: error: expected specifier-qualifier-list before 'url_fopen_t'
In file included from ffmpeglib.c:32:
./../src/gfxoutputdrv/ffmpeglib.h:73: warning: 'enum CodecID' declared inside parameter lis
t
ffmpegdrv.c: In function 'ffmpegdrv_open_audio':
ffmpegdrv.c:260: error: type of formal parameter 1 is incomplete
./../src/gfxoutputdrv/ffmpeglib.h:73: warning: its scope is only this definition or declara
tion, which is probably not what you want
./../src/gfxoutputdrv/ffmpeglib.h:83: error: expected declaration specifiers or '...' befor
e 'AVFormatParameters'
ffmpegdrv.c: In function 'ffmpegmovie_init_audio':../../src/gfxoutputdrv/ffmpeglib.h:87: err
or: expected ')' before '*' token
./../src/gfxoutputdrv/ffmpeglib.h:88: error: expected ')' before '*' token
./../src/gfxoutputdrv/ffmpeglib.h:125: error: expected specifier-qualifier-list before 'url
_fopen_t'

ffmpegdrv.c:346: error: 'SAMPLE_FMT_S16' undeclared (first use in this function)
ffmpegdrv.c:346: error: (Each undeclared identifier is reported only once
ffmpegdrv.c:346: error: for each function it appears in.)
ffmpegdrv.c: In function 'ffmpegdrv_open_video':
ffmpegdrv.c:467: error: type of formal parameter 1 is incomplete
ffmpegdrv.c: In function 'ffmpegdrv_close_video':
ffmpegdrv.c:535: error: 'ffmpeglib_t' has no member named 'p_sws_freeContext'
ffmpegdrv.c: In function 'ffmpegdrv_init_video':
ffmpegdrv.c:591: error: 'ffmpeglib_t' has no member named 'p_sws_getContext'
ffmpegdrv.c: In function 'ffmpegdrv_init_file':
ffmpegdrv.c:616: error: too many arguments to function 'ffmpeglib.p_av_set_parameters'
ffmpegdrv.c:621: error: 'ffmpeglib_t' has no member named 'p_dump_format'
ffmpegdrv.c:635: error: 'ffmpeglib_t' has no member named 'p_url_fopen'
ffmpegdrv.c:636: error: 'URL_WRONLY' undeclared (first use in this function)
ffmpegdrv.c: In function 'ffmpegdrv_save':
ffmpegdrv.c:664: error: 'ffmpeglib_t' has no member named 'p_av_guess_format'
ffmpegdrv.c:667: error: 'ffmpeglib_t' has no member named 'p_av_guess_format'
ffmpegdrv.c:679: error: type of formal parameter 1 is incomplete
ffmpegdrv.c:685: error: type of formal parameter 1 is incomplete
ffmpegdrv.c: In function 'ffmpegdrv_close':
ffmpegdrv.c:727: error: 'ffmpeglib_t' has no member named 'p_url_fclose'
ffmpegdrv.c:733: error: 'ffmpeglib_t' has no member named 'p_av_free'
ffmpegdrv.c: In function 'ffmpegdrv_record':
ffmpegdrv.c:806: error: 'ffmpeglib_t' has no member named 'p_sws_scale'
gmake[3]: *** [ffmpegdrv.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
ffmpeglib.c: In function 'load_avformat':
ffmpeglib.c:215: error: 'ffmpeglib_t' has no member named 'p_url_fopen'
ffmpeglib.c:215: error: 'url_fopen_t' undeclared (first use in this function)
ffmpeglib.c:215: error: (Each undeclared identifier is reported only once
ffmpeglib.c:215: error: for each function it appears in.)
ffmpeglib.c:215: error: expected ';' before 'vice_dynlib_symbol'
ffmpeglib.c:215: error: 'ffmpeglib_t' has no member named 'p_url_fopen'
ffmpeglib.c:216: error: 'ffmpeglib_t' has no member named 'p_url_fclose'
ffmpeglib.c:216: error: 'url_fclose_t' undeclared (first use in this function)
ffmpeglib.c:216: error: expected ';' before 'vice_dynlib_symbol'
ffmpeglib.c:216: error: 'ffmpeglib_t' has no member named 'p_url_fclose'
ffmpeglib.c:217: error: 'ffmpeglib_t' has no member named 'p_dump_format'
ffmpeglib.c:217: error: 'ffmpeglib_t' has no member named 'p_dump_format'
ffmpeglib.c:218: error: 'ffmpeglib_t' has no member named 'p_av_guess_format'
ffmpeglib.c:218: error: 'ffmpeglib_t' has no member named 'p_av_guess_format'
ffmpeglib.c: In function 'free_avformat':
ffmpeglib.c:247: error: 'ffmpeglib_t' has no member named 'p_url_fopen'
ffmpeglib.c:248: error: 'ffmpeglib_t' has no member named 'p_url_fclose'
ffmpeglib.c:249: error: 'ffmpeglib_t' has no member named 'p_dump_format'
ffmpeglib.c:250: error: 'ffmpeglib_t' has no member named 'p_av_guess_format'
ffmpeglib.c: In function 'load_avutil':
ffmpeglib.c:266: error: 'ffmpeglib_t' has no member named 'p_av_free'
ffmpeglib.c:266: error: 'ffmpeglib_t' has no member named 'p_av_free'
ffmpeglib.c: In function 'free_avutil':
ffmpeglib.c:285: error: 'ffmpeglib_t' has no member named 'p_av_free'
ffmpeglib.c: In function 'load_swscale':
ffmpeglib.c:300: error: 'ffmpeglib_t' has no member named 'p_sws_getContext'
ffmpeglib.c:300: error: 'ffmpeglib_t' has no member named 'p_sws_getContext'
ffmpeglib.c:301: error: 'ffmpeglib_t' has no member named 'p_sws_freeContext'
ffmpeglib.c:301: error: 'ffmpeglib_t' has no member named 'p_sws_freeContext'
ffmpeglib.c:302: error: 'ffmpeglib_t' has no member named 'p_sws_scale'
ffmpeglib.c:302: error: 'ffmpeglib_t' has no member named 'p_sws_scale'
ffmpeglib.c: In function 'free_swscale':
ffmpeglib.c:317: error: 'ffmpeglib_t' has no member named 'p_sws_getContext'
ffmpeglib.c:318: error: 'ffmpeglib_t' has no member named 'p_sws_freeContext'
ffmpeglib.c:319: error: 'ffmpeglib_t' has no member named 'p_sws_scale'
gmake[3]: *** [ffmpeglib.o] Error 1
gmake[3]: Leaving directory `/usr/ports/emulators/vice/work/vice-2.4/src/gfxoutputdrv'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/ports/emulators/vice/work/vice-2.4/src'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/ports/emulators/vice/work/vice-2.4/src'
gmake: *** [all-recursive] Error 1

How-To-Repeat: cd /usr/ports/emulators/vice
make install
Comment 1 Edwin Groothuis freebsd_committer 2014-04-06 20:25:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Dirk Meyer freebsd_committer 2014-04-07 13:20:58 UTC
State Changed
From-To: open->feedback
Comment 3 Dirk Meyer freebsd_committer 2014-04-07 13:29:03 UTC
State Changed
From-To: feedback->open
Comment 4 dfilter freebsd_committer 2014-04-07 14:18:25 UTC
Author: dinoex
Date: Mon Apr  7 13:18:20 2014
New Revision: 350470
URL: http://svnweb.freebsd.org/changeset/ports/350470
QAT: https://qat.redports.org/buildarchive/r350470/

Log:
  - fix build with ffmpeg2
  - make ffmpeg default
  PR:		188317
  Obtained from:	pld-linux.org

Added:
  head/emulators/vice/files/patch-ffmpegdrv.c   (contents, props changed)
  head/emulators/vice/files/patch-ffmpeglib.c   (contents, props changed)
  head/emulators/vice/files/patch-ffmpeglib.h   (contents, props changed)
Modified:
  head/emulators/vice/Makefile

Modified: head/emulators/vice/Makefile
==============================================================================
--- head/emulators/vice/Makefile	Mon Apr  7 13:16:29 2014	(r350469)
+++ head/emulators/vice/Makefile	Mon Apr  7 13:18:20 2014	(r350470)
@@ -3,7 +3,7 @@
 
 PORTNAME=	vice
 PORTVERSION=	2.4
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	emulators
 MASTER_SITES=	http://www.zimmers.net/anonftp/pub/cbm/crossplatform/emulators/VICE/ \
 		ftp://ftp.zimmers.net/pub/cbm/crossplatform/emulators/VICE/
@@ -19,7 +19,8 @@ BUILD_DEPENDS=	bdftopcf:${PORTSDIR}/x11-
 		mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale
 LIB_DEPENDS=	libpng15.so:${PORTSDIR}/graphics/png \
 		libgif.so:${PORTSDIR}/graphics/giflib \
-		libmp3lame.so:${PORTSDIR}/audio/lame
+		libmp3lame.so:${PORTSDIR}/audio/lame \
+		libavcodec.so:${PORTSDIR}/multimedia/ffmpeg
 
 RESTRICTED=	ROMs are copyrighted by Commodore Business Machines
 
@@ -41,7 +42,7 @@ CONFIGURE_ARGS+=	--enable-fullscreen --e
 #CONFIGURE_ARGS+=	--enable-parsid
 #CONFIGURE_ARGS+=	--enable-memmap
 
-MLINKS=		vice.1 x64.1 \
+LMLINKS=	vice.1 x64.1 \
 		vice.1 x128.1 \
 		vice.1 xvic.1 \
 		vice.1 xpet.1 \
@@ -89,7 +90,7 @@ PULSE_LIB_DEPENDS=	libpulse.so:${PORTSDI
 .include <bsd.port.options.mk>
 
 .if !defined(BUILDING_INDEX)
-__pmlinks1!= ${ECHO_CMD} '${MLINKS:S/    / /}' | ${AWK} \
+__pmlinks1!= ${ECHO_CMD} '${LMLINKS:S/    / /}' | ${AWK} \
 	'{ if (NF % 2 != 0) { print "broken"; exit; } \
 	for (i=1; i<=NF; i++) { \
 		if ( i % 2 == 0) { print " " $$i " ;"; } \
@@ -121,11 +122,6 @@ PLIST_SUB+=		FCCACHE="@comment "
 PLIST_SUB+=		NOFCCACHE=""
 .endif
 
-# will be picked up by configure
-.if exists(${LOCALBASE}/include/ffmpeg/avformat.h)
-LIB_DEPENDS+=		libavcodec.so:${PORTSDIR}/multimedia/ffmpeg
-.endif
-
 .if ${PORT_OPTIONS:MNLS}
 USES+=		gettext
 CONFIGURE_ARGS+=	--enable-nls --localedir=${LOCALBASE}/share/locale

Added: head/emulators/vice/files/patch-ffmpegdrv.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/vice/files/patch-ffmpegdrv.c	Mon Apr  7 13:18:20 2014	(r350470)
@@ -0,0 +1,52 @@
+--- src/gfxoutputdrv/ffmpegdrv.c.orig	2012-02-13 20:31:44.000000000 +0100
++++ src/gfxoutputdrv/ffmpegdrv.c	2012-11-25 13:10:46.712199998 +0100
+@@ -343,7 +343,7 @@ static int ffmpegmovie_init_audio(int sp
+     c = st->codec;
+     c->codec_id = ffmpegdrv_fmt->audio_codec;
+     c->codec_type = AVMEDIA_TYPE_AUDIO;
+-    c->sample_fmt = SAMPLE_FMT_S16;
++    c->sample_fmt = AV_SAMPLE_FMT_S16;
+ 
+     /* put sample parameters */
+     c->bit_rate = audio_bitrate;
+@@ -613,11 +613,6 @@ static int ffmpegdrv_init_file(void)
+     if (!video_init_done || !audio_init_done)
+         return 0;
+ 
+-    if ((*ffmpeglib.p_av_set_parameters)(ffmpegdrv_oc, NULL) < 0) {
+-        log_debug("ffmpegdrv: Invalid output format parameters");
+-            return -1;
+-    }
+-
+     (*ffmpeglib.p_dump_format)(ffmpegdrv_oc, 0, ffmpegdrv_oc->filename, 1);
+ 
+     if (video_st && (ffmpegdrv_open_video(ffmpegdrv_oc, video_st) < 0)) {
+@@ -632,8 +627,8 @@ static int ffmpegdrv_init_file(void)
+     }
+ 
+     if (!(ffmpegdrv_fmt->flags & AVFMT_NOFILE)) {
+-        if ((*ffmpeglib.p_url_fopen)(&ffmpegdrv_oc->pb, ffmpegdrv_oc->filename,
+-                            URL_WRONLY) < 0) 
++        if ((*ffmpeglib.p_avio_open)(&ffmpegdrv_oc->pb, ffmpegdrv_oc->filename,
++                            AVIO_FLAG_WRITE) < 0) 
+         {
+             ui_error(translate_text(IDGS_FFMPEG_CANNOT_OPEN_S), ffmpegdrv_oc->filename);
+             screenshot_stop_recording();
+@@ -642,7 +637,7 @@ static int ffmpegdrv_init_file(void)
+ 
+     }
+ 
+-    (*ffmpeglib.p_av_write_header)(ffmpegdrv_oc);
++    (*ffmpeglib.p_avformat_write_header)(ffmpegdrv_oc, NULL);
+ 
+     log_debug("ffmpegdrv: Initialized file successfully");
+ 
+@@ -724,7 +719,7 @@ static int ffmpegdrv_close(screenshot_t
+         (*ffmpeglib.p_av_write_trailer)(ffmpegdrv_oc);
+         if (!(ffmpegdrv_fmt->flags & AVFMT_NOFILE)) {
+             /* close the output file */
+-            (*ffmpeglib.p_url_fclose)(ffmpegdrv_oc->pb);
++            (*ffmpeglib.p_avio_close)(ffmpegdrv_oc->pb);
+         }
+     }
+     

Added: head/emulators/vice/files/patch-ffmpeglib.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/vice/files/patch-ffmpeglib.c	Mon Apr  7 13:18:20 2014	(r350470)
@@ -0,0 +1,34 @@
+--- src/gfxoutputdrv/ffmpeglib.c.orig	2011-09-18 15:09:45.000000000 +0200
++++ src/gfxoutputdrv/ffmpeglib.c	2012-11-25 13:11:58.342198505 +0100
+@@ -208,12 +208,11 @@ static int load_avformat(ffmpeglib_t *li
+         GET_SYMBOL_AND_TEST_AVFORMAT(av_init_packet);
+         GET_SYMBOL_AND_TEST_AVFORMAT(av_register_all);
+         GET_SYMBOL_AND_TEST_AVFORMAT(av_new_stream);
+-        GET_SYMBOL_AND_TEST_AVFORMAT(av_set_parameters);
+-        GET_SYMBOL_AND_TEST_AVFORMAT(av_write_header);
++        GET_SYMBOL_AND_TEST_AVFORMAT(avformat_write_header);
+         GET_SYMBOL_AND_TEST_AVFORMAT(av_write_frame);
+         GET_SYMBOL_AND_TEST_AVFORMAT(av_write_trailer);
+-        GET_SYMBOL_AND_TEST_AVFORMAT(url_fopen);
+-        GET_SYMBOL_AND_TEST_AVFORMAT(url_fclose);
++        GET_SYMBOL_AND_TEST_AVFORMAT(avio_open);
++        GET_SYMBOL_AND_TEST_AVFORMAT(avio_close);
+         GET_SYMBOL_AND_TEST_AVFORMAT(dump_format);
+         GET_SYMBOL_AND_TEST_AVFORMAT(av_guess_format);
+ #ifndef HAVE_FFMPEG_SWSCALE
+@@ -240,12 +239,11 @@ static void free_avformat(ffmpeglib_t *l
+     lib->p_av_init_packet = NULL;
+     lib->p_av_register_all = NULL;
+     lib->p_av_new_stream = NULL;
+-    lib->p_av_set_parameters = NULL;
+-    lib->p_av_write_header = NULL;
++    lib->p_avformat_write_header = NULL;
+     lib->p_av_write_frame = NULL;
+     lib->p_av_write_trailer = NULL;
+-    lib->p_url_fopen = NULL;
+-    lib->p_url_fclose = NULL;
++    lib->p_avio_open = NULL;
++    lib->p_avio_close = NULL;
+     lib->p_dump_format = NULL;
+     lib->p_av_guess_format = NULL;
+ #ifndef HAVE_FFMPEG_SWSCALE

Added: head/emulators/vice/files/patch-ffmpeglib.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/vice/files/patch-ffmpeglib.h	Mon Apr  7 13:18:20 2014	(r350470)
@@ -0,0 +1,43 @@
+--- src/gfxoutputdrv/ffmpeglib.h.orig	2011-10-24 21:06:48.000000000 +0200
++++ src/gfxoutputdrv/ffmpeglib.h	2012-11-25 13:09:18.518868503 +0100
+@@ -70,7 +70,7 @@
+ /* avcodec fucntions */
+ typedef int (*avcodec_open_t) (AVCodecContext*, AVCodec*);
+ typedef int (*avcodec_close_t) (AVCodecContext*);
+-typedef AVCodec* (*avcodec_find_encoder_t) (enum CodecID);
++typedef AVCodec* (*avcodec_find_encoder_t) (enum AVCodecID);
+ typedef int (*avcodec_encode_audio_t) (AVCodecContext*, uint8_t*, int, const short*);
+ typedef int (*avcodec_encode_video_t) (AVCodecContext*, uint8_t*, int, const AVFrame*);
+ typedef int (*avpicture_fill_t) (AVPicture*, uint8_t*, int, int, int);
+@@ -80,12 +80,11 @@ typedef int (*avpicture_get_size_t) (int
+ typedef void (*av_init_packet_t) (AVPacket *pkt);
+ typedef void (*av_register_all_t) (void);
+ typedef AVStream* (*av_new_stream_t) (AVFormatContext*, int);
+-typedef int (*av_set_parameters_t) (AVFormatContext*, AVFormatParameters*);
+-typedef int (*av_write_header_t) (AVFormatContext*);
++typedef int (*avformat_write_header_t) (AVFormatContext*, AVDictionary **);
+ typedef int (*av_write_frame_t) (AVFormatContext*, AVPacket*);
+ typedef int (*av_write_trailer_t) (AVFormatContext*);
+-typedef int (*url_fopen_t) (ByteIOContext**, const char*, int);
+-typedef int (*url_fclose_t) (ByteIOContext*);
++typedef int (*avio_open_t) (AVIOContext**, const char*, int);
++typedef int (*avio_close_t) (AVIOContext*);
+ typedef void (*dump_format_t) (AVFormatContext *, int, const char*, int);
+ typedef AVOutputFormat* (*av_guess_format_t) (const char*, const char*, const char*);
+ typedef int (*img_convert_t) (AVPicture*, int, AVPicture*, int, int, int);
+@@ -118,12 +117,11 @@ struct ffmpeglib_s {
+     av_init_packet_t            p_av_init_packet;
+     av_register_all_t           p_av_register_all;
+     av_new_stream_t             p_av_new_stream;
+-    av_set_parameters_t         p_av_set_parameters;
+-    av_write_header_t           p_av_write_header;
++    avformat_write_header_t     p_avformat_write_header;
+     av_write_frame_t            p_av_write_frame;
+     av_write_trailer_t          p_av_write_trailer;
+-    url_fopen_t                 p_url_fopen;
+-    url_fclose_t                p_url_fclose;
++    avio_open_t                 p_avio_open;
++    avio_close_t                p_avio_close;
+     dump_format_t               p_dump_format;
+     av_guess_format_t           p_av_guess_format;
+ #ifndef HAVE_FFMPEG_SWSCALE
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Dirk Meyer freebsd_committer 2014-04-07 16:43:40 UTC
State Changed
From-To: open->closed

A fix is committed, thanks.