Unbundle media-libs/jpeg. Bug #255453
authorAlfredo Tupone <tupone@gentoo.org>
Wed, 10 Mar 2010 09:54:08 +0000 (09:54 +0000)
committerAlfredo Tupone <tupone@gentoo.org>
Wed, 10 Mar 2010 09:54:08 +0000 (09:54 +0000)
Package-Manager: portage-2.1.7.17/cvs/Linux i686

games-fps/openarena/ChangeLog
games-fps/openarena/Manifest
games-fps/openarena/files/openarena-0.8.1-unbundling.patch [new file with mode: 0644]
games-fps/openarena/files/openarena-0.8.1-zlib.patch [deleted file]
games-fps/openarena/openarena-0.8.1-r1.ebuild

index afdb4d41f71abd543c2dacab92d9c71688fb88cf..f7d54b88645e270214253f48f84b5f9210cfb2ae 100644 (file)
@@ -1,6 +1,11 @@
 # ChangeLog for games-fps/openarena
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/openarena/ChangeLog,v 1.11 2010/03/06 22:04:30 tupone Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/openarena/ChangeLog,v 1.12 2010/03/10 09:54:08 tupone Exp $
+
+  10 Mar 2010; Tupone Alfredo <tupone@gentoo.org> openarena-0.8.1-r1.ebuild,
+  +files/openarena-0.8.1-unbundling.patch,
+  -files/openarena-0.8.1-zlib.patch:
+  Unbundle media-libs/jpeg. Bug #255453 by flameeyes@gentoo.org
 
 *openarena-0.8.1-r1 (06 Mar 2010)
 
index 90ee5f690a08124e5c4e9defaf31828f0ec3a142..2165da6f290b13c2d984c1b8f2e449b91ecaf5d8 100644 (file)
@@ -1,7 +1,7 @@
 AUX openarena-0.8.1-makefile.patch 858 RMD160 4243380e3aca2aa1fd916ba7633f9a01cf00f308 SHA1 93c15c8d453fcae7c2647bdcc04dd7dbab2caf9f SHA256 68ae0af3b94fa4ec013de43f23e85477d45932170c38c4661ccc2339f5377597
-AUX openarena-0.8.1-zlib.patch 3112 RMD160 dd8985f1b527c5a094656c897a37f3528ca5cca0 SHA1 d6700e1c7ddf3349c01d1398859c05d010888731 SHA256 b71fe4752badbae3ffef999a6a589c1f15265567773687b549132721234e6d06
+AUX openarena-0.8.1-unbundling.patch 7274 RMD160 b09d6bcdabf640947a58a2c98112398dbb3af398 SHA1 13515c565f0956ea9c305553ba6b755d31f9e238 SHA256 4819e0b5531707b0a0224286765bc83065486fc700c2a201df49cf9e7191fb29
 DIST oa081.zip 318927645 RMD160 9009eaf581ad0bf19296418da1a16e2d43daec16 SHA1 526c39e51d0b53177b02bd490bf830f622f35ad5 SHA256 c96282de8bc2ac5781df58c6adbce4265376e36190af50d7528f51dc739b6d7d
 DIST openarena-engine-0.8.1-1.tar.bz2 2951703 RMD160 123e9f70621fd856385c6ca7ad0580b81454d687 SHA1 6de345c0bebd87e1406cb07189537db99a422808 SHA256 430ba9b691c8085b946e004f0cc890995c7f8295498bd8c8ce744293a87274d2
-EBUILD openarena-0.8.1-r1.ebuild 2276 RMD160 e765fcc580ab4ddfe0fcd7ec11cc98acbff0c5fa SHA1 cc47f0604ba6e6d51bdc172bc2fa75a7486473df SHA256 6f3f75d302ace3ef6511e742a46ee9284e7a5bbce5d2cec4f9db1d59040a0bba
-MISC ChangeLog 2158 RMD160 59d573ada6088a548b37905c81d5371679ba00f4 SHA1 a574d4a94787c832bcdbb3f6fab4c9fe8b4ff121 SHA256 bf4f4f373cb57b35f421fe4f7b63e83fe4f271b2cc51fc67512a37963c7b8f66
+EBUILD openarena-0.8.1-r1.ebuild 2299 RMD160 dc4d8a6af1dc9e062715cf206f4fe856b62fc8ca SHA1 88d0be1f8af65fbb9528f7c7e2922fb8007a592b SHA256 0ba31ce3e0ee1fb5fdca8b432a7f62e3654ac7b42ac8a3bc246bb7c4d073a73e
+MISC ChangeLog 2380 RMD160 97363458ff889161f35c917d7e5847e86d1f6240 SHA1 1bfba8d19202a82b18b4a1d6b17875432339701d SHA256 4b042ec61a930e51c48201c489ad98b8361aa80326287f1f4b2fdcaf0c0b2bcb
 MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3
