summaryrefslogtreecommitdiff
path: root/audio/flac123
diff options
context:
space:
mode:
authorwiz <wiz>2007-01-09 23:36:45 +0000
committerwiz <wiz>2007-01-09 23:36:45 +0000
commit232977a8e0d5c450d3b451227698245d8ff2cbd9 (patch)
treed78695ba2c8a8aadd38b057867f6bc21f71c2f3b /audio/flac123
parent077549d276022c22264be59d517de2d291b0ce93 (diff)
downloadpkgsrc-232977a8e0d5c450d3b451227698245d8ff2cbd9.tar.gz
Fix build with flac-1.1.3.
Diffstat (limited to 'audio/flac123')
-rw-r--r--audio/flac123/distinfo7
-rw-r--r--audio/flac123/patches/patch-aa16
-rw-r--r--audio/flac123/patches/patch-ab69
-rw-r--r--audio/flac123/patches/patch-ac184
-rw-r--r--audio/flac123/patches/patch-ad29
-rw-r--r--audio/flac123/patches/patch-ae30
6 files changed, 334 insertions, 1 deletions
diff --git a/audio/flac123/distinfo b/audio/flac123/distinfo
index bb8e73a69dd..a754d8c0316 100644
--- a/audio/flac123/distinfo
+++ b/audio/flac123/distinfo
@@ -1,5 +1,10 @@
-$NetBSD: distinfo,v 1.3 2006/02/26 02:33:51 snj Exp $
+$NetBSD: distinfo,v 1.4 2007/01/09 23:36:45 wiz Exp $
SHA1 (flac123-0.0.9.tar.gz) = 54784aeda6c016759007e02e51076c0ea0b937ed
RMD160 (flac123-0.0.9.tar.gz) = f84a0373f86322d419487492858fb0973e3accfb
Size (flac123-0.0.9.tar.gz) = 69647 bytes
+SHA1 (patch-aa) = 64bd66c707bdafbd1c831791e7fe8638f6e26b2f
+SHA1 (patch-ab) = a482ae41ceb521dfd167608a443d5724a205653d
+SHA1 (patch-ac) = dc0ffe3663ffaad341bf9d85df10dcb3b40e3d90
+SHA1 (patch-ad) = f2802ebf8454ecf8d9cf47c5d5b868d277ee8697
+SHA1 (patch-ae) = 98e44d7cbccfcbdff01c0637afa4d29dfbd6ef39
diff --git a/audio/flac123/patches/patch-aa b/audio/flac123/patches/patch-aa
new file mode 100644
index 00000000000..af0b318e22d
--- /dev/null
+++ b/audio/flac123/patches/patch-aa
@@ -0,0 +1,16 @@
+$NetBSD: patch-aa,v 1.1 2007/01/09 23:36:45 wiz Exp $
+
+--- configure.ac.orig 2005-05-07 23:05:24.000000000 +0000
++++ configure.ac
+@@ -40,9 +40,9 @@ fi
+ AC_PROG_CC
+
+ # Checks for libraries.
+-AC_CHECK_LIB(FLAC, FLAC__file_decoder_new, [haveflac=yes], [haveflac=no], -lm)
++AC_CHECK_LIB(FLAC, FLAC__stream_decoder_new, [haveflac=yes], [haveflac=no], -lm -logg)
+ if test "$haveflac" = "yes"; then
+- FLAC_LIBS="-lFLAC -lm"
++ FLAC_LIBS="-lFLAC -logg -lm"
+ AC_SUBST(FLAC_LIBS)
+ else
+ AC_MSG_ERROR(FLAC required!)
diff --git a/audio/flac123/patches/patch-ab b/audio/flac123/patches/patch-ab
new file mode 100644
index 00000000000..adba315ba36
--- /dev/null
+++ b/audio/flac123/patches/patch-ab
@@ -0,0 +1,69 @@
+$NetBSD: patch-ab,v 1.1 2007/01/09 23:36:45 wiz Exp $
+
+--- configure.orig 2007-01-09 23:33:42.000000000 +0000
++++ configure
+@@ -2688,13 +2688,13 @@ CCDEPMODE=depmode=$am_cv_CC_dependencies
+
+ # Checks for libraries.
+
+-echo "$as_me:$LINENO: checking for FLAC__file_decoder_new in -lFLAC" >&5
+-echo $ECHO_N "checking for FLAC__file_decoder_new in -lFLAC... $ECHO_C" >&6
+-if test "${ac_cv_lib_FLAC_FLAC__file_decoder_new+set}" = set; then
++echo "$as_me:$LINENO: checking for FLAC__stream_decoder_new in -lFLAC" >&5
++echo $ECHO_N "checking for FLAC__stream_decoder_new in -lFLAC... $ECHO_C" >&6
++if test "${ac_cv_lib_FLAC_FLAC__stream_decoder_new+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lFLAC -lm $LIBS"
++LIBS="-lFLAC -logg -lm $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h. */
+@@ -2709,11 +2709,11 @@ extern "C"
+ #endif
+ /* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+-char FLAC__file_decoder_new ();
++char FLAC__stream_decoder_new ();
+ int
+ main ()
+ {
+-FLAC__file_decoder_new ();
++FLAC__stream_decoder_new ();
+ ;
+ return 0;
+ }
+@@ -2730,26 +2730,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+- ac_cv_lib_FLAC_FLAC__file_decoder_new=yes
++ ac_cv_lib_FLAC_FLAC__stream_decoder_new=yes
+ else
+ echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_lib_FLAC_FLAC__file_decoder_new=no
++ac_cv_lib_FLAC_FLAC__stream_decoder_new=no
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__file_decoder_new" >&5
+-echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__file_decoder_new" >&6
+-if test $ac_cv_lib_FLAC_FLAC__file_decoder_new = yes; then
++echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__stream_decoder_new" >&5
++echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__stream_decoder_new" >&6
++if test $ac_cv_lib_FLAC_FLAC__stream_decoder_new = yes; then
+ haveflac=yes
+ else
+ haveflac=no
+ fi
+
+ if test "$haveflac" = "yes"; then
+- FLAC_LIBS="-lFLAC -lm"
++ FLAC_LIBS="-lFLAC -logg -lm"
+
+ else
+ { { echo "$as_me:$LINENO: error: FLAC required!" >&5
diff --git a/audio/flac123/patches/patch-ac b/audio/flac123/patches/patch-ac
new file mode 100644
index 00000000000..139f6bd542b
--- /dev/null
+++ b/audio/flac123/patches/patch-ac
@@ -0,0 +1,184 @@
+$NetBSD: patch-ac,v 1.1 2007/01/09 23:36:45 wiz Exp $
+
+--- flac123.c.orig 2005-05-09 04:25:20.000000000 +0000
++++ flac123.c
+@@ -49,12 +49,17 @@ struct poptOption cli_options[] = {
+
+ static void play_file(const char *);
+ static void play_remote_file(void);
+-void flac_error_hdl(const FLAC__FileDecoder *, FLAC__StreamDecoderErrorStatus,
+- void *);
+-void flac_metadata_hdl(const FLAC__FileDecoder *, const FLAC__StreamMetadata *,
+- void *);
++#ifdef LEGACY_FLAC
++void flac_error_hdl(const FLAC__FileDecoder *, FLAC__StreamDecoderErrorStatus, void *);
++void flac_metadata_hdl(const FLAC__FileDecoder *, const FLAC__StreamMetadata *, void *);
+ FLAC__StreamDecoderWriteStatus flac_write_hdl(const FLAC__FileDecoder *,
+ const FLAC__Frame *, const FLAC__int32 * const buf[], void *);
++#else
++void flac_error_hdl(const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus, void *);
++void flac_metadata_hdl(const FLAC__StreamDecoder *, const FLAC__StreamMetadata *, void *);
++FLAC__StreamDecoderWriteStatus flac_write_hdl(const FLAC__StreamDecoder *,
++ const FLAC__Frame *, const FLAC__int32 * const buf[], void *);
++#endif
+
+ static void signal_handler(int);
+ static int quit_now = 0;
+@@ -190,6 +195,7 @@ FLAC__bool decoder_constructor(const cha
+ file_info.year[VORBIS_YEAR_LEN] = '\0';
+
+ /* create and initialize flac decoder object */
++#ifdef LEGACY_FLAC
+ file_info.decoder = FLAC__file_decoder_new();
+ FLAC__file_decoder_set_md5_checking(file_info.decoder, true);
+ FLAC__file_decoder_set_filename(file_info.decoder, filename);
+@@ -210,13 +216,29 @@ FLAC__bool decoder_constructor(const cha
+ FLAC__file_decoder_delete(file_info.decoder);
+ return false;
+ }
++#else
++ file_info.decoder = FLAC__stream_decoder_new();
++ FLAC__stream_decoder_set_md5_checking(file_info.decoder, true);
++
++ /* read metadata */
++ if ((FLAC__stream_decoder_init_file(file_info.decoder, filename, flac_write_hdl, flac_metadata_hdl, flac_error_hdl, (void *)&file_info) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
++ || (!FLAC__stream_decoder_process_until_end_of_metadata(file_info.decoder)))
++ {
++ FLAC__stream_decoder_delete(file_info.decoder);
++ return false;
++ }
++#endif
+
+ /* open libao output device */
+ if (cli_args.wavfile) {
+ if (!(file_info.ao_dev = ao_open_file(ao_driver_id("wav"), cli_args.wavfile, /*overwrite*/ 1, &(file_info.ao_fmt), NULL)))
+ {
+ fprintf(stderr, "Error opening wav file %s\n", cli_args.wavfile);
++#ifdef LEGACY_FLAC
+ FLAC__file_decoder_delete(file_info.decoder);
++#else
++ FLAC__stream_decoder_delete(file_info.decoder);
++#endif
+ return false;
+ }
+ }
+@@ -224,7 +246,11 @@ FLAC__bool decoder_constructor(const cha
+ if (!(file_info.ao_dev = ao_open_live(ao_output_id, &(file_info.ao_fmt), NULL)))
+ {
+ fprintf(stderr, "Error opening ao device %d\n", ao_output_id);
++#ifdef LEGACY_FLAC
+ FLAC__file_decoder_delete(file_info.decoder);
++#else
++ FLAC__stream_decoder_delete(file_info.decoder);
++#endif
+ return false;
+ }
+ }
+@@ -237,7 +263,11 @@ FLAC__bool decoder_constructor(const cha
+ if (!(file_info.ao_dev = ao_open_live(ao_output_id, &(file_info.ao_fmt), NULL)))
+ {
+ fprintf(stderr, "Error opening ao device %d\n", ao_output_id);
++#ifdef LEGACY_FLAC
+ FLAC__file_decoder_delete(file_info.decoder);
++#else
++ FLAC__stream_decoder_delete(file_info.decoder);
++#endif
+ return false;
+ }
+ }
+@@ -257,8 +287,13 @@ FLAC__bool decoder_constructor(const cha
+
+ void decoder_destructor(void)
+ {
++#ifdef LEGACY_FLAC
+ FLAC__file_decoder_finish(file_info.decoder);
+ FLAC__file_decoder_delete(file_info.decoder);
++#else
++ FLAC__stream_decoder_finish(file_info.decoder);
++ FLAC__stream_decoder_delete(file_info.decoder);
++#endif
+ file_info.is_loaded = false;
+ file_info.is_playing = false;
+ file_info.filename[0] = '\0';
+@@ -272,9 +307,15 @@ static void play_file(const char *filena
+ return;
+ }
+
++#ifdef LEGACY_FLAC
+ while (FLAC__file_decoder_process_single(file_info.decoder) == true &&
+ FLAC__file_decoder_get_state(file_info.decoder) ==
+ FLAC__FILE_DECODER_OK && !interrupted)
++#else
++ while (FLAC__stream_decoder_process_single(file_info.decoder) == true &&
++ FLAC__stream_decoder_get_state(file_info.decoder) <
++ FLAC__STREAM_DECODER_END_OF_STREAM && !interrupted)
++#endif
+ {
+ }
+ interrupted = 0; /* more accurate feedback if placed after loop */
+@@ -292,13 +333,22 @@ static void play_remote_file(void)
+ {
+ if (file_info.is_playing == true)
+ {
++#ifdef LEGACY_FLAC
+ if (FLAC__file_decoder_get_state(file_info.decoder) ==
+ FLAC__FILE_DECODER_END_OF_FILE)
++#else
++ if (FLAC__stream_decoder_get_state(file_info.decoder) ==
++ FLAC__STREAM_DECODER_END_OF_STREAM)
++#endif
+ {
+ decoder_destructor();
+ printf("@P 0\n");
+ }
++#ifdef LEGACY_FLAC
+ else if (!FLAC__file_decoder_process_single(file_info.decoder))
++#else
++ else if (!FLAC__stream_decoder_process_single(file_info.decoder))
++#endif
+ {
+ fprintf(stderr, "error decoding single frame!\n");
+ }
+@@ -314,14 +364,24 @@ static void play_remote_file(void)
+ }
+ }
+
++#ifdef LEGACY_FLAC
+ void flac_error_hdl(const FLAC__FileDecoder *dec,
+ FLAC__StreamDecoderErrorStatus status, void *data)
++#else
++void flac_error_hdl(const FLAC__StreamDecoder *dec,
++ FLAC__StreamDecoderErrorStatus status, void *data)
++#endif
+ {
+ fprintf(stderr, "error handler called!\n");
+ }
+
++#ifdef LEGACY_FLAC
+ void flac_metadata_hdl(const FLAC__FileDecoder *dec,
+ const FLAC__StreamMetadata *meta, void *data)
++#else
++void flac_metadata_hdl(const FLAC__StreamDecoder *dec,
++ const FLAC__StreamMetadata *meta, void *data)
++#endif
+ {
+ file_info_struct *p = (file_info_struct *) data;
+
+@@ -344,10 +404,17 @@ void flac_metadata_hdl(const FLAC__FileD
+ }
+ }
+
++#ifdef LEGACY_FLAC
+ FLAC__StreamDecoderWriteStatus flac_write_hdl(const FLAC__FileDecoder *dec,
+ const FLAC__Frame *frame,
+ const FLAC__int32 * const buf[],
+ void *data)
++#else
++FLAC__StreamDecoderWriteStatus flac_write_hdl(const FLAC__StreamDecoder *dec,
++ const FLAC__Frame *frame,
++ const FLAC__int32 * const buf[],
++ void *data)
++#endif
+ {
+ int sample, channel, i;
+ uint_32 samples = frame->header.blocksize;
diff --git a/audio/flac123/patches/patch-ad b/audio/flac123/patches/patch-ad
new file mode 100644
index 00000000000..7e957360b39
--- /dev/null
+++ b/audio/flac123/patches/patch-ad
@@ -0,0 +1,29 @@
+$NetBSD: patch-ad,v 1.1 2007/01/09 23:36:45 wiz Exp $
+
+--- flac123.h.orig 2005-02-25 05:52:02.000000000 +0000
++++ flac123.h
+@@ -22,13 +22,24 @@
+ #include <limits.h>
+ #include <FLAC/all.h>
+
++/* by LEGACY_FLAC we mean pre-1.1.3 before FLAC__FileDecoder was merged into FLAC__StreamDecoder */
++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
++#define LEGACY_FLAC
++#else
++#undef LEGACY_FLAC
++#endif
++
+ /* string widths for printing ID3 (vorbis) data in remote mode */
+ #define VORBIS_TAG_LEN 30
+ #define VORBIS_YEAR_LEN 4
+
+ /* the main data structure of the program */
+ typedef struct {
++#ifdef LEGACY_FLAC
+ FLAC__FileDecoder *decoder;
++#else
++ FLAC__StreamDecoder *decoder;
++#endif
+
+ /* bits, rate, channels, byte_format */
+ ao_sample_format sam_fmt; /* input sample's true format */
diff --git a/audio/flac123/patches/patch-ae b/audio/flac123/patches/patch-ae
new file mode 100644
index 00000000000..2cd84f8304d
--- /dev/null
+++ b/audio/flac123/patches/patch-ae
@@ -0,0 +1,30 @@
+$NetBSD: patch-ae,v 1.1 2007/01/09 23:36:45 wiz Exp $
+
+--- remote.c.orig 2005-02-25 05:50:41.000000000 +0000
++++ remote.c
+@@ -150,8 +150,13 @@ static int remote_parse_input(void)
+ file_info.current_sample += delta_frames;
+ }
+
++#ifdef LEGACY_FLAC
+ FLAC__file_decoder_seek_absolute(file_info.decoder,
+ file_info.current_sample);
++#else
++ FLAC__stream_decoder_seek_absolute(file_info.decoder,
++ file_info.current_sample);
++#endif
+ }
+ /* absolute seek */
+ else
+@@ -161,7 +166,11 @@ static int remote_parse_input(void)
+ file_info.elapsed_time = absolute_time;
+ file_info.current_sample = absolute_frame;
+
++#ifdef LEGACY_FLAC
+ FLAC__file_decoder_seek_absolute(file_info.decoder, absolute_frame);
++#else
++ FLAC__stream_decoder_seek_absolute(file_info.decoder, absolute_frame);
++#endif
+ }
+
+ }