git: 6b5a0d0bad52 - main - multimedia/ogmtools: Improve port

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Wed, 05 Jul 2023 18:42:43 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6b5a0d0bad52bba8909681efee6c9153789b3cab

commit 6b5a0d0bad52bba8909681efee6c9153789b3cab
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-07-05 18:35:28 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-07-05 18:35:33 +0000

    multimedia/ogmtools: Improve port
    
    * Define LICENSE
    * Clean up Makefile
    * Import patches from Debian and Gentoo for various bug fixes
    
    References:
    https://sources.debian.org/src/ogmtools/1%3A1.5-4.1/debian/patches/0001-configure.in-adjust-variable-formatting.patch/
    https://sources.debian.org/src/ogmtools/1%3A1.5-4.1/debian/patches/0002-ogmsplit.1-spell-correct.patch/
    https://sources.debian.org/src/ogmtools/1%3A1.5-4.1/debian/patches/0003-ogmmerge-spell-correct.patch/
    https://sources.debian.org/src/ogmtools/1%3A1.5-4.1/debian/patches/0004-ogminfo-timestamp-correction.patch/
    https://sources.debian.org/src/ogmtools/1%3A1.5-4.1/debian/patches/0006-pass-CFLAGS.patch/
    https://gitweb.gentoo.org/repo/gentoo.git/tree/media-sound/ogmtools/files/ogmtools-1.5-comments.patch
    https://gitweb.gentoo.org/repo/gentoo.git/tree/media-sound/ogmtools/files/ogmtools-1.5-endian-fix.patch
    https://gitweb.gentoo.org/repo/gentoo.git/tree/media-sound/ogmtools/files/ogmtools-1.5-gcc11.patch
---
 multimedia/ogmtools/Makefile                       |  43 +--
 multimedia/ogmtools/files/patch-avilib_avidump.c   |  11 +
 multimedia/ogmtools/files/patch-configure.in       |  12 +
 multimedia/ogmtools/files/patch-gcc11-compat       | 374 +++++++++++++++++++++
 multimedia/ogmtools/files/patch-ogminfo.c          | 149 ++++++++
 multimedia/ogmtools/files/patch-ogmmerge.1         |  11 +
 multimedia/ogmtools/files/patch-ogmsplit.1         |  10 +
 multimedia/ogmtools/files/patch-os.h               |  11 +
 .../ogmtools/files/patch-vorbis__header__utils.c   |  21 ++
 9 files changed, 609 insertions(+), 33 deletions(-)

diff --git a/multimedia/ogmtools/Makefile b/multimedia/ogmtools/Makefile
index 7f5ec1abef1f..8d0038a924b8 100644
--- a/multimedia/ogmtools/Makefile
+++ b/multimedia/ogmtools/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ogmtools
 PORTVERSION=	1.5
-PORTREVISION=	16
+PORTREVISION=	17
 CATEGORIES=	multimedia audio
 MASTER_SITES=	http://www.bunkus.org/videotools/ogmtools/
 
@@ -8,44 +8,21 @@ MAINTAINER=	multimedia@FreeBSD.org
 COMMENT=	Tools to extract from/get info about/create OGG media streams
 WWW=		https://www.bunkus.org/videotools/ogmtools/
 
-LIB_DEPENDS=	libvorbis.so:audio/libvorbis
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/COPYING
 
-USES=	tar:bzip2
+LIB_DEPENDS=	libogg.so:audio/libogg \
+		libvorbis.so:audio/libvorbis
+
+USES=		autoreconf localbase:ldflags tar:bzip2
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-ogg-prefix=${LOCALBASE} \
-		--with-vorbis-prefix=${LOCALBASE}
 
 OPTIONS_DEFINE=	DVDREAD
-OPTIONS_DEFAULT=	DVDREAD
+OPTIONS_DEFAULT=DVDREAD
+OPTIONS_SUB=	yes
 DVDREAD_DESC=	DVD title chapter extraction via libdvdread
 
 DVDREAD_LIB_DEPENDS=	libdvdread.so:multimedia/libdvdread