diff --git a/games-fps/openarena/files/openarena-0.8.1-unbundling.patch b/games-fps/openarena/files/openarena-0.8.1-unbundling.patch
new file mode 100644 (file)
index 0000000..34eaac2
--- /dev/null
@@ -0,0 +1,260 @@
+--- openarena-engine-0.8.1/Makefile.old        2010-03-06 21:51:19.000000000 +0100
++++ openarena-engine-0.8.1/Makefile    2010-03-06 21:58:01.000000000 +0100
+@@ -283,9 +283,9 @@
+   SHLIBLDFLAGS=-shared $(LDFLAGS)
+ 
+   THREAD_LDFLAGS=-lpthread
+-  LDFLAGS=-ldl -lm
++  LDFLAGS=-ldl -lm -lz
+ 
+-  CLIENT_LDFLAGS=$(shell sdl-config --libs) -lGL
++  CLIENT_LDFLAGS=$(shell sdl-config --libs) -lGL -ljpeg
+ 
+   ifeq ($(USE_OPENAL),1)
+     ifneq ($(USE_OPENAL_DLOPEN),1)
+@@ -560,7 +560,7 @@
+ 
+   THREAD_LDFLAGS=-lpthread
+   # don't need -ldl (FreeBSD)
+-  LDFLAGS=-lm
++  LDFLAGS=-lm -lz
+ 
+   CLIENT_LDFLAGS =
+ 
+@@ -616,7 +616,7 @@
+   SHLIBLDFLAGS=-shared $(LDFLAGS)
+ 
+   THREAD_LDFLAGS=-lpthread
+-  LDFLAGS=-lm
++  LDFLAGS=-lm -lz
+ 
+   CLIENT_LDFLAGS =
+ 
+@@ -644,7 +644,7 @@
+     ARCH=i386
+   endif
+ 
+-  LDFLAGS=-lm
++  LDFLAGS=-lm -lz
+   SHLIBEXT=so
+   SHLIBCFLAGS=-fPIC
+   SHLIBLDFLAGS=-shared $(LDFLAGS)
+@@ -683,10 +683,10 @@
+   SHLIBCFLAGS=
+   SHLIBLDFLAGS=-shared
+ 
+-  LDFLAGS=-ldl -lm -lgen
++  LDFLAGS=-ldl -lm -lgen -lz
+   # FIXME: The X libraries probably aren't necessary?
+   CLIENT_LDFLAGS=-L/usr/X11/$(LIB) $(shell sdl-config --libs) -lGL \
+-    -lX11 -lXext -lm
++    -lX11 -lXext -lm -ljpeg
+ 
+ else # ifeq IRIX
+ 
+@@ -750,11 +750,11 @@
+   SHLIBLDFLAGS=-shared $(LDFLAGS)
+ 
+   THREAD_LDFLAGS=-lpthread
+-  LDFLAGS=-lsocket -lnsl -ldl -lm
++  LDFLAGS=-lsocket -lnsl -ldl -lm -lz
+ 
+   BOTCFLAGS=-O0
+ 
+-  CLIENT_LDFLAGS +=$(shell sdl-config --libs) -lGL
++  CLIENT_LDFLAGS +=$(shell sdl-config --libs) -lGL -ljpeg
+ 
+ else # ifeq sunos
+ 
+@@ -1278,41 +1278,7 @@
+   $(B)/client/l_script.o \
+   $(B)/client/l_struct.o \
+   \
+-  $(B)/client/jcapimin.o \
+-  $(B)/client/jcapistd.o \
+-  $(B)/client/jchuff.o   \
+-  $(B)/client/jcinit.o \
+-  $(B)/client/jccoefct.o  \
+-  $(B)/client/jccolor.o \
+-  $(B)/client/jfdctflt.o \
+-  $(B)/client/jcdctmgr.o \
+-  $(B)/client/jcphuff.o \
+-  $(B)/client/jcmainct.o \
+-  $(B)/client/jcmarker.o \
+-  $(B)/client/jcmaster.o \
+-  $(B)/client/jcomapi.o \
+-  $(B)/client/jcparam.o \
+-  $(B)/client/jcprepct.o \
+-  $(B)/client/jcsample.o \
+-  $(B)/client/jdapimin.o \
+-  $(B)/client/jdapistd.o \
+   $(B)/client/jdatasrc.o \
+-  $(B)/client/jdcoefct.o \
+-  $(B)/client/jdcolor.o \
+-  $(B)/client/jddctmgr.o \
+-  $(B)/client/jdhuff.o \
+-  $(B)/client/jdinput.o \
+-  $(B)/client/jdmainct.o \
+-  $(B)/client/jdmarker.o \
+-  $(B)/client/jdmaster.o \
+-  $(B)/client/jdpostct.o \
+-  $(B)/client/jdsample.o \
+-  $(B)/client/jdtrans.o \
+-  $(B)/client/jerror.o \
+-  $(B)/client/jidctflt.o \
+-  $(B)/client/jmemmgr.o \
+-  $(B)/client/jmemnobs.o \
+-  $(B)/client/jutils.o \
+   \
+   $(B)/client/tr_animation.o \
+   $(B)/client/tr_backend.o \
+--- openarena-engine-0.8.1/code/qcommon/unzip.h.old    2010-03-06 21:59:46.000000000 +0100
++++ openarena-engine-0.8.1/code/qcommon/unzip.h        2010-03-06 22:00:58.000000000 +0100
+@@ -19,6 +19,8 @@
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ ===========================================================================
+ */
++#include <zconf.h>
++#include <zlib.h>
+ 
+ #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+ /* like the STRICT of WIN32, we define a pointer that cannot be converted
+@@ -80,6 +82,7 @@
+ typedef void* (*alloc_func) (void* opaque, unsigned int items, unsigned int size);
+ typedef void   (*free_func) (void* opaque, void* address);
+ 
++#if 0
+ struct internal_state;
+ 
+ typedef struct z_stream_s {
+@@ -105,6 +108,7 @@
+ 
+ typedef z_stream *z_streamp;
+ 
++#endif
+ 
+ /* file_in_zip_read_info_s contain internal information about a file in zipfile,
+     when reading and decompress it */
+--- openarena-engine-0.8.1/code/qcommon/unzip.c.old    2010-03-06 22:01:40.000000000 +0100
++++ openarena-engine-0.8.1/code/qcommon/unzip.c        2010-03-06 22:03:35.000000000 +0100
+@@ -49,7 +49,7 @@
+       ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
+    PkWare has also a specification at :
+       ftp://ftp.pkware.com/probdesc.zip */
+-
++#if 0
+ /* zlib.h -- interface of the 'zlib' general purpose compression library
+   version 1.1.3, July 9th, 1998
+ 
+@@ -955,6 +955,7 @@
+ // static const char   * zError           OF((int err));
+ // static int            inflateSyncPoint OF((z_streamp z));
+ // static const uLong * get_crc_table    OF((void));
++#endif
+ 
+ typedef unsigned char  uch;
+ typedef unsigned short ush;
+@@ -2248,6 +2249,8 @@
+       return (int)uReadThis;
+ }
+ 
++#if 0
++
+ /* infblock.h -- header to use infblock.c
+  * Copyright (C) 1995-1998 Mark Adler
+  * For conditions of distribution and use, see copyright notice in zlib.h 
+@@ -4295,3 +4298,4 @@
+ }
+ 
+ 
++#endif
+--- openarena-engine-0.8.1/code/jpeg-6/jdatasrc.c.old  2010-03-10 09:13:25.000000000 +0100
++++ openarena-engine-0.8.1/code/jpeg-6/jdatasrc.c      2010-03-10 09:23:39.000000000 +0100
+@@ -16,9 +16,15 @@
+ 
+ 
+ /* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+-#include "jinclude.h"
+-#include "jpeglib.h"
+-#include "jerror.h"
++#include <stdio.h>
++#include <string.h>
++#include <jpeglib.h>
++#include <jerror.h>
++#undef METHODDEF
++#define METHODDEF static
++#undef GLOBAL
++#define GLOBAL
++#define SIZEOF(object)   ((size_t) sizeof(object))
+ 
+ #ifndef MIN
+ #define MIN(a, b) ((a)<(b)?(a):(b))
+@@ -189,7 +195,7 @@
+  */
+ 
+ GLOBAL void
+-jpeg_mem_src (j_decompress_ptr cinfo, unsigned char *inbuf, size_t size)
++jpeg_mem_src (j_decompress_ptr cinfo, unsigned char *inbuf, unsigned long size)
+ {
+   my_src_ptr src;
+ 
+--- openarena-engine-0.8.1/code/renderer/tr_image_jpg.c.old    2010-03-10 09:30:30.000000000 +0100
++++ openarena-engine-0.8.1/code/renderer/tr_image_jpg.c        2010-03-10 10:17:42.000000000 +0100
+@@ -31,7 +31,7 @@
+  */
+ 
+ #define JPEG_INTERNALS
+-#include "../jpeg-6/jpeglib.h"
++#include <jpeglib.h>
+ 
+ void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) {
+   /* This struct contains the JPEG decompression parameters and pointers to
+@@ -128,7 +128,10 @@
+   }
+ 
+   memcount = pixelcount * 4;
+-  row_stride = cinfo.output_width * cinfo.output_components;
++  if (3 == cinfo.output_components)
++    row_stride = cinfo.output_width * 4;
++  else
++    row_stride = cinfo.output_width * cinfo.output_components;
+ 
+   out = ri.Malloc(memcount);
+ 
+@@ -141,14 +144,26 @@
+   /* Here we use the library's state variable cinfo.output_scanline as the
+    * loop counter, so that we don't have to keep track ourselves.
+    */
++  buf = out;
+   while (cinfo.output_scanline < cinfo.output_height) {
+     /* jpeg_read_scanlines expects an array of pointers to scanlines.
+      * Here the array is only one element long, but you could ask for
+      * more than one scanline at a time if that's more convenient.
+      */
+-      buf = ((out+(row_stride*cinfo.output_scanline)));
+       buffer = &buf;
+     (void) jpeg_read_scanlines(&cinfo, buffer, 1);
++    if (3 == cinfo.output_components) {
++      /* turn RGB into RGBA */
++      int ioffset = cinfo.output_width * 3 - 1;
++      int ooffset = cinfo.output_width * 4 - 1;
++      do {
++      buf[ooffset--] = 255;
++      buf[ooffset--] = buf[ioffset--];
++      buf[ooffset--] = buf[ioffset--];
++      buf[ooffset--] = buf[ioffset--];
++      } while (ioffset > 0);
++    }
++    buf += row_stride;
+   }
+   
+   buf = out;
+@@ -173,7 +188,7 @@
+               buf[--dindex] = greyshade;
+       } while(sindex);
+   }
+-  else
++  else if (4 == cinfo.output_components)
+   {
+       // clear all the alphas to 255
+       int     i;
diff --git a/games-fps/openarena/files/openarena-0.8.1-zlib.patch b/games-fps/openarena/files/openarena-0.8.1-zlib.patch
deleted file mode 100644 (file)
index ba163e8..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
---- openarena-engine-0.8.1/Makefile.old        2010-03-06 21:51:19.000000000 +0100
-+++ openarena-engine-0.8.1/Makefile    2010-03-06 21:58:01.000000000 +0100
-@@ -283,7 +283,7 @@
-   SHLIBLDFLAGS=-shared $(LDFLAGS)
- 
-   THREAD_LDFLAGS=-lpthread
--  LDFLAGS=-ldl -lm
-+  LDFLAGS=-ldl -lm -lz
- 
-   CLIENT_LDFLAGS=$(shell sdl-config --libs) -lGL
- 
-@@ -560,7 +560,7 @@
- 
-   THREAD_LDFLAGS=-lpthread
-   # don't need -ldl (FreeBSD)
--  LDFLAGS=-lm
-+  LDFLAGS=-lm -lz
- 
-   CLIENT_LDFLAGS =
- 
-@@ -616,7 +616,7 @@
-   SHLIBLDFLAGS=-shared $(LDFLAGS)
- 
-   THREAD_LDFLAGS=-lpthread
--  LDFLAGS=-lm
-+  LDFLAGS=-lm -lz
- 
-   CLIENT_LDFLAGS =
- 
-@@ -644,7 +644,7 @@
-     ARCH=i386
-   endif
- 
--  LDFLAGS=-lm
-+  LDFLAGS=-lm -lz
-   SHLIBEXT=so
-   SHLIBCFLAGS=-fPIC
-   SHLIBLDFLAGS=-shared $(LDFLAGS)
-@@ -683,7 +683,7 @@
-   SHLIBCFLAGS=
-   SHLIBLDFLAGS=-shared
- 
--  LDFLAGS=-ldl -lm -lgen
-+  LDFLAGS=-ldl -lm -lgen -lz
-   # FIXME: The X libraries probably aren't necessary?
-   CLIENT_LDFLAGS=-L/usr/X11/$(LIB) $(shell sdl-config --libs) -lGL \
-     -lX11 -lXext -lm
-@@ -750,7 +750,7 @@
-   SHLIBLDFLAGS=-shared $(LDFLAGS)
- 
-   THREAD_LDFLAGS=-lpthread
--  LDFLAGS=-lsocket -lnsl -ldl -lm
-+  LDFLAGS=-lsocket -lnsl -ldl -lm -lz
- 
-   BOTCFLAGS=-O0
- 
---- openarena-engine-0.8.1/code/qcommon/unzip.h.old    2010-03-06 21:59:46.000000000 +0100
-+++ openarena-engine-0.8.1/code/qcommon/unzip.h        2010-03-06 22:00:58.000000000 +0100
-@@ -19,6 +19,8 @@
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- ===========================================================================
- */
-+#include <zconf.h>
-+#include <zlib.h>
- 
- #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
- /* like the STRICT of WIN32, we define a pointer that cannot be converted
-@@ -80,6 +82,7 @@
- typedef void* (*alloc_func) (void* opaque, unsigned int items, unsigned int size);
- typedef void   (*free_func) (void* opaque, void* address);
- 
-+#if 0
- struct internal_state;
- 
- typedef struct z_stream_s {
-@@ -105,6 +108,7 @@
- 
- typedef z_stream *z_streamp;
- 
-+#endif
- 
- /* file_in_zip_read_info_s contain internal information about a file in zipfile,
-     when reading and decompress it */
---- openarena-engine-0.8.1/code/qcommon/unzip.c.old    2010-03-06 22:01:40.000000000 +0100
-+++ openarena-engine-0.8.1/code/qcommon/unzip.c        2010-03-06 22:03:35.000000000 +0100
-@@ -49,7 +49,7 @@
-       ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
-    PkWare has also a specification at :
-       ftp://ftp.pkware.com/probdesc.zip */
--
-+#if 0
- /* zlib.h -- interface of the 'zlib' general purpose compression library
-   version 1.1.3, July 9th, 1998
- 
-@@ -955,6 +955,7 @@
- // static const char   * zError           OF((int err));
- // static int            inflateSyncPoint OF((z_streamp z));
- // static const uLong * get_crc_table    OF((void));
-+#endif
- 
- typedef unsigned char  uch;
- typedef unsigned short ush;
-@@ -2248,6 +2249,8 @@
-       return (int)uReadThis;
- }
- 
-+#if 0
-+
- /* infblock.h -- header to use infblock.c
-  * Copyright (C) 1995-1998 Mark Adler
-  * For conditions of distribution and use, see copyright notice in zlib.h 
-@@ -4295,3 +4298,4 @@
- }
- 
- 
-+#endif
index bc5b7d7b18bc4cc95af692935795cc396cf0c677..abe6b26aa457c0a5fdb7a9e81588960e76880139 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/openarena/openarena-0.8.1-r1.ebuild,v 1.1 2010/03/06 22:04:30 tupone Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/openarena/openarena-0.8.1-r1.ebuild,v 1.2 2010/03/10 09:54:08 tupone Exp $
 
 EAPI=2
 inherit eutils flag-o-matic versionator games
@@ -20,6 +20,7 @@ IUSE="+curl +openal +vorbis"
 RDEPEND="virtual/opengl
        media-libs/libsdl[joystick,opengl,video]
        media-libs/speex
+       media-libs/jpeg
        x11-libs/libXext
        x11-libs/libX11
        x11-libs/libXau
@@ -37,7 +38,7 @@ DIR=${GAMES_DATADIR}/${PN}
 src_prepare() {
        cd "${WORKDIR}"
        epatch "${FILESDIR}"/${P}-makefile.patch \
-               "${FILESDIR}"/${P}-zlib.patch
+               "${FILESDIR}"/${P}-unbundling.patch
        append-cflags -fno-strict-aliasing # bug #268851
        sed -i \
                -e "s:%CFLAGS%:${CFLAGS}:g" \