Gentoo Archives: gentoo-commits

From: "Tristan Heaven (nyhm)" <nyhm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in games-fps/nexuiz/files: nexuiz-2.5.1-jpeg.patch
Date: Mon, 24 Aug 2009 12:25:55
Message-Id: E1MfYcT-0000q3-5W@stork.gentoo.org
1 nyhm 09/08/24 12:25:53
2
3 Added: nexuiz-2.5.1-jpeg.patch
4 Log:
5 Patch from Gef Lebster to fix incompatibility with jpeg-7, bug #282406
6 (Portage version: 2.2_rc39/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 games-fps/nexuiz/files/nexuiz-2.5.1-jpeg.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-fps/nexuiz/files/nexuiz-2.5.1-jpeg.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-fps/nexuiz/files/nexuiz-2.5.1-jpeg.patch?rev=1.1&content-type=text/plain
13
14 Index: nexuiz-2.5.1-jpeg.patch
15 ===================================================================
16 --- darkplaces/makefile 2008/07/19 12:03:15 8416
17 +++ darkplaces/makefile 2009/07/20 15:30:38 9064
18 @@ -251,6 +251,14 @@
19 endif
20 endif
21
22 +ifdef DP_LINK_TO_LIBJPEG
23 + LDFLAGS_LIBJPEG?=-ljpeg
24 + LDFLAGS_CL+=$(LDFLAGS_LIBJPEG)
25 + LDFLAGS_SV+=$(LDFLAGS_LIBJPEG)
26 + LDFLAGS_SDL+=$(LDFLAGS_LIBJPEG)
27 + CFLAGS_PRELOAD+=$(CFLAGS_LIBJPEG) -DLINK_TO_LIBJPEG
28 +endif
29 +
30 ##### GNU Make specific definitions #####
31
32 DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
33
34 --- darkplaces/jpeg.c 2009/04/10 14:37:23 8892
35 +++ darkplaces/jpeg.c 2009/07/20 15:30:38 9064
36 @@ -28,6 +28,32 @@
37
38 cvar_t sv_writepicture_quality = {CVAR_SAVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"};
39
40 +// jboolean is unsigned char instead of int on Win32
41 +#ifdef WIN32
42 +typedef unsigned char jboolean;
43 +#else
44 +typedef int jboolean;
45 +#endif
46 +
47 +#ifdef LINK_TO_LIBJPEG
48 +#include <jpeglib.h>
49 +#define qjpeg_create_compress jpeg_create_compress
50 +#define qjpeg_create_decompress jpeg_create_decompress
51 +#define qjpeg_destroy_compress jpeg_destroy_compress
52 +#define qjpeg_destroy_decompress jpeg_destroy_decompress
53 +#define qjpeg_finish_compress jpeg_finish_compress
54 +#define qjpeg_finish_decompress jpeg_finish_decompress
55 +#define qjpeg_resync_to_restart jpeg_resync_to_restart
56 +#define qjpeg_read_header jpeg_read_header
57 +#define qjpeg_read_scanlines jpeg_read_scanlines
58 +#define qjpeg_set_defaults jpeg_set_defaults
59 +#define qjpeg_set_quality jpeg_set_quality
60 +#define qjpeg_start_compress jpeg_start_compress
61 +#define qjpeg_start_decompress jpeg_start_decompress
62 +#define qjpeg_std_error jpeg_std_error
63 +#define qjpeg_write_scanlines jpeg_write_scanlines
64 +#define jpeg_dll true
65 +#else
66 /*
67 =================================================================
68
69 @@ -39,18 +65,12 @@
70 =================================================================
71 */
72
73 -// jboolean is unsigned char instead of int on Win32
74 -#ifdef WIN32
75 -typedef unsigned char jboolean;
76 -#else
77 -typedef int jboolean;
78 -#endif
79 -
80 -#define JPEG_LIB_VERSION 62 // Version 6b
81 -
82 typedef void *j_common_ptr;
83 typedef struct jpeg_compress_struct *j_compress_ptr;
84 typedef struct jpeg_decompress_struct *j_decompress_ptr;
85 +
86 +#define JPEG_LIB_VERSION 62 // Version 6b
87 +
88 typedef enum
89 {
90 JCS_UNKNOWN,
91 @@ -430,6 +450,7 @@
92 // Handle for JPEG DLL
93 dllhandle_t jpeg_dll = NULL;
94 qboolean jpeg_tried_loading = 0;
95 +#endif
96
97 static unsigned char jpeg_eoi_marker [2] = {0xFF, JPEG_EOI};
98 static jmp_buf error_in_jpeg;
99 @@ -464,6 +485,9 @@
100 */
101 qboolean JPEG_OpenLibrary (void)
102 {
103 +#ifdef LINK_TO_LIBJPEG
104 + return true;
105 +#else
106 const char* dllnames [] =
107 {
108 #if defined(WIN64)
109 @@ -490,6 +514,7 @@
110
111 // Load the DLL
112 return Sys_LoadLibrary (dllnames, &jpeg_dll, jpegfuncs);
113 +#endif
114 }
115
116
117 @@ -502,8 +527,10 @@
118 */
119 void JPEG_CloseLibrary (void)
120 {
121 +#ifndef LINK_TO_LIBJPEG
122 Sys_UnloadLibrary (&jpeg_dll);
123 jpeg_tried_loading = false; // allow retry
124 +#endif
125 }