commit:     f9a6f7546f212a395c157b35926e8a1dc4556c4a
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 25 10:57:17 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Jan 25 10:57:31 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9a6f754

media-gfx/xv: Fix -Werror=format-security errors

Gentoo-Bug: 542134
* EAPI=6
* Amended all patches to be compatible with -p1

Package-Manager: portage-2.2.27

 .../xv/files/xv-3.10a-disable-jp2k-20070520.patch  |  4 +-
 media-gfx/xv/files/xv-3.10a-libpng15-r1.patch      |  8 +-
 media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch |  4 +-
 .../xv/files/xv-3.10a-vdcomp-osx-20070520.patch    |  4 +-
 media-gfx/xv/files/xv-3.10a-wformat-security.patch | 19 +++++
 media-gfx/xv/xv-3.10a-r18.ebuild                   | 86 ++++++++++++++++++++++
 6 files changed, 115 insertions(+), 10 deletions(-)

diff --git a/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch 
b/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch
index 41d3023..7e42484 100644
--- a/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch
+++ b/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch
@@ -1,5 +1,5 @@
---- Makefile~  2007-06-24 15:41:58 -0600
-+++ Makefile   2007-06-24 15:42:43 -0600
+--- xv-3.10a/Makefile~ 2007-06-24 15:41:58 -0600
++++ xv-3.10a/Makefile  2007-06-24 15:42:43 -0600
 @@ -176,16 +176,16 @@
  ### if, for whatever reason, you're unable to get the JasPer JPEG-2000 library
  ### to compile on your machine, *COMMENT OUT* the following lines

diff --git a/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch 
b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch
index b3eaeef..9905c4b 100644
--- a/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch
+++ b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch
@@ -1,5 +1,5 @@
---- xvinfo.c
-+++ xvinfo.c
+--- xv-3.10a/xvinfo.c
++++ xv-3.10a/xvinfo.c
 @@ -26,7 +26,7 @@
  #define INFOHIGH 270
  
@@ -9,8 +9,8 @@
  
  /* baseline of top line of text */
  #define TOPBASE (36 + penn_height/2 + 4 + 8 + ASCENT)
---- xvpng.c
-+++ xvpng.c
+--- xv-3.10a/xvpng.c
++++ xv-3.10a/xvpng.c
 @@ -31,6 +31,7 @@
  
  #ifdef HAVE_PNG

diff --git a/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch 
b/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch
index 59a768e..ecafd1d 100644
--- a/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch
+++ b/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch
@@ -1,5 +1,5 @@
---- xv.h~      2007-06-24 14:30:42 -0600
-+++ xv.h       2007-06-24 14:42:04 -0600
+--- xv-3.10a/xv.h~     2007-06-24 14:30:42 -0600
++++ xv-3.10a/xv.h      2007-06-24 14:42:04 -0600
 @@ -158,7 +158,7 @@
  
  #ifndef VMS

diff --git a/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch 
b/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch
index 06e9f8a..2c82b1a 100644
--- a/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch
+++ b/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch
@@ -1,5 +1,5 @@
---- vdcomp.c~  2007-06-24 14:30:42 -0600
-+++ vdcomp.c   2007-06-24 14:48:12 -0600
+--- xv-3.10a/vdcomp.c~ 2007-06-24 14:30:42 -0600
++++ xv-3.10a/vdcomp.c  2007-06-24 14:48:12 -0600
 @@ -123,6 +123,8 @@
  
  #    if defined(hp300) || defined(hp800) || defined(NeXT)

diff --git a/media-gfx/xv/files/xv-3.10a-wformat-security.patch 
b/media-gfx/xv/files/xv-3.10a-wformat-security.patch
new file mode 100644
index 0000000..34d2c19
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-wformat-security.patch
@@ -0,0 +1,19 @@
+Fix errors caused by -Wformat -Werror=format-security
+https://bugs.gentoo.org/show_bug.cgi?id=542134
+
+* xvpbm.c:888:4: error: format not a string literal and no format arguments 
[-Werror=format-security]
+*     if (*pix) fprintf(fp,str1);
+
+--- xv-3.10a/xvpbm.c
++++ xv-3.10a/xvpbm.c
+@@ -885,8 +885,8 @@
+         }
+       }
+       else {
+-        if (*pix) fprintf(fp,str1);
+-             else fprintf(fp,str0);
++        if (*pix) fprintf(fp,"%s",str1);
++             else fprintf(fp,"%s",str0);
+         len+=2;
+         if (len>68) { fprintf(fp,"\n"); len=0; }
+       }

