diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2024-03-14 22:56:57 -0400 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-03-15 03:18:07 +0000 |
commit | 5db915754b1c54eb9bbab1cd3a43fcfc51dd2ae0 (patch) | |
tree | 325d6c388669e034c750c92a049fc2c43c8092a7 /media-video | |
parent | net-analyzer/nstats: update EAPI 7 -> 8, filter LTO, fix DEPEND/BDEPEND (diff) | |
download | gentoo-5db915754b1c54eb9bbab1cd3a43fcfc51dd2ae0.tar.gz gentoo-5db915754b1c54eb9bbab1cd3a43fcfc51dd2ae0.tar.bz2 gentoo-5db915754b1c54eb9bbab1cd3a43fcfc51dd2ae0.zip |
media-video/mpeg-tools: fix various horribleness related to c99 porting
The project is dead upstream. The server for the homepage doesn't even
exist. The code is heavily crusty as well, as it uses lots of K&R C and
implicit-int functions that are implict.
Apply fixes until it caves in and starts building with Modern C.
Closes: https://bugs.gentoo.org/880833
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-video')
3 files changed, 131 insertions, 1 deletions
diff --git a/media-video/mpeg-tools/files/0001-fix-K-R-C-on-various-counts.patch b/media-video/mpeg-tools/files/0001-fix-K-R-C-on-various-counts.patch new file mode 100644 index 000000000000..1bdada074790 --- /dev/null +++ b/media-video/mpeg-tools/files/0001-fix-K-R-C-on-various-counts.patch @@ -0,0 +1,98 @@ +From 0905d53337e2d7d72575684a72a466df1b13c610 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz <eschwartz93@gmail.com> +Date: Thu, 14 Mar 2024 22:37:59 -0400 +Subject: [PATCH] fix K&R C on various counts + +--- + convert/jmovie2jpeg.c | 7 ++----- + convert/mpeg_demux.c | 2 +- + convert/mtv/movieToVid.c | 16 ++++------------ + 3 files changed, 7 insertions(+), 18 deletions(-) + +diff --git a/convert/jmovie2jpeg.c b/convert/jmovie2jpeg.c +index 7583135..d77505a 100644 +--- a/convert/jmovie2jpeg.c ++++ b/convert/jmovie2jpeg.c +@@ -39,17 +39,14 @@ + + #define HEADER_SIZE 607 /*JFIF header size used on output images*/ + +-usage (p) +-char *p; ++void usage (char *p) + + { + fprintf (stderr, "Usage: %s infilename outfilename start-frame-no end-frame-no\n", p); + exit (1); + } + +-main (argc, argv) +-int argc; +-char **argv; ++int main (int argc, char **argv) + { + char *infilename; /* input filename string */ + char *obase; /* output filename base string=>obase##.jpg */ +diff --git a/convert/mpeg_demux.c b/convert/mpeg_demux.c +index bcce728..505afd1 100644 +--- a/convert/mpeg_demux.c ++++ b/convert/mpeg_demux.c +@@ -110,7 +110,7 @@ static int gNumPrivate_2_Packets; + static FILE *errorOutput; + #endif + +-main(int argc, char **argv) ++int main(int argc, char **argv) + { + unsigned int startCode; + int errorCode; +diff --git a/convert/mtv/movieToVid.c b/convert/mtv/movieToVid.c +index 4f02a3b..7262db8 100644 +--- a/convert/mtv/movieToVid.c ++++ b/convert/mtv/movieToVid.c +@@ -1,5 +1,6 @@ + #include <stdio.h> + #include <malloc.h> ++#include <strings.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/mman.h> +@@ -64,7 +65,7 @@ MapFile (filename) + *-------------------------------------------------------------- + */ + +-WriteScriptFile (name, dataDir, indexDir, host, headerPtr, offsets, numFrames) ++void WriteScriptFile (name, dataDir, indexDir, host, headerPtr, offsets, numFrames) + char *name, *dataDir; + char *indexDir, *host; + jpheader *headerPtr; +@@ -120,11 +121,7 @@ WriteScriptFile (name, dataDir, indexDir, host, headerPtr, offsets, numFrames) + *-------------------------------------------------------------- + */ + +-WriteOfsFile (name, dir, headerPtr, offsets, numFrames) +- char *name, *dir; +- jpheader *headerPtr; +- int *offsets; +- int numFrames; ++void WriteOfsFile (char *name, char *dir, jpheader *headerPtr, int *offsets, int numFrames) + { + FILE *outFile; + char str[512]; +@@ -172,12 +169,7 @@ WriteOfsFile (name, dir, headerPtr, offsets, numFrames) + *-------------------------------------------------------------- + */ + +-WriteVidFile (name, dir, headerPtr, fot, numFrames, offset) +- char *name, *dir; +- jpheader *headerPtr; +- int *fot; +- int numFrames; +- int *offset; ++void WriteVidFile (char *name, char *dir, jpheader *headerPtr, int *fot, int numFrames, int *offset) + { + FILE *vidFile; + FILE *audFile; +-- +2.43.2 + diff --git a/media-video/mpeg-tools/files/0001-fix-missing-prototype-for-internal-jpeg-ABI.patch b/media-video/mpeg-tools/files/0001-fix-missing-prototype-for-internal-jpeg-ABI.patch new file mode 100644 index 000000000000..ade113830cfa --- /dev/null +++ b/media-video/mpeg-tools/files/0001-fix-missing-prototype-for-internal-jpeg-ABI.patch @@ -0,0 +1,30 @@ +From 4b4d0def00b0a549ea0bf86cfb7452bffc1f9111 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz <eschwartz93@gmail.com> +Date: Thu, 14 Mar 2024 22:24:51 -0400 +Subject: [PATCH] fix missing prototype for internal jpeg ABI + +--- + mpeg_encode/jpeg.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/mpeg_encode/jpeg.c b/mpeg_encode/jpeg.c +index 2dc9438..b07c9ea 100644 +--- a/mpeg_encode/jpeg.c ++++ b/mpeg_encode/jpeg.c +@@ -83,6 +83,13 @@ + + #define HEADER_SIZE 607 /*JFIF header size used on output images*/ + ++/* This prototype comes from jpegint.h; it is not public, but the code uses it ++ * and libjpeg exports it for internal use. Just keep it building. */ ++EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, ++ JSAMPARRAY output_array, int dest_row, ++ int num_rows, JDIMENSION num_cols)); ++ ++ + /*=======================================================================* + * * + * JMovie2JPEG * +-- +2.43.2 + diff --git a/media-video/mpeg-tools/mpeg-tools-1.5b-r5.ebuild b/media-video/mpeg-tools/mpeg-tools-1.5b-r5.ebuild index acd331b70b3f..c53ba754e99f 100644 --- a/media-video/mpeg-tools/mpeg-tools-1.5b-r5.ebuild +++ b/media-video/mpeg-tools/mpeg-tools-1.5b-r5.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -28,6 +28,8 @@ PATCHES=( "${FILESDIR}"/${P}-jpeg.patch "${FILESDIR}"/${P}-tempfile-mpeg-encode.patch "${FILESDIR}"/${P}-tempfile-tests.patch + "${FILESDIR}"/0001-fix-missing-prototype-for-internal-jpeg-ABI.patch + "${FILESDIR}"/0001-fix-K-R-C-on-various-counts.patch ) src_prepare() { |