net-proxy/ziproxy: Support giflib-5 (#571898 by Oleg and Toralf Förster)
authorPacho Ramos <pacho@gentoo.org>
Sun, 16 Oct 2016 08:27:50 +0000 (10:27 +0200)
committerPacho Ramos <pacho@gentoo.org>
Sun, 16 Oct 2016 08:49:45 +0000 (10:49 +0200)
Package-Manager: portage-2.3.1

net-proxy/ziproxy/files/ziproxy-3.3.1-giflib5.patch [new file with mode: 0644]
net-proxy/ziproxy/ziproxy-3.3.1-r1.ebuild

diff --git a/net-proxy/ziproxy/files/ziproxy-3.3.1-giflib5.patch b/net-proxy/ziproxy/files/ziproxy-3.3.1-giflib5.patch
new file mode 100644 (file)
index 0000000..e8404ec
--- /dev/null
@@ -0,0 +1,46 @@
+Description: Build using giflib5
+Forwarded: yes
+Author: Marcos Talau <talau@users.sourceforge.net>
+Author: Matthias Klose <doko@debian.org>
+Last-Update: 2015-11-04
+
+Index: ziproxy-3.3.1/src/image.c
+===================================================================
+--- ziproxy-3.3.1.orig/src/image.c
++++ ziproxy-3.3.1/src/image.c
+@@ -905,7 +905,11 @@ int gif2bitmap(char *inbuf, int insize,
+       desc.size=insize;
+       desc.x.pos=0;
+ 
++#if GIFLIB_MAJOR >= 5
++      if ((GifFile = DGifOpen((void*)&desc, &gif_mem_input, NULL)) == NULL)
++#else
+       if ((GifFile = DGifOpen((void*)&desc, &gif_mem_input)) == NULL) 
++#endif
+               return( IMG_RET_ERR_UNKNOWN + IMG_RET_FLG_WHILE_DECOMP);//more possible reasons
+ 
+       bmp = new_raw_bitmap();
+@@ -1083,7 +1087,11 @@ int gif2bitmap(char *inbuf, int insize,
+       }
+       bmp->pal_bpp = bmp->bpp;
+       
++#if GIFLIB_MAJOR >= 5
++      DGifCloseFile(GifFile, NULL);
++#else
+       DGifCloseFile(GifFile);
++#endif        
+       return IMG_RET_OK;
+ }
+ 
+@@ -1738,7 +1746,11 @@ static int bitmap2jp2 (raw_bitmap *bmp,
+               cmptparm->width = cwidth [cmptno];
+               cmptparm->height = cheight [cmptno];
+               cmptparm->prec = cbitlen [cmptno];
++#if GIFLIB_MAJOR >= 5
++              cmptparm->sgnd = 0;     // we only generate unsigned components
++#else
+               cmptparm->sgnd = false; // we only generate unsigned components
++#endif
+ 
+               cshiftR [cmptno] = 8 - cbitlen [cmptno]; // calculate the resampling shift for this component
+       }
index 6ebbbf477c9418039fde5108a5e755431e40769b..9228a26c628787255daf97571f90abe5967ca14e 100644 (file)
@@ -15,7 +15,7 @@ KEYWORDS="~amd64 ~ppc ~sparc ~x86"
 IUSE="jpeg2k sasl xinetd"
 
 RDEPEND="
-       media-libs/giflib
+       media-libs/giflib:0=
        media-libs/libpng:0=
        virtual/jpeg
        sys-libs/zlib
@@ -23,9 +23,9 @@ RDEPEND="
        sasl? ( dev-libs/cyrus-sasl )
        xinetd? ( virtual/inetd )
 "
-DEPEND="${RDEPEND}
-       app-arch/xz-utils
-"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}"/${P}-giflib5.patch )
 
 pkg_setup() {
        enewgroup ziproxy
@@ -57,7 +57,7 @@ src_configure() {
 }
 
 src_install() {
-       emake DESTDIR="${D}" install
+       default
 
        dodir /usr/sbin
        mv -vf "${D}"usr/{,s}bin/ziproxy || die
@@ -67,7 +67,6 @@ src_install() {
        newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
        newconfd "${FILESDIR}"/${PN}.confd ${PN}
 
-       dodoc ChangeLog CREDITS README README.tools
        use jpeg2k && dodoc JPEG2000.txt
 
        insinto /etc