diff --git a/media-gfx/xv/xv-3.10a-r18.ebuild b/media-gfx/xv/xv-3.10a-r18.ebuild
new file mode 100644
index 0000000..795224b
--- /dev/null
+++ b/media-gfx/xv/xv-3.10a-r18.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit eutils flag-o-matic
+
+JUMBOV=20070520
+DESCRIPTION="Interactive image manipulation program supporting a wide variety 
of formats"
+HOMEPAGE="http://www.trilon.com/xv/index.html 
http://www.sonic.net/~roelofs/greg_xv.html";
+SRC_URI="mirror://sourceforge/png-mng/${P}-jumbo-patches-${JUMBOV}.tar.gz
+       ftp://ftp.cis.upenn.edu/pub/xv/${P}.tar.gz
+       mirror://gentoo/${P}.png.bz2"
+
+LICENSE="xv"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd 
~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="jpeg tiff png"
+
+DEPEND="x11-libs/libXt
+       jpeg? ( virtual/jpeg:0 )
+       tiff? ( media-libs/tiff:0 )
+       png? ( >=media-libs/libpng-1.2:0= sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${WORKDIR}/${P}-jumbo-fix-enh-patch-${JUMBOV}.txt"
+       "${FILESDIR}/${P}-osx-bsd-${JUMBOV}.patch"
+       "${FILESDIR}/${P}-vdcomp-osx-${JUMBOV}.patch"
+       "${FILESDIR}/${P}-disable-jp2k-${JUMBOV}.patch"
+       "${FILESDIR}/${P}-fix-wait-${JUMBOV}.patch"
+       "${FILESDIR}/${P}-add-ldflags-${JUMBOV}.patch"
+       "${FILESDIR}/${P}-libpng15-r1.patch"
+       "${FILESDIR}/${P}-wformat-security.patch"
+)
+
+src_prepare() {
+       default
+
+       append-cppflags -DUSE_GETCWD -DLINUX -DUSLEEP
+       use jpeg && append-cppflags -DDOJPEG
+       use png && append-cppflags -DDOPNG
+       use tiff && append-cppflags -DDOTIFF -DUSE_TILED_TIFF_BOTLEFT_FIX
+
+       # Link with various image libraries depending on use flags
+       IMAGE_LIBS=""
+       use jpeg && IMAGE_LIBS="${IMAGE_LIBS} -ljpeg"
+       use png && IMAGE_LIBS="${IMAGE_LIBS} -lz -lpng"
+       use tiff && IMAGE_LIBS="${IMAGE_LIBS} -ltiff"
+
+       sed -i \
+               -e 's/\(^JPEG.*\)/#\1/g' \
+               -e 's/\(^PNG.*\)/#\1/g' \
+               -e 's/\(^TIFF.*\)/#\1/g' \
+               -e "s/\(^LIBS = .*\)/\1${IMAGE_LIBS}/g" Makefile || die
+
+       # /usr/bin/gzip => /bin/gzip
+       sed -i -e 's#/usr\(/bin/gzip\)#'"${EPREFIX}"'\1#g' config.h || die
+
+       # Fix installation of ps docs
+       sed -i -e 's#$(DESTDIR)$(LIBDIR)#$(LIBDIR)#g' Makefile || die
+}
+
+src_compile() {
+       emake \
+               CC="$(tc-getCC)" CCOPTS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+               PREFIX="${EPREFIX}"/usr \
+               DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+               LIBDIR="${T}"
+}
+
+src_install() {
+       dodir /usr/bin
+       dodir /usr/share/man/man1
+
+       emake \
+               DESTDIR="${D}" \
+               PREFIX="${EPREFIX}"/usr \
+               DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+               LIBDIR="${T}" install
+
+       dodoc CHANGELOG BUGS IDEAS
+       newicon "${WORKDIR}"/${P}.png ${PN}.png
+       make_desktop_entry xv "" "" "Graphics;Viewer"
+}

Reply via email to