-DVDREAD_CONFIGURE_ON=	--with-dvdread \
-			--with-dvdread-includes=${LOCALBASE} \
-			--with-dvdread-libs=${LOCALBASE}
-DVDREAD_CONFIGURE_OFF=	--without-dvdread
-OPTIONS_SUB=	yes
-
-post-patch:
-# disable GNU auto* tools
-	@${FIND} ${WRKSRC} -type f -name "Makefile.in" | ${XARGS} \
-		-n 10 ${REINPLACE_CMD} -E -e \
-		's!^(ACLOCAL|AUTOCONF|AUTOMAKE|AUTOHEADER).+$$!\1=${TRUE}!'
-# C{,XX}FLAGS safeness
-	@${REINPLACE_CMD} -E -e \
-		's|^(CFLAGS).*(-DLINUX)|\1=${CFLAGS} \2|' \
-		${WRKSRC}/avilib/Makefile.in
-	@${REINPLACE_CMD} -E -e \
-		's|^(CFLAGS[[:space:]]*)=|\1+=|; \
-		s|^(CXXFLAGS[[:space:]]*)=|\1+=|' \
-		${WRKSRC}/Makefile.in
-
-post-configure:
-# malloc.h -> stdlib.h
-# stdint.h -> inttypes.h
-	@${FIND} ${WRKSRC} -type f | ${XARGS} \
-		-n 10 ${REINPLACE_CMD} -E -e \
-		's!malloc.h!stdlib.h!; \
-		s|stdint.h|inttypes.h|'
+DVDREAD_CONFIGURE_WITH=	dvdread
 
 .include <bsd.port.mk>
