public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/libfishsound/files/, media-libs/libfishsound/
@ 2024-03-17  4:02 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-03-17  4:02 UTC (permalink / raw
  To: gentoo-commits

commit:     a1e6a1e46d905e7bf728bb8ecfed0f342f460ae6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 17 03:56:38 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 17 03:56:38 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1e6a1e4

media-libs/libfishsound: fix modern C issue

Closes: https://bugs.gentoo.org/883393
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/libfishsound-1.0.0-c99.patch             | 65 ++++++++++++++++++++++
 .../libfishsound/libfishsound-1.0.0-r2.ebuild      | 52 +++++++++++++++++
 2 files changed, 117 insertions(+)

diff --git a/media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch b/media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch
new file mode 100644
index 000000000000..d010eb75ac0b
--- /dev/null
+++ b/media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch
@@ -0,0 +1,65 @@
+https://bugs.gentoo.org/883393
+https://gitlab.xiph.org/xiph/libfishsound/-/merge_requests/1
+
+From 8eb391d772cb3c3dbfb68b2216e095af705b0229 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Stegh=C3=B6fer?= <martin@steghoefer.eu>
+Date: Wed, 22 Oct 2014 22:03:15 +0200
+Subject: [PATCH] Fix incompatible flac callback types.
+
+Bug-Debian: https://bugs.debian.org/766394
+
+Starting from libflac 1.1.3 the flac API uses "size_t" as parameter type for the number of bytes in all callback functions.
+--- a/src/libfishsound/flac.c
++++ b/src/libfishsound/flac.c
+@@ -56,6 +56,13 @@
+ 
+ #define BITS_PER_SAMPLE 24
+ 
++#if defined(HAVE_FLAC_1_1_3)
++#  define flac_callback_bytes_type size_t
++#else
++#  define flac_callback_bytes_type unsigned int
++#endif
++
++
+ typedef struct _FishSoundFlacInfo {
+   FLAC__StreamDecoder *fsd;
+   FLAC__StreamEncoder *fse;
+@@ -106,7 +113,7 @@ fs_flac_command (FishSound * fsound, int command, void * data, int datasize)
+ #if FS_DECODE
+ static FLAC__StreamDecoderReadStatus
+ fs_flac_read_callback(const FLAC__StreamDecoder *decoder,
+-                      FLAC__byte buffer[], unsigned int *bytes,
++                      FLAC__byte buffer[], flac_callback_bytes_type *bytes,
+                       void *client_data)
+ {
+   FishSound* fsound = (FishSound*)client_data;
+@@ -121,7 +128,7 @@ fs_flac_read_callback(const FLAC__StreamDecoder *decoder,
+   }
+ 
+   memcpy(buffer, fi->buffer, fi->bufferlength);
+-  *bytes = (unsigned int)fi->bufferlength;
++  *bytes = (flac_callback_bytes_type)fi->bufferlength;
+   fi->bufferlength = 0;
+   return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+ }
+@@ -346,7 +353,7 @@ dec_err:
+ #if FS_ENCODE
+ static FLAC__StreamEncoderWriteStatus
+ fs_flac_enc_write_callback(const FLAC__StreamEncoder *encoder,
+-                           const FLAC__byte buffer[], unsigned bytes,
++                           const FLAC__byte buffer[], flac_callback_bytes_type bytes,
+                            unsigned samples, unsigned current_frame,
+                            void *client_data)
+ {
+@@ -354,7 +361,7 @@ fs_flac_enc_write_callback(const FLAC__StreamEncoder *encoder,
+   FishSoundFlacInfo *fi = fsound->codec_data;
+ 
+   debug_printf(1, "IN");
+-  debug_printf(1, "bytes: %d, samples: %d", bytes, samples);
++  debug_printf(1, "bytes: %lld, samples: %d", (long long) bytes, samples);
+ 
+   if (fsound->callback.encoded) {
+     FishSoundEncoded encoded = (FishSoundEncoded) fsound->callback.encoded;
+-- 
+GitLab

diff --git a/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild b/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild
new file mode 100644
index 000000000000..174d912e442b
--- /dev/null
+++ b/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Simple programming interface to decode and encode audio with vorbis or speex"
+HOMEPAGE="https://www.xiph.org/fishsound/"
+SRC_URI="https://downloads.xiph.org/releases/libfishsound/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="flac speex"
+
+RDEPEND="
+	media-libs/libogg
+	media-libs/libvorbis
+	flac? ( media-libs/flac:= )
+	speex? ( media-libs/speex )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+# bug #395153
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-pc.patch
+	"${FILESDIR}"/${PN}-1.0.0-c99.patch
+)
+
+src_prepare() {
+	default
+	sed -i \
+		-e 's:doxygen:doxygen-dummy:' \
+		configure || die
+}
+
+src_configure() {
+	local myconf="--disable-static"
+	use flac || myconf="${myconf} --disable-flac"
+	use speex || myconf="${myconf} --disable-speex"
+
+	econf ${myconf}
+}
+
+src_install() {
+	emake DESTDIR="${D}" \
+		docdir="${D}/usr/share/doc/${PF}" install
+	dodoc AUTHORS ChangeLog README
+	find "${ED}" -name '*.la' -delete || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/libfishsound/files/, media-libs/libfishsound/
@ 2025-02-10  8:50 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-02-10  8:50 UTC (permalink / raw
  To: gentoo-commits

commit:     d231279354531b63b6851cd06c9467ec4dec6109
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Tue Jan  7 12:58:34 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 08:45:13 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2312793

media-libs/libfishsound: fix build when liboggz is present

Upstream patch

Bug: https://bugs.gentoo.org/929253
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40025
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/libfishsound-1.0.0-oggz-interop.patch    | 102 +++++++++++++++++++++
 .../libfishsound/libfishsound-1.0.0-r2.ebuild      |   2 +-
 ....0.0-r2.ebuild => libfishsound-1.0.0-r3.ebuild} |   3 +-
 3 files changed, 105 insertions(+), 2 deletions(-)

diff --git a/media-libs/libfishsound/files/libfishsound-1.0.0-oggz-interop.patch b/media-libs/libfishsound/files/libfishsound-1.0.0-oggz-interop.patch
new file mode 100644
index 000000000000..2d9f6ebdeffa
--- /dev/null
+++ b/media-libs/libfishsound/files/libfishsound-1.0.0-oggz-interop.patch
@@ -0,0 +1,102 @@
+Upstream commit https://gitlab.xiph.org/xiph/libfishsound/-/commit/e1ee9862e89b362ac49cf66f1485d91a75cffe9f
+https://bugs.gentoo.org/929253
+From e1ee9862e89b362ac49cf66f1485d91a75cffe9f Mon Sep 17 00:00:00 2001
+From: Petter Reinholdtsen <pere@hungry.com>
+Date: Sat, 8 Feb 2025 20:22:51 +0100
+Subject: [PATCH] Use correct oggz argument type in examples.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The examples using oggz must use oggz_package as the
+second argument to read_package for the callback to be acceptable by
+oggz_set_read_callback().  Adjust the method signature to use
+oggz_package and extract the required ogg_package members from this
+one to avoid compiler message like this:
+
+fishsound-identify.c: In function ‘main’:
+fishsound-identify.c:101:37: warning: passing argument 3 of ‘oggz_set_read_callback’ from incompatible pointer type [-Wincompatible-pointer-types]
+  101 |   oggz_set_read_callback (oggz, -1, read_packet, NULL);
+      |                                     ^~~~~~~~~~~
+      |                                     |
+      |                                     int (*)(OGGZ *, ogg_packet *, long int,  void *) {aka int (*)(void *, ogg_packet *, long int,  void *)}
+In file included from /usr/include/oggz/oggz.h:576,
+                 from fishsound-identify.c:39:
+/usr/include/oggz/oggz_read.h:109:44: note: expected ‘OggzReadPacket’ {aka ‘int (*)(void *, oggz_packet *, long int,  void *)’} but argument is of type ‘int (*)(OGGZ *, ogg_packet *, long int,  void *)’ {aka ‘int (*)(void *, ogg_packet *, long int,  void *)’}
+  109 |                             OggzReadPacket read_packet, void * user_data);
+      |                             ~~~~~~~~~~~~~~~^~~~~~~~~~~
+
+Fixes #13
+---
+ src/examples/fishsound-decenc.c   | 3 ++-
+ src/examples/fishsound-decode.c   | 3 ++-
+ src/examples/fishsound-identify.c | 4 ++--
+ src/examples/fishsound-info.c     | 3 ++-
+ 4 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/examples/fishsound-decenc.c b/src/examples/fishsound-decenc.c
+index 96261ad..f9e8674 100644
+--- a/src/examples/fishsound-decenc.c
++++ b/src/examples/fishsound-decenc.c
+@@ -129,9 +129,10 @@ decoded (FishSound * fsound, float ** pcm, long frames, void * user_data)
+ }
+ 
+ static int
+-read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
++read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
+ {
+   FS_DecEnc * ed = (FS_DecEnc *) user_data;
++  ogg_packet *op = &ozp->op;
+   
+   fish_sound_prepare_truncation (ed->decoder, op->granulepos, op->e_o_s);
+   fish_sound_decode (ed->decoder, op->packet, op->bytes);
+diff --git a/src/examples/fishsound-decode.c b/src/examples/fishsound-decode.c
+index d9c178d..9c61d0a 100644
+--- a/src/examples/fishsound-decode.c
++++ b/src/examples/fishsound-decode.c
+@@ -82,9 +82,10 @@ decoded_float (FishSound * fsound, float ** pcm, long frames, void * user_data)
+ }
+ 
+ static int
+-read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
++read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
+ {
+   FishSound * fsound = (FishSound *)user_data;
++  ogg_packet *op = &ozp->op;
+ 
+   /* If we have not yet selected an audio track to decode, then try
+    * to identify this one. If it is a known audio codec, then remember its
+diff --git a/src/examples/fishsound-identify.c b/src/examples/fishsound-identify.c
+index c5ff943..5a89e34 100644
+--- a/src/examples/fishsound-identify.c
++++ b/src/examples/fishsound-identify.c
+@@ -60,9 +60,9 @@ dump_identity (unsigned char * buf, long bytes)
+ }
+ 
+ static int
+-read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
++read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
+ {
+-
++  ogg_packet *op = &ozp->op;
+   if (op->bytes < 8) {
+     printf ("too short\n");
+   } else {
+diff --git a/src/examples/fishsound-info.c b/src/examples/fishsound-info.c
+index 65138a1..d119d33 100644
+--- a/src/examples/fishsound-info.c
++++ b/src/examples/fishsound-info.c
+@@ -76,8 +76,9 @@ decoded (FishSound * fsound, float ** pcm, long frames, void * user_data)
+ }
+ 
+ static int
+-read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
++read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
+ {
++  ogg_packet *op = &ozp->op;
+   FishSound * fsound = (FishSound *)user_data;
+ 
+   if (op->e_o_s) {
+-- 
+GitLab
+

diff --git a/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild b/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild
index 71fd52981ae6..1493386d0a49 100644
--- a/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild
+++ b/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8

diff --git a/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild b/media-libs/libfishsound/libfishsound-1.0.0-r3.ebuild
similarity index 92%
copy from media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild
copy to media-libs/libfishsound/libfishsound-1.0.0-r3.ebuild
index 71fd52981ae6..18d959853c9e 100644
--- a/media-libs/libfishsound/libfishsound-1.0.0-r2.ebuild
+++ b/media-libs/libfishsound/libfishsound-1.0.0-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -27,6 +27,7 @@ RESTRICT="test"
 PATCHES=(
 	"${FILESDIR}"/${P}-pc.patch
 	"${FILESDIR}"/${PN}-1.0.0-c99.patch
+	"${FILESDIR}"/${PN}-1.0.0-oggz-interop.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-10  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-17  4:02 [gentoo-commits] repo/gentoo:master commit in: media-libs/libfishsound/files/, media-libs/libfishsound/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2025-02-10  8:50 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox