From 836dd8e587b3f1cc83ad14e9aebbd5c45404f7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Sun, 27 Jul 2014 18:54:37 +0000 Subject: [PATCH] =?UTF-8?q?*=20Sat=20Jul=2026=202014=20S=C3=A9rgio=20Basto?= =?UTF-8?q?=20=20-=202.1.0-4=20-=20Rebuild=20for=20new?= =?UTF-8?q?=20libSDL=5Fgfx,=20need=20by=20mjpegtools-gui=20-=20Fix=20FTBFS?= =?UTF-8?q?=20for=20errors=20"format=20not=20a=20string=20literal=20and=20?= =?UTF-8?q?no=20format=20arguments"=20because=20=20=20=20=20FESCO=20decide?= =?UTF-8?q?d=20Enable=20"-Werror=3Dformat-security"=20by=20default=20=20?= =?UTF-8?q?=20=20=20https://fedorahosted.org/fesco/ticket/1185=20-=20Bring?= =?UTF-8?q?=20and=20add=20two=20patches=20from=20Gentoo:=20mjpegtools-2.1.?= =?UTF-8?q?0-pic.patch=20and=20mjpegtools-2.1.0-sdl-cflags.patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mjpegtools-2.1.0-no_format.patch | 70 +++++++++++++++++++++++++++++++ mjpegtools-2.1.0-pic.patch | 69 ++++++++++++++++++++++++++++++ mjpegtools-2.1.0-sdl-cflags.patch | 11 +++++ mjpegtools.spec | 12 ++++++ 4 files changed, 162 insertions(+) create mode 100644 mjpegtools-2.1.0-no_format.patch create mode 100644 mjpegtools-2.1.0-pic.patch create mode 100644 mjpegtools-2.1.0-sdl-cflags.patch diff --git a/mjpegtools-2.1.0-no_format.patch b/mjpegtools-2.1.0-no_format.patch new file mode 100644 index 0000000..20ed996 --- /dev/null +++ b/mjpegtools-2.1.0-no_format.patch @@ -0,0 +1,70 @@ +--- ./lavtools/lav_io.c.orig 2014-07-27 17:48:21.474622974 +0100 ++++ ./lavtools/lav_io.c 2014-07-27 17:48:48.838881166 +0100 +@@ -926,7 +926,7 @@ lav_file_t *lav_open_input_file(char *fi + strcat(errmsg, ", quicktime"); + #endif + strcat(errmsg, ").\n"); +- fprintf(stderr, errmsg); ++ fprintf(stderr, "%s", errmsg); + free(lav_fd); + internal_error = ERROR_FORMAT; /* Format not recognized */ + return 0; +--- ./lavtools/lavtrans.c.orig 2014-07-27 17:58:09.410282056 +0100 ++++ ./lavtools/lavtrans.c 2014-07-27 17:59:24.769016140 +0100 +@@ -275,7 +275,7 @@ int main(int argc, char ** argv) + if (process_image_frame != -1) + { + nv = el_get_video_frame(vbuff, process_image_frame, &el); +- sprintf(imgfname,outfile); ++ sprintf(imgfname, "%s", outfile); + imgfd = fopen(imgfname,"wb"); + if (imgfd==0) system_error("opening image file","fopen"); + res = fwrite(vbuff,nv,1,imgfd); +--- ./lavtools/jpeg2yuv.c.orig 2014-07-27 18:00:55.600900476 +0100 ++++ ./lavtools/jpeg2yuv.c 2014-07-27 18:01:36.848301893 +0100 +@@ -451,7 +451,7 @@ static int generate_YUV4MPEG(parameters_ + + if (firstjpeg) { + p = firstjpeg; +- sprintf(jpegname, firstjpeg); ++ sprintf(jpegname, "%s", firstjpeg); + firstjpeg = NULL; + } + else { +--- ./mplex/main.cpp.orig 2014-07-27 18:11:38.282143657 +0100 ++++ ./mplex/main.cpp 2014-07-27 18:06:40.352252415 +0100 +@@ -614,7 +614,7 @@ bool CmdLineMultiplexJob::ParseWorkaroun + if( flag_table[flag].longname != 0 ) + message += sep; + } +- mjpeg_error( message.c_str() ); ++ mjpeg_error( "%s", message.c_str() ); + return false; + } + +--- ./yuvfilters/yuvkineco.c.orig 2014-07-27 18:15:01.476097522 +0100 ++++ ./yuvfilters/yuvkineco.c 2014-07-27 18:15:29.540366245 +0100 +@@ -48,7 +48,7 @@ buf_debug(char *buf, FILE *fp, const cha + } else { + #ifdef MJPEGTOOLS + buf[n] = '\0'; +- mjpeg_debug(buf); ++ mjpeg_debug("%s", buf); + #else + fputs(buf, stderr); + #endif +--- ./yuvfilters/yuvfilters.h.orig 2014-07-27 18:37:02.712645244 +0100 ++++ ./yuvfilters/yuvfilters.h 2014-07-27 19:13:28.156101800 +0100 +@@ -34,9 +34,9 @@ extern "C" { + + #ifdef MJPEGTOOLS + # define perror(MSG) mjpeg_error("%s: %s", MSG, strerror(errno)) +-# define WERROR(MSG) mjpeg_error(MSG) +-# define WERRORL(MSG) mjpeg_error(MSG) +-# define WWARN(MSG) mjpeg_warn(MSG) ++# define WERROR(MSG) mjpeg_error("%s", MSG) ++# define WERRORL(MSG) mjpeg_error("%s", MSG) ++# define WWARN(MSG) mjpeg_warn("%s", MSG) + #else + # define WERROR(MSG) write(2, MSG "\n", sizeof MSG) + # define WERRORL(MSG) do { write(2, MSG, strlen(MSG)); write(2, "\n", 1); } while (0) diff --git a/mjpegtools-2.1.0-pic.patch b/mjpegtools-2.1.0-pic.patch new file mode 100644 index 0000000..7d0d1b6 --- /dev/null +++ b/mjpegtools-2.1.0-pic.patch @@ -0,0 +1,69 @@ +Index: y4mdenoise/Makefile.am +=================================================================== +RCS file: /cvsroot/mjpeg/mjpeg_play/y4mdenoise/Makefile.am,v +retrieving revision 1.12 +retrieving revision 1.13 +diff -u -r1.12 -r1.13 +--- y4mdenoise/Makefile.am 1 Apr 2012 08:44:49 -0000 1.12 ++++ y4mdenoise/Makefile.am 28 Nov 2013 22:39:41 -0000 1.13 +@@ -4,8 +4,8 @@ + + EXTRA_DIST = implementation.html + +-AM_CFLAGS = -DNDEBUG -finline-functions @PROGRAM_NOPIC@ +-AM_CXXFLAGS = -DNDEBUG -finline-functions @PROGRAM_NOPIC@ ++AM_CFLAGS = -DNDEBUG -finline-functions ++AM_CXXFLAGS = -DNDEBUG -finline-functions + + INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/utils + +Index: y4munsharp/Makefile.am +=================================================================== +RCS file: /cvsroot/mjpeg/mjpeg_play/y4munsharp/Makefile.am,v +retrieving revision 1.2 +retrieving revision 1.3 +diff -u -r1.2 -r1.3 +--- y4munsharp/Makefile.am 16 Jun 2005 17:09:38 -0000 1.2 ++++ y4munsharp/Makefile.am 28 Nov 2013 22:39:41 -0000 1.3 +@@ -4,7 +4,7 @@ + + INCLUDES = -I $(top_srcdir)/utils -I $(top_srcdir) + +-y4munharp_CFLAGS=@PROGRAM_NOPIC@ ++y4munharp_CFLAGS= + + bin_PROGRAMS = y4munsharp + +Index: y4mutils/Makefile.am +=================================================================== +RCS file: /cvsroot/mjpeg/mjpeg_play/y4mutils/Makefile.am,v +retrieving revision 1.7 +retrieving revision 1.8 +diff -u -r1.7 -r1.8 +--- y4mutils/Makefile.am 1 Apr 2012 08:44:49 -0000 1.7 ++++ y4mutils/Makefile.am 28 Nov 2013 22:39:41 -0000 1.8 +@@ -2,7 +2,7 @@ + + MAINTAINERCLEANFILES = Makefile.in + +-AM_CFLAGS = @PROGRAM_NOPIC@ ++AM_CFLAGS = + AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/utils + + LIBMJPEGUTILS = $(top_builddir)/utils/libmjpegutils.la +Index: yuvscaler/Makefile.am +=================================================================== +RCS file: /cvsroot/mjpeg/mjpeg_play/yuvscaler/Makefile.am,v +retrieving revision 1.5 +retrieving revision 1.6 +diff -u -r1.5 -r1.6 +--- yuvscaler/Makefile.am 1 Apr 2012 08:44:49 -0000 1.5 ++++ yuvscaler/Makefile.am 28 Nov 2013 22:39:41 -0000 1.6 +@@ -18,6 +18,6 @@ + + EXTRA_DIST = yuvscaler_implementation.txt + +-yuvscaler_CFLAGS=@PROGRAM_NOPIC@ ++yuvscaler_CFLAGS= + yuvscaler_SOURCES = yuvscaler.c yuvscaler_resample.c yuvscaler_bicubic.c + yuvscaler_LDADD = $(LIBMJPEGUTILS) $(LIBM_LIBS) diff --git a/mjpegtools-2.1.0-sdl-cflags.patch b/mjpegtools-2.1.0-sdl-cflags.patch new file mode 100644 index 0000000..3bb7563 --- /dev/null +++ b/mjpegtools-2.1.0-sdl-cflags.patch @@ -0,0 +1,11 @@ +diff a/y4mutils/Makefile.am b/y4mutils/Makefile.am +--- a/y4mutils/Makefile.am ++++ b/y4mutils/Makefile.am +@@ -44,6 +44,7 @@ y4mspatialfilter_LDADD = $(LIBMJPEGUTILS) $(LIBM_LIBS) + + y4mhist_SOURCES = y4mhist.c + y4mhist_LDADD = $(SDL_LIBS) $(SDLgfx_LIBS) $(LIBMJPEGUTILS) ++y4mhist_CPPFLAGS = $(AM_CPPFLAGS) $(SDL_CFLAGS) + + y4mblack_SOURCES = y4mblack.c + y4mblack_LDADD = $(LIBMJPEGUTILS) diff --git a/mjpegtools.spec b/mjpegtools.spec index 9c5ccf0..7a70401 100644 --- a/mjpegtools.spec +++ b/mjpegtools.spec @@ -6,6 +6,10 @@ Group: Applications/Multimedia License: GPLv2 URL: http://mjpeg.sourceforge.net/ Source0: http://downloads.sourceforge.net/mjpeg/%{name}-%{version}.tar.gz +Patch0: mjpegtools-2.1.0-sdl-cflags.patch +Patch1: mjpegtools-2.1.0-no_format.patch +Patch2: mjpegtools-2.1.0-pic.patch + BuildRequires: libjpeg-devel BuildRequires: nasm BuildRequires: libdv-devel @@ -96,6 +100,10 @@ for building applications that use mjpegtools lavpipe libraries. %prep %setup -q +%patch0 -p1 -b .sdl +%patch1 -p1 -b .format +%patch2 -p0 -b .fpic + sed -i -e 's/ARCHFLAGS=.*/ARCHFLAGS=/' configure* sed -i -e 's|/lib /usr/lib|/%{_lib} %{_libdir}|' configure # lib64 rpaths for f in docs/yuvfps.1 ; do @@ -183,6 +191,10 @@ rm $RPM_BUILD_ROOT%{_bindir}/mpegtranscode %changelog * Sat Jul 26 2014 Sérgio Basto - 2.1.0-4 - Rebuild for new libSDL_gfx, need by mjpegtools-gui +- Fix FTBFS for errors "format not a string literal and no format arguments" because + FESCO decided Enable "-Werror=format-security" by default + https://fedorahosted.org/fesco/ticket/1185 +- Bring and add two patches from Gentoo: mjpegtools-2.1.0-pic.patch and mjpegtools-2.1.0-sdl-cflags.patch * Tue Nov 19 2013 Sérgio Basto - 2.1.0-3 - Better obsoletes/provides for y4mscaler.