commit:     ba6b4630d2b4cc294a3057b1f4770650bcb12c87
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 15:07:09 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 20:06:45 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba6b4630

media-sound/mpg321: drop ipv6 USE + fix build w/ upcoming clang16

clang fixes also fixed lto issues wrt #860876.

Closes: https://bugs.gentoo.org/860876
Closes: https://bugs.gentoo.org/874312
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../mpg321/files/mpg321-0.3.2-clang16.patch        | 79 ++++++++++++++++++++++
 ...{mpg321-0.3.2.ebuild => mpg321-0.3.2-r1.ebuild} |  7 +-
 2 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/media-sound/mpg321/files/mpg321-0.3.2-clang16.patch 
b/media-sound/mpg321/files/mpg321-0.3.2-clang16.patch
new file mode 100644
index 000000000000..a2d49edf0e89
--- /dev/null
+++ b/media-sound/mpg321/files/mpg321-0.3.2-clang16.patch
@@ -0,0 +1,79 @@
+https://bugs.gentoo.org/860876
+https://bugs.gentoo.org/874312
+--- a/fft.c
++++ b/fft.c
+@@ -148,5 +148,5 @@
+         printf("%i is reversed to %i and maps to %i %i\n", i, bitReverse[i], 
bitReverse[i] * 2, (bitReverse[i] * 2) + 1);
+ #endif
+-        sound_sample* ptr = &(input[bitReverse[i] * 2]);
++        const sound_sample* ptr = &(input[bitReverse[i] * 2]);
+         *realptr++ = (ptr[0] + ptr[1]) / 2;
+         *imagptr++ = 0;
+--- a/mpg321.c
++++ b/mpg321.c
+@@ -100,5 +100,5 @@
+ pid_t output_pid;
+ /* Not used for the moment. It only works for CBR http/ftp retrieved files */
+-extern http_file_length;
++extern int http_file_length;
+ #ifdef HAVE_ALSA
+ /* ALSA Volume Range */
+--- a/mpg321.h
++++ b/mpg321.h
+@@ -177,4 +177,5 @@
+ 
+ /* network functions */
++void do_basicauth();
+ int tcp_open(char * address, int port);
+ int udp_open(char * address, int port);
+@@ -189,4 +190,5 @@
+ enum mad_flow output(void *data, struct mad_header const *header, struct 
mad_pcm *pcm);
+ int calc_length(char *file, buffer*buf );
++int calc_http_length(buffer *buf);
+ 
+ static enum mad_flow handle_error(void *data, struct mad_stream *stream, 
struct mad_frame *frame);
+@@ -199,6 +201,8 @@
+ void check_ao_default_play_device();
+ void check_default_play_device();
++int check_default_play_device_buffer();
+ int playdevice_is_live();
+ void open_ao_playdevice(struct mad_header const *header);
++ao_device *open_ao_playdevice_buffer(struct mad_header const *header);
+ 
+ /* remote control (-R) functions */
+@@ -230,4 +234,10 @@
+ RETSIGTYPE handle_sigchld(int sig);
+ 
++#ifdef HAVE_ALSA
++int init_alsa_volume_control(char *name);
++long mpg321_alsa_get_volume();
++void mpg321_alsa_set_volume(long value);
++#endif
++
+ /* FFT data structures */
+ #define FFT_BUFFER_SIZE_LOG 9
+@@ -243,5 +253,5 @@
+ 
+ typedef short int sound_sample;
+-//void fft_perform(const sound_sample *input, double *output, fft_state 
*state);
++void fft_perform(const sound_sample *input, double *output, fft_state *state);
+ 
+ fft_state *fft_init(void);
+--- a/options.c
++++ b/options.c
+@@ -45,5 +45,5 @@
+ extern int auth_enable;
+ extern int auth_enable_var;
+-extern remote_restart;
++extern int remote_restart;
+ /*Basic Authentication Arguments*/
+ char *basic_auth = NULL;
+--- a/volume.c
++++ b/volume.c
+@@ -29,5 +29,5 @@
+ int init_alsa_volume_control(char *name)
+ {
+-      char *elemnam;
++      const char *elemnam;
+       snd_mixer_open(&mixer,0);
+       snd_mixer_attach(mixer,name);

diff --git a/media-sound/mpg321/mpg321-0.3.2.ebuild 
b/media-sound/mpg321/mpg321-0.3.2-r1.ebuild
similarity index 92%
rename from media-sound/mpg321/mpg321-0.3.2.ebuild
rename to media-sound/mpg321/mpg321-0.3.2-r1.ebuild
index 119b2b4c559d..689440e6caa4 100644
--- a/media-sound/mpg321/mpg321-0.3.2.ebuild
+++ b/media-sound/mpg321/mpg321-0.3.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -11,7 +11,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P/-/_}.orig.tar.gz -> 
${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ppc ppc64 ~riscv sparc x86 
~amd64-linux ~x86-linux ~ppc-macos"
-IUSE="alsa ipv6"
+IUSE="alsa"
 
 RDEPEND="app-eselect/eselect-mpg123
        >=media-libs/libao-1:=
@@ -28,6 +28,7 @@ PATCHES=(
        "${FILESDIR}/${P}-format-security.patch"
        "${FILESDIR}/${P}-CVE-2019-14247.patch"
        "${FILESDIR}/${P}-gcc10.patch"
+       "${FILESDIR}/${P}-clang16.patch"
 )
 
 src_prepare() {
@@ -38,7 +39,7 @@ src_prepare() {
 src_configure() {
        econf \
                --disable-mpg123-symlink \
-               $(use_enable ipv6) \
+               --enable-ipv6 \
                $(use_enable alsa)
 }
 

Reply via email to