commit:     66b0c2b775025b8292f98d6fdfa39f20cdda0759
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 18 01:02:16 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 18 01:03:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66b0c2b7

media-video/alevt: drop dubious strip restriction; musl fix; avoid C23

* Drop dubious strip restriction added in 
afaa14ae5f92c27e99dc5278908a77b68f1536da.

  I can't see why it's there at all.

* Fix build on musl.

* Refresh icon cache w/ xdg.eclass (for the xpms).

* Build with -std=gnu17 as there's inconsistent types used in callbacks.

Bug: https://bugs.gentoo.org/205934
Closes: https://bugs.gentoo.org/945281
Closes: https://bugs.gentoo.org/954859
Closes: https://bugs.gentoo.org/936890
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-video/alevt/alevt-1.8.2-r1.ebuild        | 51 +++++++++++++++++
 media-video/alevt/files/alevt-1.8.2-musl.patch | 79 ++++++++++++++++++++++++++
 2 files changed, 130 insertions(+)

diff --git a/media-video/alevt/alevt-1.8.2-r1.ebuild 
b/media-video/alevt/alevt-1.8.2-r1.ebuild
new file mode 100644
index 000000000000..042c5f9cf6fb
--- /dev/null
+++ b/media-video/alevt/alevt-1.8.2-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop flag-o-matic toolchain-funcs xdg
+
+MY_P="${PN}-v${PV}"
+DESCRIPTION="Teletext viewer for X11"
+HOMEPAGE="https://gitlab.com/alevt/alevt";
+SRC_URI="https://gitlab.com/${PN}/${PN}/-/archive/v${PV}/${MY_P}.tar.bz2
+       -> ${P}.tar.bz2"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+RDEPEND="
+       x11-libs/libX11
+       media-libs/libpng:=
+"
+DEPEND="
+       ${RDEPEND}
+       x11-base/xorg-proto
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-respectflags.patch
+       "${FILESDIR}"/${PN}-1.6.2-libpng15.patch
+       "${FILESDIR}"/${PN}-1.8.2-musl.patch
+)
+
+src_configure() {
+       # -std-gnu17: bug #945281
+       append-cflags -fno-strict-aliasing -std=gnu17
+       tc-export BUILD_CC CC
+}
+
+src_install() {
+       # The upstream Makefile has the 'install' rule under a comment
+       # "anything below this line is just for me!", so avoid it.
+       dobin alevt alevt-cap alevt-date
+       doman alevt.1x alevt-date.1 alevt-cap.1
+       einstalldocs
+
+       newicon -s 16 contrib/mini-alevt.xpm alevt.xpm
+       newicon -s 48 contrib/icon48x48.xpm alevt.xpm
+       make_desktop_entry alevt "AleVT" alevt
+}

diff --git a/media-video/alevt/files/alevt-1.8.2-musl.patch 
b/media-video/alevt/files/alevt-1.8.2-musl.patch
new file mode 100644
index 000000000000..6b3fac6692c8
--- /dev/null
+++ b/media-video/alevt/files/alevt-1.8.2-musl.patch
@@ -0,0 +1,79 @@
+https://bugs.gentoo.org/945281
+--- a/vbi.c
++++ b/vbi.c
+@@ -876,7 +876,7 @@ vbi_reset(struct vbi *vbi)
+ /*#include "dvb/sec.h"*/
+ #include "dvb/video.h"
+ 
+-static int dvb_get_table(int fd, u_int16_t pid, u_int8_t tblid, u_int8_t 
*buf, size_t bufsz)
++static int dvb_get_table(int fd, uint16_t pid, uint8_t tblid, uint8_t *buf, 
size_t bufsz)
+ {
+         struct dmx_sct_filter_params sctFilterParams;
+       struct pollfd pfd;
+@@ -1038,7 +1038,7 @@ static size_t dvb_get_string(char *inbuf, size_t 
inbuf_size, char *outbuf, size_
+       return r;
+ }
+ 
+-static const u_int8_t byterev8[256] = {
++static const uint8_t byterev8[256] = {
+         0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 
+         0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 
+         0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 
+@@ -1073,10 +1073,10 @@ static const u_int8_t byterev8[256] = {
+         0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
+ };
+ 
+-static void dvb_handle_pes_payload(struct vbi *vbi, const u_int8_t *buf, 
unsigned int len)
++static void dvb_handle_pes_payload(struct vbi *vbi, const uint8_t *buf, 
unsigned int len)
+ {
+       unsigned int p, i;
+-      u_int8_t data[42];
++      uint8_t data[42];
+ 
+       if (buf[0] < 0x10 || buf[0] > 0x1f)
+               return;  /* no EBU teletext data */
+@@ -1114,12 +1114,12 @@ static unsigned int rawptr;
+ static void dvb_handler(struct vbi *vbi, int fd)
+ {
+       /* PES packet start code prefix and stream_id == private_stream_1 */
+-      static const u_int8_t peshdr[4] = { 0x00, 0x00, 0x01, 0xbd };
+-      u_int8_t *bp;
++      static const uint8_t peshdr[4] = { 0x00, 0x00, 0x01, 0xbd };
++      uint8_t *bp;
+       int n;
+       unsigned int p, i, len;
+-        u_int16_t rpid;
+-        u_int32_t crc, crccomp;
++        uint16_t rpid;
++        uint32_t crc, crccomp;
+ 
+       if (rawptr >= (unsigned int)rawbuf_size)
+               rawptr = 0;
+@@ -1164,18 +1164,18 @@ static void dvb_handler(struct vbi *vbi, int fd)
+ static int vbi_dvb_open(struct vbi *vbi, const char *vbi_name, const char 
*progname, int txtpid, int info)
+ {
+       struct {
+-              u_int16_t pmtpid;
+-              u_int16_t txtpid;
+-              u_int16_t service_id;
+-              u_int8_t service_type;
++              uint16_t pmtpid;
++              uint16_t txtpid;
++              uint16_t service_id;
++              uint8_t service_type;
+               char service_provider_name[64];
+               char service_name[64];
+-              u_int8_t txtlang[3];
+-              u_int8_t txttype;
+-              u_int8_t txtmagazine;
+-              u_int8_t txtpage;
++              uint8_t txtlang[3];
++              uint8_t txttype;
++              uint8_t txtmagazine;
++              uint8_t txtpage;
+       } progtbl[128], *progp;
+-      u_int8_t tbl[4096];
++      uint8_t tbl[4096];
+       int r;
+       unsigned int i, j, k, l, progcnt = 0;
+       struct dmx_pes_filter_params filterpar;

Reply via email to