aboutsummaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2014-04-07 21:18:20 +0800
committerdinoex <dinoex@FreeBSD.org>2014-04-07 21:18:20 +0800
commit2cd8d253e2cd4fbf37e0f0032f4164ea45f420d4 (patch)
treec58a5547917e8cb77e107a00b36bf276e338dc1c /emulators
parente114e0605794bca3e42fb5ae5e75d433aea7d0e2 (diff)
downloadfreebsd-ports-gnome-2cd8d253e2cd4fbf37e0f0032f4164ea45f420d4.tar.gz
freebsd-ports-gnome-2cd8d253e2cd4fbf37e0f0032f4164ea45f420d4.tar.zst
freebsd-ports-gnome-2cd8d253e2cd4fbf37e0f0032f4164ea45f420d4.zip
- fix build with ffmpeg2
- make ffmpeg default PR: 188317 Obtained from: pld-linux.org
Diffstat (limited to 'emulators')
-rw-r--r--emulators/vice/Makefile14
-rw-r--r--emulators/vice/files/patch-ffmpegdrv.c52
-rw-r--r--emulators/vice/files/patch-ffmpeglib.c34
-rw-r--r--emulators/vice/files/patch-ffmpeglib.h43
4 files changed, 134 insertions, 9 deletions
diff --git a/emulators/vice/Makefile b/emulators/vice/Makefile
index d4fd1515a435..44fead031c9e 100644
--- a/emulators/vice/Makefile
+++ b/emulators/vice/Makefile
@@ -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-fonts/bdftopcf \
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 --enable-ipv6 \
#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:${PORTSDIR}/audio/pulseaudio
.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
diff --git a/emulators/vice/files/patch-ffmpegdrv.c b/emulators/vice/files/patch-ffmpegdrv.c
new file mode 100644
index 000000000000..675986934f95
--- /dev/null
+++ b/emulators/vice/files/patch-ffmpegdrv.c
@@ -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);
+ }
+ }
+
diff --git a/emulators/vice/files/patch-ffmpeglib.c b/emulators/vice/files/patch-ffmpeglib.c
new file mode 100644
index 000000000000..28183e79ec01
--- /dev/null
+++ b/emulators/vice/files/patch-ffmpeglib.c
@@ -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
diff --git a/emulators/vice/files/patch-ffmpeglib.h b/emulators/vice/files/patch-ffmpeglib.h
new file mode 100644
index 000000000000..b3f3f8a079e2
--- /dev/null
+++ b/emulators/vice/files/patch-ffmpeglib.h
@@ -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