diff --git a/multimedia/ogmtools/files/patch-avilib_avidump.c b/multimedia/ogmtools/files/patch-avilib_avidump.c
new file mode 100644
index 000000000000..870118a8abc5
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-avilib_avidump.c
@@ -0,0 +1,11 @@
+--- avilib/avidump.c.orig	2004-11-02 15:30:16 UTC
++++ avilib/avidump.c
+@@ -54,7 +54,7 @@
+                    ((x<<8)  & 0x00ff0000) |\
+                    ((x<<24) & 0xff000000))
+ # define SWAP8(x) (((SWAP4(x)<<32) & 0xffffffff00000000ULL) |\
+-                   (SWAP4(x)))
++                   SWAP4(x))
+ #else
+ # define SWAP2(a) (a)
+ # define SWAP4(a) (a)
diff --git a/multimedia/ogmtools/files/patch-configure.in b/multimedia/ogmtools/files/patch-configure.in
new file mode 100644
index 000000000000..d03a84a07f6a
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-configure.in
@@ -0,0 +1,12 @@
+--- configure.in.orig	2023-07-04 22:25:24 UTC
++++ configure.in
+@@ -31,7 +31,7 @@ fi
+ dnl Check for headers
+ AC_HEADER_STDC()
+ 
+-CFLAGS="-Wall -Wno-sign-compare @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AVILIB_CFLAGS@ @DEBUG_CFLAGS@ @PROFILING_CFLAGS@"
+-CXXFLAGS="-Wall -Wno-sign-compare @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AVILIB_CFLAGS@ @DEBUG_CFLAGS@ @PROFILING_CFLAGS@"
++CFLAGS="-Wall -Wno-sign-compare $OGG_CFLAGS $VORBIS_CFLAGS $AVILIB_CFLAGS $DEBUG_CFLAGS $PROFILING_CFLAGS $CFLAGS"
++CXXFLAGS="-Wall -Wno-sign-compare $OGG_CFLAGS $VORBIS_CFLAGS $AVILIB_CFLAGS $DEBUG_CFLAGS $PROFILING_CFLAGS $CXXFLAGS"
+ 
+ AC_OUTPUT(Makefile avilib/Makefile)
diff --git a/multimedia/ogmtools/files/patch-gcc11-compat b/multimedia/ogmtools/files/patch-gcc11-compat
new file mode 100644
index 000000000000..88e556a9bc91
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-gcc11-compat
@@ -0,0 +1,374 @@
+--- p_ac3.cpp
++++ p_ac3.cpp
+@@ -30,7 +30,7 @@
+ ac3_packetizer_c::ac3_packetizer_c(unsigned long nsamples_per_sec,
+                                    int nchannels, int nbitrate,
+                                    audio_sync_t *nasync, range_t *nrange,
+-                                   char **ncomments) throw (error_c) : q_c() {
++                                   char **ncomments) : q_c() {
+   serialno = create_unique_serial();
+   ogg_stream_init(&os, serialno);
+   packetno = 0;
+--- p_ac3.h
++++ p_ac3.h
+@@ -40,7 +40,7 @@
+   public:
+     ac3_packetizer_c(unsigned long nsamples_per_sec, int nchannels,
+                      int nbitrate, audio_sync_t *nasync,
+-                     range_t *nrange, char **ncomments) throw (error_c);
++                     range_t *nrange, char **ncomments);
+     virtual ~ac3_packetizer_c();
+     
+     virtual int     process(char *buf, int size, int last_frame);
+--- p_index.cpp
++++ p_index.cpp
+@@ -28,7 +28,7 @@
+ #include "p_index.h"
+ #include "vorbis_header_utils.h"
+ 
+-index_packetizer_c::index_packetizer_c(int nserial) throw (error_c) : q_c() {
++index_packetizer_c::index_packetizer_c(int nserial) : q_c() {
+   serialno = create_unique_serial();
+   ogg_stream_init(&os, serialno);
+   granulepos = 0;
+--- p_index.h
++++ p_index.h
+@@ -33,7 +33,7 @@
+     ogg_int64_t granulepos, packetno;
+     int         serial;
+   public:
+-    index_packetizer_c(int nserial) throw (error_c);
++    index_packetizer_c(int nserial);
+     virtual ~index_packetizer_c();
+     
+     virtual int     process(idx_entry *entries, int num);
+--- p_mp3.cpp
++++ p_mp3.cpp
+@@ -30,7 +30,7 @@
+ mp3_packetizer_c::mp3_packetizer_c(unsigned long nsamples_per_sec,
+                                    int nchannels, int nmp3rate,
+                                    audio_sync_t *nasync, range_t *nrange,
+-                                   char **ncomments) throw (error_c) : q_c() {
++                                   char **ncomments) : q_c() {
+   serialno = create_unique_serial();
+   ogg_stream_init(&os, serialno);
+   packetno = 0;
+--- p_mp3.h
++++ p_mp3.h
+@@ -40,7 +40,7 @@
+   public:
+     mp3_packetizer_c(unsigned long nsamples_per_sec, int nchannels,
+                      int nmp3rate, audio_sync_t *nasync,
+-                     range_t *nrange, char **ncomments) throw (error_c);
++                     range_t *nrange, char **ncomments);
+     virtual ~mp3_packetizer_c();
+     
+     virtual int     process(char *buf, int size, int last_frame);
+--- p_pcm.cpp
++++ p_pcm.cpp
+@@ -29,7 +29,7 @@
+ pcm_packetizer_c::pcm_packetizer_c(unsigned long nsamples_per_sec,
+                                    int nchannels, int nbits_per_sample,
+                                    audio_sync_t *nasync, range_t *nrange,
+-                                   char **ncomments) throw (error_c) : q_c() {
++                                   char **ncomments) : q_c() {
+   serialno = create_unique_serial();
+   ogg_stream_init(&os, serialno);
+   packetno = 0;
+--- p_pcm.h
++++ p_pcm.h
+@@ -37,7 +37,7 @@
+   public:
+     pcm_packetizer_c(unsigned long nsamples_per_sec, int nchannels,
+                      int nbits_per_sample, audio_sync_t *nasync,
+-                     range_t *nrange, char **ncomments) throw (error_c);
++                     range_t *nrange, char **ncomments);
+     virtual ~pcm_packetizer_c();
+     
+     virtual int     process(char *buf, int size, int last_frame);
+--- p_textsubs.cpp
++++ p_textsubs.cpp
+@@ -29,7 +29,7 @@
+ 
+ textsubs_packetizer_c::textsubs_packetizer_c(audio_sync_t *nasync,
+                                              range_t *nrange, char **ncomments)
+-                                             throw (error_c) : q_c() {
++                                             : q_c() {
+   serialno = create_unique_serial();
+   ogg_stream_init(&os, serialno);
+   packetno = 0;
+--- p_textsubs.h
++++ p_textsubs.h
+@@ -30,7 +30,7 @@
+ 
+   public:
+     textsubs_packetizer_c(audio_sync_t *nasync, range_t *nrange,
+-                          char **ncomments) throw (error_c);
++                          char **ncomments);
+     virtual ~textsubs_packetizer_c();
+     
+     virtual int     process(ogg_int64_t start, ogg_int64_t end, char *_subs,
+--- p_video.cpp
++++ p_video.cpp
+@@ -31,7 +31,7 @@
+                                        int nheight, int nbpp,
+                                        int nmax_frame_size, audio_sync_t *as,
+                                        range_t *nrange, char **ncomments)
+-                                       throw (error_c) : q_c() {
++                                       : q_c() {
+   serialno = create_unique_serial();
+   ogg_stream_init(&os, serialno);
+   packetno = 0;
+--- p_video.h
++++ p_video.h
+@@ -35,7 +35,7 @@
+     range_t         range;
+   public:
+     video_packetizer_c(char *, double, int, int, int, int, audio_sync_t *,
+-                       range_t *nrange, char **ncomments) throw (error_c);
++                       range_t *nrange, char **ncomments);
+     virtual ~video_packetizer_c();
+     
+     virtual int            process(char *buf, int size, int num_frames, int key,
+--- p_vobsub.cpp
++++ p_vobsub.cpp
+@@ -34,7 +34,7 @@
+                                          char *nid, int nindex,
+                                          audio_sync_t *nasync,
+                                          range_t *nrange, char **ncomments)
+-                                         throw (error_c) : q_c() {
++                                         : q_c() {
+   char buffer[50];
+   serialno = create_unique_serial();
+   ogg_stream_init(&os, serialno);
+--- p_vobsub.h
++++ p_vobsub.h
+@@ -43,7 +43,7 @@
+     vobsub_packetizer_c(int nwidth, int nheight, char *npalette,
+                         int nlangidx, char *nid, int nindex,
+                         audio_sync_t *nasync, range_t *nrange,
+-                        char **ncomments) throw (error_c);
++                        char **ncomments);
+     virtual ~vobsub_packetizer_c();
+     
+     virtual int     process(ogg_int64_t start, ogg_int64_t end, char *subs,
+--- p_vorbis.cpp
++++ p_vorbis.cpp
+@@ -30,7 +30,7 @@
+ #include "vorbis_header_utils.h"
+ 
+ vorbis_packetizer_c::vorbis_packetizer_c(audio_sync_t *nasync, range_t *nrange,
+-                                         char **ncomments) throw (error_c)
++                                         char **ncomments)
+                                          : q_c() {
+   packetno = 0;
+   old_granulepos = 0;
+--- p_vorbis.h
++++ p_vorbis.h
+@@ -37,7 +37,7 @@
+ 
+   public:
+     vorbis_packetizer_c(audio_sync_t *nasync, range_t *nrange, char **ncomments)
+-                        throw (error_c);
++                       ;
+     virtual ~vorbis_packetizer_c();
+     
+     virtual int     process(ogg_packet *op, ogg_int64_t gran);
+--- queue.cpp
++++ queue.cpp
+@@ -21,7 +21,7 @@
+ #include "ogmmerge.h"
+ #include "queue.h"
+ 
+-q_c::q_c() throw (error_c) : generic_packetizer_c() {
++q_c::q_c() : generic_packetizer_c() {
+   first = NULL;
+   current = NULL;
+   next_is_key = -1;
+--- queue.h
++++ queue.h
+@@ -36,7 +36,7 @@
+     ogg_stream_state  os;
+     
+   public:
+-    q_c() throw (error_c);
++    q_c();
+     virtual ~q_c();
+     
+     virtual int              add_ogg_page(ogg_page *, int header_page,
+--- r_ac3.cpp
++++ r_ac3.cpp
+@@ -55,7 +55,7 @@
+ }
+ 
+ ac3_reader_c::ac3_reader_c(char *fname, audio_sync_t *nasync,
+-                           range_t *nrange, char **ncomments) throw (error_c) {
++                           range_t *nrange, char **ncomments) {
+   int          pos;
+   ac3_header_t ac3header;
+   
+--- r_ac3.h
++++ r_ac3.h
+@@ -36,7 +36,7 @@
+      
+   public:
+     ac3_reader_c(char *fname, audio_sync_t *nasync, range_t *nrange,
+-                 char **ncomments) throw (error_c);
++                 char **ncomments);
+     virtual ~ac3_reader_c();
+ 
+     virtual int              read();
+--- r_avi.cpp
++++ r_avi.cpp
+@@ -55,7 +55,7 @@
+ avi_reader_c::avi_reader_c(char *fname, unsigned char *astreams,
+                            unsigned char *vstreams, audio_sync_t *nasync,
+                            range_t *nrange, char **ncomments, char *nfourcc,
+-                           char* nav_seek) throw (error_c) {
++                           char* nav_seek) {
+   int            fsize, i;
+   off_t          size;
+   FILE          *f;
+--- r_avi.h
++++ r_avi.h
+@@ -67,7 +67,7 @@
+     avi_reader_c(char *fname, unsigned char *astreams,
+                  unsigned char *vstreams, audio_sync_t *nasync,
+                  range_t *nrange, char **ncomments, char *nfourcc,
+-                 char* nav_seek) throw (error_c);
++                 char* nav_seek);
+     virtual ~avi_reader_c();
+ 
+     virtual int              read();
+--- r_microdvd.cpp
++++ r_microdvd.cpp
+@@ -56,7 +56,7 @@
+ 
+ microdvd_reader_c::microdvd_reader_c(char *fname, audio_sync_t *nasync,
+                                      range_t *nrange, char **ncomments)
+-                                     throw (error_c) {
++                                     {
+   if ((file = fopen(fname, "r")) == NULL)
+     throw error_c("microdvd_reader: Could not open source file.");
+   if (!microdvd_reader_c::probe_file(file, 0))
+--- r_microdvd.h
++++ r_microdvd.h
+@@ -35,7 +35,7 @@
+      
+   public:
+     microdvd_reader_c(char *fname, audio_sync_t *nasync, range_t *nrange,
+-                      char **ncomments) throw (error_c);
++                      char **ncomments);
+     virtual ~microdvd_reader_c();
+ 
+     virtual int              read();
+--- r_mp3.cpp
++++ r_mp3.cpp
+@@ -60,7 +60,7 @@
+ }
+ 
+ mp3_reader_c::mp3_reader_c(char *fname, audio_sync_t *nasync,
+-                           range_t *nrange, char **ncomments) throw (error_c) {
++                           range_t *nrange, char **ncomments) {
+   int           pos;
+   unsigned long header;
+   mp3_header_t  mp3header;
+--- r_mp3.h
++++ r_mp3.h
+@@ -40,7 +40,7 @@
+      
+   public:
+     mp3_reader_c(char *fname, audio_sync_t *nasync, range_t *nrange,
+-                 char **ncomments) throw (error_c);
++                 char **ncomments);
+     virtual ~mp3_reader_c();
+ 
+     virtual int              read();
+--- r_ogm.cpp
++++ r_ogm.cpp
+@@ -60,7 +60,7 @@
+ ogm_reader_c::ogm_reader_c(char *fname, unsigned char *astreams,
+                            unsigned char *vstreams, unsigned char *tstreams,
+                            audio_sync_t *nasync, range_t *nrange,
+-                           char **ncomments, char *nfourcc) throw (error_c) {
++                           char **ncomments, char *nfourcc) {
+   off_t size;
+   
+   if ((file = fopen(fname, "r")) == NULL)
+--- r_ogm.h
++++ r_ogm.h
+@@ -62,7 +62,7 @@
+     ogm_reader_c(char *fname, unsigned char *astreams,
+                  unsigned char *vstreams, unsigned char *tstreams,
+                  audio_sync_t *nasync, range_t *nrange, char **ncomments,
+-                 char *nfourcc) throw (error_c);
++                 char *nfourcc);
+     virtual ~ogm_reader_c();
+ 
+     virtual int                   read();
+--- r_srt.cpp
++++ r_srt.cpp
+@@ -62,7 +62,7 @@
+ }
+ 
+ srt_reader_c::srt_reader_c(char *fname, audio_sync_t *nasync,
+-                           range_t *nrange, char **ncomments) throw (error_c) {
++                           range_t *nrange, char **ncomments) {
+   if ((file = fopen(fname, "r")) == NULL)
+     throw error_c("srt_reader: Could not open source file.");
+   if (!srt_reader_c::probe_file(file, 0))
+--- r_srt.h
++++ r_srt.h
+@@ -35,7 +35,7 @@
+      
+   public:
+     srt_reader_c(char *fname, audio_sync_t *nasync, range_t *nrange,
+-                 char **ncomments) throw (error_c);
++                 char **ncomments);
+     virtual ~srt_reader_c();
+ 
+     virtual int              read();
+--- r_vobsub.cpp
++++ r_vobsub.cpp
+@@ -72,7 +72,7 @@
+ 
+ vobsub_reader_c::vobsub_reader_c(char *fname, audio_sync_t *nasync,
+                                  range_t *nrange, char **ncomments)
+-                                 throw (error_c) {
++                                 {
+   char *name;
+   
+   if ((file = fopen(fname, "r")) == NULL)
+--- r_vobsub.h
++++ r_vobsub.h
+@@ -42,7 +42,7 @@
+      
+   public:
+     vobsub_reader_c(char *fname, audio_sync_t *nasync, range_t *nrange,
+-                    char **ncomments) throw (error_c);
++                    char **ncomments);
+     virtual ~vobsub_reader_c();
+ 
+     virtual int              read();
+--- r_wav.cpp
++++ r_wav.cpp
+@@ -50,7 +50,7 @@
+ }
+ 
+ wav_reader_c::wav_reader_c(char *fname, audio_sync_t *nasync,
+-                           range_t *nrange, char **ncomments) throw (error_c) {
++                           range_t *nrange, char **ncomments) {
+   uint64_t size;
+   uint32_t samplerate;
+   uint16_t channels, bitdepth;
+--- r_wav.h
++++ r_wav.h
+@@ -41,7 +41,7 @@
+      
+   public:
+     wav_reader_c(char *fname, audio_sync_t *nasync, range_t *nrange,
+-                 char **ncomments) throw (error_c);
++                 char **ncomments);
+     virtual ~wav_reader_c();
+ 
+     virtual int              read();
diff --git a/multimedia/ogmtools/files/patch-ogminfo.c b/multimedia/ogmtools/files/patch-ogminfo.c
new file mode 100644
index 000000000000..29c8c5f267b7
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-ogminfo.c
@@ -0,0 +1,149 @@
+--- ogminfo.c.orig	2003-11-20 22:21:36 UTC
++++ ogminfo.c
+@@ -51,7 +51,7 @@ ogg_int64_t  pagebytesread = 0;
+ 
+ void add_stream(stream_t *ndmx) {
+   stream_t *cur = first;
+-  
++
+   if (first == NULL) {
+     first = ndmx;
+     first->next = NULL;
+@@ -66,13 +66,13 @@ void add_stream(stream_t *ndmx) {
+ 
+ stream_t *find_stream(int fserial) {
+   stream_t *cur = first;
+-  
++
+   while (cur != NULL) {
+     if (cur->serial == fserial)
+       break;
+     cur = cur->next;
+   }
+-  
++
+   return cur;
+ }
+ 
+@@ -92,7 +92,7 @@ void usage(char *fname) {
+     "  -V, --version  Show version information.\n", fname);
+ }
+ 
+-#ifndef XIPHCORRECTINTERLEAVING  
++#ifndef XIPHCORRECTINTERLEAVING
+ #define OUTOFSYNC   ((((stream->stype == 't' ? end_pts : start_pts) \
+                        - last_pts) < 0.0 ) ? "OUT_OF_SYNC " : "sync_ok ")
+ #else
+@@ -131,7 +131,7 @@ void dump_streamheader(stream_header *sth, char stype,
+ 
+ int all_header_packets_dumped() {
+   stream_t *stream = first;
+-  
++
+   while (stream != NULL) {
+     if ((stream->stype == 'V') && (stream->header_packets < 3))
+       return 0;
+@@ -139,7 +139,7 @@ int all_header_packets_dumped() {
+       return 0;
+     stream = stream->next;
+   }
+-  
++
+   return 1;
+ }
+ 
+@@ -172,7 +172,7 @@ void handle_packet(stream_t *stream, ogg_packet *pack,
+     vorbis_comment_init(&vc);
+     if (vorbis_unpack_comment(&vc, pack->packet, pack->bytes) != 0)
+       fprintf(stdout, "(%s) %c%d: comment packet, length %ld. This packet "
+-              "does NOT contain a valid Vorbis comment packet!\n", 
++              "does NOT contain a valid Vorbis comment packet!\n",
+               __FILE__, stream->stype, stream->sno, pack->bytes);
+     else {
+       fprintf(stdout, "(%s) %c%d: comment packet, length %ld,", __FILE__,
+@@ -194,9 +194,9 @@ void handle_packet(stream_t *stream, ogg_packet *pack,
+              __FILE__, stream->sno, pack->bytes, ogg_page_granulepos(page),
+              pack->packetno);
+     if (check_timing && (stream->sample_rate != -1)) {
+-      end_pts = (double)ogg_page_granulepos(page) * 
++      end_pts = (double)ogg_page_granulepos(page) *
+                 (double)1000.0 / (double)stream->sample_rate;
+-      start_pts = (double)stream->last_granulepos * 
++      start_pts = (double)stream->last_granulepos *
+                   (double)1000.0 / (double)stream->sample_rate;
+       fprintf(stdout, " start: % 13.2fms  end: % 13.2fms %s",
+               start_pts, end_pts, OUTOFSYNC);
+@@ -224,9 +224,9 @@ void handle_packet(stream_t *stream, ogg_packet *pack,
+               "10lld ", __FILE__, stream->stype, stream->sno, n,
+               ogg_page_granulepos(page), pack->packetno);
+       if (check_timing && (stream->sample_rate != -1)) {
+-        end_pts = (double)ogg_page_granulepos(page) * 
++        end_pts = (double)ogg_page_granulepos(page) *
+                   (double)1000.0 / (double)stream->sample_rate;
+-        start_pts = (double)stream->last_granulepos * 
++        start_pts = (double)stream->last_granulepos *
+                     (double)1000.0 / (double)stream->sample_rate;
+         fprintf(stdout, " start: % 13.2fms  end: % 13.2fms %s",
+                 start_pts, end_pts, OUTOFSYNC);
+@@ -344,8 +344,8 @@ void process_ogm(int fdin)
+       copy_headers(&sth, (old_stream_header *)&pack.packet[1], pack.bytes);
+       if (!strncmp(sth.streamtype, "video", 5)) {
+         unsigned long codec;
+-        codec = (sth.subtype[0] << 24) + 
+-          (sth.subtype[1] << 16) + (sth.subtype[2] << 8) + sth.subtype[3]; 
++        codec = (sth.subtype[0] << 24) +
++          (sth.subtype[1] << 16) + (sth.subtype[2] << 8) + sth.subtype[3];
+         fprintf(stdout, "(%s) (v%d/serial %d) fps: %.3f width height: %dx%d "
+                 "codec: %p (%c%c%c%c)\n", __FILE__, nvstreams + 1,
+                 serialnumber, (double)10000000 /
+@@ -450,7 +450,7 @@ void process_ogm(int fdin)
+       numstreams++;
+     }
+   }
+-  
++
+   if ((verbose == 0) && !summary)
+     exit(0);
+ 
+@@ -500,7 +500,7 @@ void process_ogm(int fdin)
+     }
+     pagebytesread += pageseek;
+   }
+-  
++
+   if (summary) {
+     stream = first;
+     while (stream != NULL) {
+@@ -513,7 +513,7 @@ void process_ogm(int fdin)
+               stream->serial, stream->size,
+               (stream->size * 8.0 / 1000.0) / now,
+               (stream->size / 1024.0) / now,
+-              stream->num_packets, now * 1000.0);
++              stream->num_packets, now);
+       stream = stream->next;
+     }
+   }
+@@ -521,7 +521,7 @@ void process_ogm(int fdin)
+ 
+ int main(int argc, char *argv[]) {
+   int i, fdin = -1;
+-  
++
+   nice(2);
+ 
+   for (i = 1; i < argc; i++)
+@@ -552,11 +552,11 @@ int main(int argc, char *argv[]) {
+     usage(argv[0]);
+     exit(1);
+   }
+-  
++
+   if (verbose >= 2)
+     summary = 1;
+-  process_ogm(fdin);  
+-  
++  process_ogm(fdin);
++
+   close(fdin);
+   return 0;
+ }
diff --git a/multimedia/ogmtools/files/patch-ogmmerge.1 b/multimedia/ogmtools/files/patch-ogmmerge.1
new file mode 100644
index 000000000000..137e837b1849
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-ogmmerge.1
@@ -0,0 +1,11 @@
+--- ogmmerge.1.orig	2004-11-07 10:01:34 UTC
++++ ogmmerge.1
+@@ -126,7 +126,7 @@ After a couple of minutes you can join video and audio
+ .LP
+ $ \fBogmmerge -o MyMovie-with-sound.ogm MyMovie.avi MyMovie.ogg\fP
+ .LP
+-If your AVI already contains an audio track then it will be copied aswell
++If your AVI already contains an audio track then it will be copied as well
+ (if \fBogmmerge\fR supports the audio format). To avoid that simply do
+ .LP
+ $ \fBogmmerge -o MyMovie-with-sound.ogm -A MyMovie.avi MyMovie.ogg\fP
diff --git a/multimedia/ogmtools/files/patch-ogmsplit.1 b/multimedia/ogmtools/files/patch-ogmsplit.1
new file mode 100644
index 000000000000..d39a2b0afd22
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-ogmsplit.1
@@ -0,0 +1,10 @@
+--- ogmsplit.1.orig	2004-11-07 10:01:34 UTC
++++ ogmsplit.1
+@@ -1,6 +1,6 @@
+ .TH OGMSPLIT "1" "November 2004" "ogmsplit v1.5" "User Commands"
+ .SH NAME
+-ogmsplit \- Split OGG/OGM files into sevaral smaller OGG/OGM files
++ogmsplit \- Split OGG/OGM files into several smaller OGG/OGM files
+ .SH SYNOPSIS
+ .B ogmsplit
+ [\fIoptions\fR] \fIinname\fR
diff --git a/multimedia/ogmtools/files/patch-os.h b/multimedia/ogmtools/files/patch-os.h
new file mode 100644
index 000000000000..35fac217459c
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-os.h
@@ -0,0 +1,11 @@
+--- os.h.orig	2023-07-05 18:10:28 UTC
++++ os.h
+@@ -40,7 +40,7 @@
+ #endif // COMP_MINGW || COMP_MSC
+ 
+ #if !defined(COMP_CYGWIN)
+-#include <stdint.h>
++#include <inttypes.h>
+ #endif // !COMP_CYGWIN
+ 
+ #if defined(SYS_WINDOWS)
diff --git a/multimedia/ogmtools/files/patch-vorbis__header__utils.c b/multimedia/ogmtools/files/patch-vorbis__header__utils.c
new file mode 100644
index 000000000000..99a4093c5a40
--- /dev/null
+++ b/multimedia/ogmtools/files/patch-vorbis__header__utils.c
@@ -0,0 +1,21 @@
+--- vorbis_header_utils.c.orig	2003-10-23 19:46:32 UTC
++++ vorbis_header_utils.c
+@@ -153,15 +153,15 @@ vorbis_comment *vorbis_comment_dup(vorbis_comment *vc)
+     die("malloc");
+   
+   memcpy(new_vc, vc, sizeof(vorbis_comment));
+-  new_vc->user_comments = (char **)malloc((vc->comments + 1) * sizeof(char *));
+-  new_vc->comment_lengths = (int *)malloc((vc->comments + 1) * sizeof(int));
++  new_vc->user_comments = (char **)malloc((vc->comments + 1) * sizeof(*new_vc->user_comments));
++  new_vc->comment_lengths = (int *)malloc((vc->comments + 1) * sizeof(*new_vc->comment_lengths));
+   if ((new_vc->user_comments == NULL) || (new_vc->comment_lengths == NULL))
+     die("malloc");
+   for (i = 0; i < vc->comments; i++)
+     new_vc->user_comments[i] = strdup(vc->user_comments[i]);
+   new_vc->user_comments[vc->comments] = 0;
+   memcpy(new_vc->comment_lengths, vc->comment_lengths,
+-         (vc->comments + 1) * sizeof(char *));
++         (vc->comments + 1) * sizeof(*new_vc->comment_lengths));
+   new_vc->vendor = strdup(vc->vendor);
+   
+   return new_vc;