Gentoo Archives: gentoo-commits

From: Markus Meier <maekke@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/maekke:master commit in: media-libs/libjpeg-turbo/, media-libs/libjpeg-turbo/files/
Date: Mon, 02 Feb 2015 05:23:51
Message-Id: 1422201271.3ba53f4c1efe32adeb1591d1a83a48ec4a818470.maekke@gentoo
1 commit: 3ba53f4c1efe32adeb1591d1a83a48ec4a818470
2 Author: Markus Meier <maekke <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 25 15:54:31 2015 +0000
4 Commit: Markus Meier <maekke <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 25 15:54:31 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=dev/maekke.git;a=commit;h=3ba53f4c
7
8 add media-libs/libjpeg-turbo from gentoo-x86
9
10 Package-Manager: portage-2.2.15
11 RepoMan-Options: --force
12 Manifest-Sign-Key: 072AD062
13
14 ---
15 media-libs/libjpeg-turbo/Manifest | 22 ++
16 .../files/libjpeg-turbo-1.2.0-x32.patch | 38 +++
17 ...ibjpeg-turbo-1.3.0-CVE-2013-6629-and-6630.patch | 38 +++
18 .../files/libjpeg-turbo-1.3.1-jstdhuff.patch | 301 +++++++++++++++++++++
19 .../files/libjpeg-turbo-1.3.1-overrun.patch | 21 ++
20 .../libjpeg-turbo/libjpeg-turbo-1.3.0-r3.ebuild | 122 +++++++++
21 .../libjpeg-turbo/libjpeg-turbo-1.3.1-r1.ebuild | 118 ++++++++
22 .../libjpeg-turbo/libjpeg-turbo-1.3.1.ebuild | 121 +++++++++
23 media-libs/libjpeg-turbo/metadata.xml | 13 +
24 9 files changed, 794 insertions(+)
25
26 diff --git a/media-libs/libjpeg-turbo/Manifest b/media-libs/libjpeg-turbo/Manifest
27 new file mode 100644
28 index 0000000..9d17f8b
29 --- /dev/null
30 +++ b/media-libs/libjpeg-turbo/Manifest
31 @@ -0,0 +1,22 @@
32 +-----BEGIN PGP SIGNED MESSAGE-----
33 +Hash: SHA256
34 +
35 +AUX libjpeg-turbo-1.2.0-x32.patch 1240 SHA256 b12ab8fbef2cd8ceafd2e26e8fca375894275b7a60216fabf23f4f1342e73347 SHA512 0aa26467b7c0f583d945619f9b1ad9f200d6ae6cb5c904873a047d955de43c0bfefbf0d9f83cf26b3758f780b530cc35825b57a98856138642dcd29d73e24e91 WHIRLPOOL 67c84aec436f41f318149b264e5a198ad8b4d4bd19483f404dce60a59b237715a38fd5e6108d0c745ab90b6ca3688d2d75d7d23aecff06a649db34bff4d1be2d
36 +AUX libjpeg-turbo-1.3.0-CVE-2013-6629-and-6630.patch 1017 SHA256 7fe595af3a0518376e0a209c4732a8e2832c0caa4a937741300b3440575f66ab SHA512 ca01e4680267cfc79b8517c1ac55f15ef52b82299dad70b31eb18393be800fb524a12fe04048a63ad0f9881eaa7cefc879ad7f6bce04bb213ed0c4bfa6dd7040 WHIRLPOOL 3d7b95a7d0ed5cb263642e5e4cedfdaf0b74a516eae29b745e37763bd47b01ed2aac16d2ef6f9cd4d12fdb4691aea2afd3adb303024413ee2eec26df6ec5a3ed
37 +AUX libjpeg-turbo-1.3.1-jstdhuff.patch 11750 SHA256 a787c3768e11ca3287c36f87860cd2930ca1ea01e61dfbcff94d9ce1e6a5ea7a SHA512 3ace7a2e1ebd969135b665095a96b0fe1154869416fb4740d5a0588814a50e6c69e15ee3960fa7fe57c805cb4e2aa5cebadb347edf5583881d4cf20a17b9db5a WHIRLPOOL e92004dcea1fee19b9f10be40f117b9a3a0cc85bec92e30b9ebcc28312486ad6e66fcc2dc23deea6719aa93ecb1172cdcf986ae25e902c4a22d2e5974974b66b
38 +AUX libjpeg-turbo-1.3.1-overrun.patch 876 SHA256 7521a75d9cd9b054b2a9e69098e5a1a903fdee56a43964275c4c5f5598246d85 SHA512 727c981988d13740fb14617e189e4d7bec423f06a186f4d41f47d48e4cb6679edae62e9bcf79ba1a169e9bbf374f69f82cf4415ed00abbb5d8cf19489dd32113 WHIRLPOOL efaba4a00fee68b9e059cd1e6d8f8efb8b3a03da7c74a597403ce472e4e0f7f4653fb61610d03cc3011e3f4112778096ad87ef5f019e35410a6b438a98c615ae
39 +DIST libjpeg-turbo-1.3.0.tar.gz 1361603 SHA256 2657008cfc08aadbaca065bd9f8964b8a2c0abd03e73da5b5f09c1216be31234 SHA512 4d34c3c5f2cdd70b2a3d1b55eeb4ce59cb3d4b8d22bb6d43c2ec844b7eb5685b55a9b1b46ad2bc5f2756b5f5535ccad032791c3b932af9c1efc502aa5e701053 WHIRLPOOL 13c1366b9bef87cab42c88f75d1ff7eddb4ea745e0056154f1f3fb27deedee077d662395bada3bd5c18d6f8bf744d0b1f3d465967d33b453ea2acc327a6f166f
40 +DIST libjpeg-turbo-1.3.1.tar.gz 1390282 SHA256 c132907417ddc40ed552fe53d6b91d5fecbb14a356a60ddc7ea50d6be9666fb9 SHA512 6b02dc617e291b357230ef3e8cfcd27f9acc8c3e9f1c869ab0a08e9e13711b87156c6cd1aaa1a6406a873fc6732f44c8a7d94a5d6688d24b14ac63a96ee52081 WHIRLPOOL f978b24d0a4e63a421822c2114c0cfc87cbc1dedd648ddc2e97e24ee19dc5584433b1da7d41a64f0ae37b50799a273165aaec6f1377ed35a7971dbe8a0b6a8d5
41 +DIST libjpeg8_8d-1.debian.tar.gz 13676 SHA256 70ec6689b0ad85739802cf3ebbdcc12ea01e21edd8f931c614b25b44cf199057 SHA512 7def4f13524f0af3b9adf35a370027a18f43b9a635f56a17d5bb7883370db8b18b8a12737d0f0cb4b0287ccf8fb474eb5f754de6b398ffe7d522c54e5bf68040 WHIRLPOOL 94526c31d401eb14c9bf0f7115e13a27886ad58863e25d6653eba2b2f5ef260ec272368d2b9d9934bd75b1e5b5f1afc97230e540248efc24d6e85e5680399d27
42 +DIST libjpeg8_8d-2.debian.tar.gz 14764 SHA256 9b36468b2aba24d63d3c87625de89f31834ac429e6dec7d68d86a52b5110219c SHA512 8c5959fb7583a2d61e9442187f67b91b45e72d9dd30db3360d583a3b5d8e1a908db5659f760bdd455b3056e6ae3535b2fd3b847df3d58b140a1816b754003675 WHIRLPOOL bda41c37f3f57733fcd86969126f6dbede2fbf633b0168265a7fe353fb7f3cd995a94e7987bac472957ec6fb0b2dc34d5dd646f0de79e06bc94e59d7cf440939
43 +EBUILD libjpeg-turbo-1.3.0-r3.ebuild 3166 SHA256 d2658a5ed6c87f1ca4ff939198f3b36f129a6be28c855db91b7930a0b82c20e9 SHA512 9e89708eddbdf5c70d70395c3ddab8aee776ea28fc6f18f98e2755ac12dd85467f872b3b5a89fa462f4990a8f718d864d628ae00b3577e614cc8fedcfad78f2c WHIRLPOOL 0fb19a29ec010cd3c6a9eeb5200e3495268ed4a0fa9124b352a1fb05ec2bda4699155944d7af0b100fab53d8b5a5db231311b89825d0c9f21bae5e2111908ed6
44 +EBUILD libjpeg-turbo-1.3.1-r1.ebuild 3218 SHA256 84e7b7a04d282c8443e2f205fd857b645f66f66e030f4cb9f44f64930dff09b6 SHA512 df89aea579886015860fbf12bb9741a78eb8ce870d0f0732c8daceeaaa771546caca31ea672cedb5ce94ec7652dc14bd57ececcb2f4259a97aa7d7d10f7d9407 WHIRLPOOL c97b98773c3b9898622ab294b2050e347d9a5da90bd6a939bb9245bd795be44eeb280f20c32fa14afd2e1ce05d5101e25993787b0489f2ca4fcd02c7b64c90ac
45 +EBUILD libjpeg-turbo-1.3.1.ebuild 3113 SHA256 e9a62cdd14d42c531d22f81ce08cce3df527d65d08455a2f2572a0599031ae1c SHA512 5848aecc33e897b5ccfecbf171a3f9ec2343c38747dc2b86432ccb5df4a2bd9717d443c56b312b620ede94638458a94ba563be5decfa84904f1144a642156bcd WHIRLPOOL 32199f6f760e8504c6e3e5b115a40e6432ac6c3b4b9f9df5eb2b876b41c1fa04196de7e98657fc211a0c15981053cdbb55f55ad714ddbac2b3a5834e18141c27
46 +MISC metadata.xml 367 SHA256 6b8c81649360de8af20a434749d90a9ee689026f959c814e22dac83513c5b0d4 SHA512 0dc1a5f70e560471119207724bc0015d1ae6b80c7da5d2305479b681ae9dca487dc0a58b5db45cc033d3c12ec997902b1c42c664efbfdff8cf3e1570259d0835 WHIRLPOOL 5686f917bfedc7f73923a18e99e8fa64eadda2cbe476d8b6c527be83f283acad01e0fedb5d4c9deb1dbf4f21538b69b3446db3304af782fb76e4b009c6bd3822
47 +-----BEGIN PGP SIGNATURE-----
48 +Version: GnuPG v2
49 +
50 +iEYEAREIAAYFAlTFEbcACgkQkKaRLQcq0GKafwCeO0VccRn7ToG93yscODYM6Bc1
51 +3TQAnj9swORJysrO1Od55t2DQF5RWgsc
52 +=y9wC
53 +-----END PGP SIGNATURE-----
54
55 diff --git a/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.2.0-x32.patch b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.2.0-x32.patch
56 new file mode 100644
57 index 0000000..d85a4d7
58 --- /dev/null
59 +++ b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.2.0-x32.patch
60 @@ -0,0 +1,38 @@
61 +https://bugs.gentoo.org/420239
62 +
63 +https://sourceforge.net/tracker/?func=detail&aid=3533795&group_id=303195&atid=1278160
64 +
65 +--- configure
66 ++++ configure
67 +@@ -33,7 +33,11 @@ case "$host_os" in
68 + linux*)
69 + case "$host_cpu" in
70 + x86_64)
71 +- objfmt='ELF64'
72 ++ if echo __ILP32__ | $CC $CFLAGS -E - | grep __ILP32__ > /dev/null; then
73 ++ objfmt='ELF64'
74 ++ else
75 ++ objfmt='ELFX32'
76 ++ fi
77 + ;;
78 + *)
79 + objfmt='ELF'
80 +@@ -94,6 +98,7 @@ case "$objfmt" in
81 + a.out) NAFLAGS='-faout -DAOUT';;
82 + BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
83 + ELF) NAFLAGS='-felf -DELF';;
84 ++ ELFX32) NAFLAGS='-felfx32 -DELF -D__x86_64__';;
85 + ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
86 + RDF) NAFLAGS='-frdf -DRDF';;
87 + Mach-O) NAFLAGS='-fmacho -DMACHO';;
88 +--- simd/nasm_lt.sh
89 ++++ simd/nasm_lt.sh
90 +@@ -11,7 +11,7 @@ while [ $# -gt 0 ]; do
91 + pic=yes
92 + fi
93 + ;;
94 +- -f|-fbin|-faout|-faoutb|-fcoff|-felf|-felf64|-fas86| \
95 ++ -f|-fbin|-faout|-faoutb|-fcoff|-felf|-felf64|-felfx32|-fas86| \
96 + -fobj|-fwin32|-fwin64|-frdf|-fieee|-fmacho|-fmacho64)
97 + # it's a file format specifier for nasm.
98 + command="$command $1"
99
100 diff --git a/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.0-CVE-2013-6629-and-6630.patch b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.0-CVE-2013-6629-and-6630.patch
101 new file mode 100644
102 index 0000000..46eefad
103 --- /dev/null
104 +++ b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.0-CVE-2013-6629-and-6630.patch
105 @@ -0,0 +1,38 @@
106 +http://bugzilla.redhat.com/show_bug.cgi?id=1031734
107 +http://bugzilla.redhat.com/show_bug.cgi?id=1031749
108 +http://sourceforge.net/p/libjpeg-turbo/code/1090/
109 +
110 +--- jdmarker.c
111 ++++ jdmarker.c
112 +@@ -304,7 +304,7 @@
113 + /* Process a SOS marker */
114 + {
115 + INT32 length;
116 +- int i, ci, n, c, cc;
117 ++ int i, ci, n, c, cc, pi;
118 + jpeg_component_info * compptr;
119 + INPUT_VARS(cinfo);
120 +
121 +@@ -348,6 +348,13 @@
122 +
123 + TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
124 + compptr->dc_tbl_no, compptr->ac_tbl_no);
125 ++
126 ++ /* This CSi (cc) should differ from the previous CSi */
127 ++ for (pi = 0; pi < i; pi++) {
128 ++ if (cinfo->cur_comp_info[pi] == compptr) {
129 ++ ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
130 ++ }
131 ++ }
132 + }
133 +
134 + /* Collect the additional scan parameters Ss, Se, Ah/Al. */
135 +@@ -465,6 +472,8 @@
136 + for (i = 0; i < count; i++)
137 + INPUT_BYTE(cinfo, huffval[i], return FALSE);
138 +
139 ++ MEMZERO(&huffval[count], (256 - count) * SIZEOF(UINT8));
140 ++
141 + length -= count;
142 +
143 + if (index & 0x10) { /* AC table definition */
144
145 diff --git a/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.1-jstdhuff.patch b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.1-jstdhuff.patch
146 new file mode 100644
147 index 0000000..764147d
148 --- /dev/null
149 +++ b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.1-jstdhuff.patch
150 @@ -0,0 +1,301 @@
151 +Index: jcparam.c
152 +===================================================================
153 +--- jcparam.c (revision 1103)
154 ++++ jcparam.c (revision 1104)
155 +@@ -16,6 +16,7 @@
156 + #define JPEG_INTERNALS
157 + #include "jinclude.h"
158 + #include "jpeglib.h"
159 ++#include "jstdhuff.c"
160 +
161 +
162 + /*
163 +@@ -166,116 +167,6 @@
164 +
165 +
166 + /*
167 +- * Huffman table setup routines
168 +- */
169 +-
170 +-LOCAL(void)
171 +-add_huff_table (j_compress_ptr cinfo,
172 +- JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
173 +-/* Define a Huffman table */
174 +-{
175 +- int nsymbols, len;
176 +-
177 +- if (*htblptr == NULL)
178 +- *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
179 +-
180 +- /* Copy the number-of-symbols-of-each-code-length counts */
181 +- MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
182 +-
183 +- /* Validate the counts. We do this here mainly so we can copy the right
184 +- * number of symbols from the val[] array, without risking marching off
185 +- * the end of memory. jchuff.c will do a more thorough test later.
186 +- */
187 +- nsymbols = 0;
188 +- for (len = 1; len <= 16; len++)
189 +- nsymbols += bits[len];
190 +- if (nsymbols < 1 || nsymbols > 256)
191 +- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
192 +-
193 +- MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
194 +-
195 +- /* Initialize sent_table FALSE so table will be written to JPEG file. */
196 +- (*htblptr)->sent_table = FALSE;
197 +-}
198 +-
199 +-
200 +-LOCAL(void)
201 +-std_huff_tables (j_compress_ptr cinfo)
202 +-/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
203 +-/* IMPORTANT: these are only valid for 8-bit data precision! */
204 +-{
205 +- static const UINT8 bits_dc_luminance[17] =
206 +- { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
207 +- static const UINT8 val_dc_luminance[] =
208 +- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
209 +-
210 +- static const UINT8 bits_dc_chrominance[17] =
211 +- { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
212 +- static const UINT8 val_dc_chrominance[] =
213 +- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
214 +-
215 +- static const UINT8 bits_ac_luminance[17] =
216 +- { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
217 +- static const UINT8 val_ac_luminance[] =
218 +- { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
219 +- 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
220 +- 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
221 +- 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
222 +- 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
223 +- 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
224 +- 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
225 +- 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
226 +- 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
227 +- 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
228 +- 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
229 +- 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
230 +- 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
231 +- 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
232 +- 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
233 +- 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
234 +- 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
235 +- 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
236 +- 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
237 +- 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
238 +- 0xf9, 0xfa };
239 +-
240 +- static const UINT8 bits_ac_chrominance[17] =
241 +- { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
242 +- static const UINT8 val_ac_chrominance[] =
243 +- { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
244 +- 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
245 +- 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
246 +- 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
247 +- 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
248 +- 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
249 +- 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
250 +- 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
251 +- 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
252 +- 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
253 +- 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
254 +- 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
255 +- 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
256 +- 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
257 +- 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
258 +- 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
259 +- 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
260 +- 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
261 +- 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
262 +- 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
263 +- 0xf9, 0xfa };
264 +-
265 +- add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
266 +- bits_dc_luminance, val_dc_luminance);
267 +- add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
268 +- bits_ac_luminance, val_ac_luminance);
269 +- add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
270 +- bits_dc_chrominance, val_dc_chrominance);
271 +- add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
272 +- bits_ac_chrominance, val_ac_chrominance);
273 +-}
274 +-
275 +-
276 +-/*
277 + * Default parameter setup for compression.
278 + *
279 + * Applications that don't choose to use this routine must do their
280 +@@ -313,7 +204,7 @@
281 + /* Set up two quantization tables using default quality of 75 */
282 + jpeg_set_quality(cinfo, 75, TRUE);
283 + /* Set up two Huffman tables */
284 +- std_huff_tables(cinfo);
285 ++ std_huff_tables((j_common_ptr) cinfo);
286 +
287 + /* Initialize default arithmetic coding conditioning */
288 + for (i = 0; i < NUM_ARITH_TBLS; i++) {
289 +Index: jstdhuff.c
290 +===================================================================
291 +--- jstdhuff.c (revision 0)
292 ++++ jstdhuff.c (revision 1104)
293 +@@ -0,0 +1,133 @@
294 ++/*
295 ++* jstdhuff.c
296 ++*
297 ++* This file was part of the Independent JPEG Group's software:
298 ++* Copyright (C) 1991-1998, Thomas G. Lane.
299 ++* libjpeg-turbo Modifications:
300 ++* Copyright (C) 2013, D. R. Commander.
301 ++* For conditions of distribution and use, see the accompanying README file.
302 ++*
303 ++* This file contains routines to set the default Huffman tables, if they are
304 ++* not already set.
305 ++*/
306 ++
307 ++/*
308 ++ * Huffman table setup routines
309 ++ */
310 ++
311 ++LOCAL(void)
312 ++add_huff_table (j_common_ptr cinfo,
313 ++ JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
314 ++/* Define a Huffman table */
315 ++{
316 ++ int nsymbols, len;
317 ++
318 ++ if (*htblptr == NULL)
319 ++ *htblptr = jpeg_alloc_huff_table(cinfo);
320 ++ else
321 ++ return;
322 ++
323 ++ /* Copy the number-of-symbols-of-each-code-length counts */
324 ++ MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
325 ++
326 ++ /* Validate the counts. We do this here mainly so we can copy the right
327 ++ * number of symbols from the val[] array, without risking marching off
328 ++ * the end of memory. jchuff.c will do a more thorough test later.
329 ++ */
330 ++ nsymbols = 0;
331 ++ for (len = 1; len <= 16; len++)
332 ++ nsymbols += bits[len];
333 ++ if (nsymbols < 1 || nsymbols > 256)
334 ++ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
335 ++
336 ++ MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
337 ++
338 ++ /* Initialize sent_table FALSE so table will be written to JPEG file. */
339 ++ (*htblptr)->sent_table = FALSE;
340 ++}
341 ++
342 ++
343 ++LOCAL(void)
344 ++std_huff_tables (j_common_ptr cinfo)
345 ++/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
346 ++/* IMPORTANT: these are only valid for 8-bit data precision! */
347 ++{
348 ++ JHUFF_TBL **dc_huff_tbl_ptrs, **ac_huff_tbl_ptrs;
349 ++
350 ++ static const UINT8 bits_dc_luminance[17] =
351 ++ { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
352 ++ static const UINT8 val_dc_luminance[] =
353 ++ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
354 ++
355 ++ static const UINT8 bits_dc_chrominance[17] =
356 ++ { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
357 ++ static const UINT8 val_dc_chrominance[] =
358 ++ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
359 ++
360 ++ static const UINT8 bits_ac_luminance[17] =
361 ++ { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
362 ++ static const UINT8 val_ac_luminance[] =
363 ++ { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
364 ++ 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
365 ++ 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
366 ++ 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
367 ++ 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
368 ++ 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
369 ++ 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
370 ++ 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
371 ++ 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
372 ++ 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
373 ++ 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
374 ++ 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
375 ++ 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
376 ++ 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
377 ++ 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
378 ++ 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
379 ++ 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
380 ++ 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
381 ++ 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
382 ++ 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
383 ++ 0xf9, 0xfa };
384 ++
385 ++ static const UINT8 bits_ac_chrominance[17] =
386 ++ { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
387 ++ static const UINT8 val_ac_chrominance[] =
388 ++ { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
389 ++ 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
390 ++ 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
391 ++ 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
392 ++ 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
393 ++ 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
394 ++ 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
395 ++ 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
396 ++ 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
397 ++ 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
398 ++ 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
399 ++ 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
400 ++ 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
401 ++ 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
402 ++ 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
403 ++ 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
404 ++ 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
405 ++ 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
406 ++ 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
407 ++ 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
408 ++ 0xf9, 0xfa };
409 ++
410 ++ if (cinfo->is_decompressor) {
411 ++ dc_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->dc_huff_tbl_ptrs;
412 ++ ac_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->ac_huff_tbl_ptrs;
413 ++ } else {
414 ++ dc_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->dc_huff_tbl_ptrs;
415 ++ ac_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->ac_huff_tbl_ptrs;
416 ++ }
417 ++
418 ++ add_huff_table(cinfo, &dc_huff_tbl_ptrs[0], bits_dc_luminance,
419 ++ val_dc_luminance);
420 ++ add_huff_table(cinfo, &ac_huff_tbl_ptrs[0], bits_ac_luminance,
421 ++ val_ac_luminance);
422 ++ add_huff_table(cinfo, &dc_huff_tbl_ptrs[1], bits_dc_chrominance,
423 ++ val_dc_chrominance);
424 ++ add_huff_table(cinfo, &ac_huff_tbl_ptrs[1], bits_ac_chrominance,
425 ++ val_ac_chrominance);
426 ++}
427 +Index: jdhuff.c
428 +===================================================================
429 +--- jdhuff.c (revision 1103)
430 ++++ jdhuff.c (revision 1104)
431 +@@ -21,6 +21,7 @@
432 + #include "jpeglib.h"
433 + #include "jdhuff.h" /* Declarations shared with jdphuff.c */
434 + #include "jpegcomp.h"
435 ++#include "jstdhuff.c"
436 +
437 +
438 + /*
439 +@@ -795,6 +796,12 @@
440 + huff_entropy_ptr entropy;
441 + int i;
442 +
443 ++ /* Motion JPEG frames typically do not include the Huffman tables if they
444 ++ are the default tables. Thus, if the tables are not set by the time
445 ++ the Huffman decoder is initialized (usually within the body of
446 ++ jpeg_start_decompress()), we set them to default values. */
447 ++ std_huff_tables((j_common_ptr) cinfo);
448 ++
449 + entropy = (huff_entropy_ptr)
450 + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
451 + SIZEOF(huff_entropy_decoder));
452
453 diff --git a/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.1-overrun.patch b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.1-overrun.patch
454 new file mode 100644
455 index 0000000..92f48c3
456 --- /dev/null
457 +++ b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.3.1-overrun.patch
458 @@ -0,0 +1,21 @@
459 +diff -Naur old/jchuff.c new/jchuff.c
460 +--- old/jchuff.c 2014-11-27 06:48:21.009442853 -1000
461 ++++ new/jchuff.c 2014-11-27 06:48:46.289700004 -1000
462 +@@ -391,7 +391,16 @@
463 + #endif
464 +
465 +
466 +-#define BUFSIZE (DCTSIZE2 * 2)
467 ++/* Although it is exceedingly rare, it is possible for a Huffman-encoded
468 ++ * coefficient block to be larger than the 128-byte unencoded block. For each
469 ++ * of the 64 coefficients, PUT_BITS is invoked twice, and each invocation can
470 ++ * theoretically store 16 bits (for a maximum of 2048 bits or 256 bytes per
471 ++ * encoded block.) If, for instance, one artificially sets the AC
472 ++ * coefficients to alternating values of 32767 and -32768 (using the JPEG
473 ++ * scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
474 ++ * larger than 200 bytes.
475 ++ */
476 ++#define BUFSIZE (DCTSIZE2 * 4)
477 +
478 + #define LOAD_BUFFER() { \
479 + if (state->free_in_buffer < BUFSIZE) { \
480
481 diff --git a/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.0-r3.ebuild b/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.0-r3.ebuild
482 new file mode 100644
483 index 0000000..f6886b7
484 --- /dev/null
485 +++ b/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.0-r3.ebuild
486 @@ -0,0 +1,122 @@
487 +# Copyright 1999-2014 Gentoo Foundation
488 +# Distributed under the terms of the GNU General Public License v2
489 +# $Header: /var/cvsroot/gentoo-x86/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.0-r3.ebuild,v 1.11 2014/06/09 23:31:28 vapier Exp $
490 +
491 +EAPI=5
492 +
493 +inherit autotools eutils java-pkg-opt-2 libtool toolchain-funcs multilib-minimal
494 +
495 +DESCRIPTION="MMX, SSE, and SSE2 SIMD accelerated JPEG library"
496 +HOMEPAGE="http://libjpeg-turbo.virtualgl.org/ http://sourceforge.net/projects/libjpeg-turbo/"
497 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
498 + mirror://debian/pool/main/libj/libjpeg8/libjpeg8_8d-1.debian.tar.gz"
499 +
500 +LICENSE="BSD IJG"
501 +SLOT="0"
502 +KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
503 +IUSE="java static-libs"
504 +
505 +ASM_DEPEND="|| ( dev-lang/nasm dev-lang/yasm )"
506 +COMMON_DEPEND="!media-libs/jpeg:0
507 + !media-libs/jpeg:62
508 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
509 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
510 +RDEPEND="${COMMON_DEPEND}
511 + java? ( >=virtual/jre-1.5 )"
512 +DEPEND="${COMMON_DEPEND}
513 + amd64? ( ${ASM_DEPEND} )
514 + x86? ( ${ASM_DEPEND} )
515 + amd64-fbsd? ( ${ASM_DEPEND} )
516 + x86-fbsd? ( ${ASM_DEPEND} )
517 + amd64-linux? ( ${ASM_DEPEND} )
518 + x86-linux? ( ${ASM_DEPEND} )
519 + x64-macos? ( ${ASM_DEPEND} )
520 + java? ( >=virtual/jdk-1.5 )"
521 +
522 +MULTILIB_WRAPPED_HEADERS=( /usr/include/jconfig.h )
523 +
524 +src_prepare() {
525 + epatch "${FILESDIR}"/${PN}-1.2.0-x32.patch #420239
526 + epatch "${FILESDIR}"/${P}-CVE-2013-6629-and-6630.patch
527 +
528 + if [[ -x ./configure ]]; then
529 + elibtoolize
530 + else
531 + eautoreconf
532 + fi
533 +
534 + epunt_cxx #424689
535 +
536 + java-pkg-opt-2_src_prepare
537 +}
538 +
539 +multilib_src_configure() {
540 + local myconf=()
541 + if multilib_is_native_abi; then
542 + myconf+=( $(use_with java) )
543 + if use java; then
544 + export JAVACFLAGS="$(java-pkg_javac-args)"
545 + export JNI_CFLAGS="$(java-pkg_get-jni-cflags)"
546 + fi
547 + else
548 + myconf+=( --without-java )
549 + fi
550 + [[ ${ABI} == "x32" ]] && myconf+=( --without-simd ) #420239
551 +
552 + ECONF_SOURCE=${S} \
553 + econf \
554 + $(use_enable static-libs static) \
555 + --with-mem-srcdst \
556 + "${myconf[@]}"
557 +}
558 +
559 +multilib_src_compile() {
560 + local _java_makeopts
561 + use java && _java_makeopts="-j1"
562 + emake ${_java_makeopts}
563 +
564 + if multilib_is_native_abi; then
565 + pushd ../debian/extra >/dev/null
566 + emake CC="$(tc-getCC)" CFLAGS="${LDFLAGS} ${CFLAGS}"
567 + popd >/dev/null
568 + fi
569 +}
570 +
571 +multilib_src_test() {
572 + emake test
573 +}
574 +
575 +multilib_src_install() {
576 + emake \
577 + DESTDIR="${D}" \
578 + docdir="${EPREFIX}"/usr/share/doc/${PF} \
579 + exampledir="${EPREFIX}"/usr/share/doc/${PF} \
580 + install
581 +
582 + if multilib_is_native_abi; then
583 + pushd "${WORKDIR}"/debian/extra >/dev/null
584 + emake \
585 + DESTDIR="${D}" prefix="${EPREFIX}"/usr \
586 + INSTALL="install -m755" INSTALLDIR="install -d -m755" \
587 + install
588 + popd >/dev/null
589 +
590 + if use java; then
591 + rm -rf "${ED}"/usr/classes
592 + java-pkg_dojar java/turbojpeg.jar
593 + fi
594 + fi
595 +}
596 +
597 +multilib_src_install_all() {
598 + prune_libtool_files
599 +
600 + insinto /usr/share/doc/${PF}/html
601 + doins -r "${S}"/doc/html/*
602 + newdoc "${WORKDIR}"/debian/changelog changelog.debian
603 + if use java; then
604 + insinto /usr/share/doc/${PF}/html/java
605 + doins -r "${S}"/java/doc/*
606 + newdoc "${S}"/java/README README.java
607 + fi
608 +}
609
610 diff --git a/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1-r1.ebuild b/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1-r1.ebuild
611 new file mode 100644
612 index 0000000..9061853
613 --- /dev/null
614 +++ b/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1-r1.ebuild
615 @@ -0,0 +1,118 @@
616 +# Copyright 1999-2015 Gentoo Foundation
617 +# Distributed under the terms of the GNU General Public License v2
618 +# $Header: /var/cvsroot/gentoo-x86/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1-r1.ebuild,v 1.2 2015/01/08 00:15:53 remi Exp $
619 +
620 +EAPI=5
621 +
622 +inherit autotools eutils java-pkg-opt-2 libtool toolchain-funcs multilib-minimal
623 +
624 +DESCRIPTION="MMX, SSE, and SSE2 SIMD accelerated JPEG library"
625 +HOMEPAGE="http://libjpeg-turbo.virtualgl.org/ http://sourceforge.net/projects/libjpeg-turbo/"
626 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
627 + mirror://debian/pool/main/libj/libjpeg8/libjpeg8_8d-2.debian.tar.gz"
628 +
629 +LICENSE="BSD IJG"
630 +SLOT="0"
631 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
632 +IUSE="java static-libs"
633 +
634 +ASM_DEPEND="|| ( dev-lang/nasm dev-lang/yasm )"
635 +COMMON_DEPEND="!media-libs/jpeg:0
636 + !media-libs/jpeg:62
637 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
638 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
639 +RDEPEND="${COMMON_DEPEND}
640 + java? ( >=virtual/jre-1.5 )"
641 +DEPEND="${COMMON_DEPEND}
642 + amd64? ( ${ASM_DEPEND} )
643 + x86? ( ${ASM_DEPEND} )
644 + amd64-fbsd? ( ${ASM_DEPEND} )
645 + x86-fbsd? ( ${ASM_DEPEND} )
646 + amd64-linux? ( ${ASM_DEPEND} )
647 + x86-linux? ( ${ASM_DEPEND} )
648 + x64-macos? ( ${ASM_DEPEND} )
649 + java? ( >=virtual/jdk-1.5 )"
650 +
651 +MULTILIB_WRAPPED_HEADERS=( /usr/include/jconfig.h )
652 +
653 +src_prepare() {
654 + epatch "${FILESDIR}"/${PN}-1.2.0-x32.patch #420239
655 + epatch "${FILESDIR}"/${PN}-1.3.1-jstdhuff.patch
656 + epatch "${FILESDIR}"/${PN}-1.3.1-overrun.patch
657 +
658 + # generate a new ./configure compatible with non-bash shells, #533902
659 + eautoreconf
660 +
661 + java-pkg-opt-2_src_prepare
662 +}
663 +
664 +multilib_src_configure() {
665 + local myconf=()
666 + if multilib_is_native_abi; then
667 + myconf+=( $(use_with java) )
668 + if use java; then
669 + export JAVACFLAGS="$(java-pkg_javac-args)"
670 + export JNI_CFLAGS="$(java-pkg_get-jni-cflags)"
671 + fi
672 + else
673 + myconf+=( --without-java )
674 + fi
675 + [[ ${ABI} == "x32" ]] && myconf+=( --without-simd ) #420239
676 +
677 + ECONF_SOURCE=${S} \
678 + econf \
679 + $(use_enable static-libs static) \
680 + --with-mem-srcdst \
681 + "${myconf[@]}"
682 +}
683 +
684 +multilib_src_compile() {
685 + local _java_makeopts
686 + use java && _java_makeopts="-j1"
687 + emake ${_java_makeopts}
688 +
689 + if multilib_is_native_abi; then
690 + pushd ../debian/extra >/dev/null
691 + emake CC="$(tc-getCC)" CFLAGS="${LDFLAGS} ${CFLAGS}"
692 + popd >/dev/null
693 + fi
694 +}
695 +
696 +multilib_src_test() {
697 + emake test
698 +}
699 +
700 +multilib_src_install() {
701 + emake \
702 + DESTDIR="${D}" \
703 + docdir="${EPREFIX}"/usr/share/doc/${PF} \
704 + exampledir="${EPREFIX}"/usr/share/doc/${PF} \
705 + install
706 +
707 + if multilib_is_native_abi; then
708 + pushd "${WORKDIR}"/debian/extra >/dev/null
709 + emake \
710 + DESTDIR="${D}" prefix="${EPREFIX}"/usr \
711 + INSTALL="install -m755" INSTALLDIR="install -d -m755" \
712 + install
713 + popd >/dev/null
714 +
715 + if use java; then
716 + rm -rf "${ED}"/usr/classes
717 + java-pkg_dojar java/turbojpeg.jar
718 + fi
719 + fi
720 +}
721 +
722 +multilib_src_install_all() {
723 + prune_libtool_files
724 +
725 + insinto /usr/share/doc/${PF}/html
726 + doins -r "${S}"/doc/html/*
727 + newdoc "${WORKDIR}"/debian/changelog changelog.debian
728 + if use java; then
729 + insinto /usr/share/doc/${PF}/html/java
730 + doins -r "${S}"/java/doc/*
731 + newdoc "${S}"/java/README README.java
732 + fi
733 +}
734
735 diff --git a/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1.ebuild b/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1.ebuild
736 new file mode 100644
737 index 0000000..5ffdfb4
738 --- /dev/null
739 +++ b/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1.ebuild
740 @@ -0,0 +1,121 @@
741 +# Copyright 1999-2014 Gentoo Foundation
742 +# Distributed under the terms of the GNU General Public License v2
743 +# $Header: /var/cvsroot/gentoo-x86/media-libs/libjpeg-turbo/libjpeg-turbo-1.3.1.ebuild,v 1.9 2014/08/01 16:31:13 tgall Exp $
744 +
745 +EAPI=5
746 +
747 +inherit autotools eutils java-pkg-opt-2 libtool toolchain-funcs multilib-minimal
748 +
749 +DESCRIPTION="MMX, SSE, and SSE2 SIMD accelerated JPEG library"
750 +HOMEPAGE="http://libjpeg-turbo.virtualgl.org/ http://sourceforge.net/projects/libjpeg-turbo/"
751 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
752 + mirror://debian/pool/main/libj/libjpeg8/libjpeg8_8d-2.debian.tar.gz"
753 +
754 +LICENSE="BSD IJG"
755 +SLOT="0"
756 +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ~ppc ~ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
757 +IUSE="java static-libs"
758 +
759 +ASM_DEPEND="|| ( dev-lang/nasm dev-lang/yasm )"
760 +COMMON_DEPEND="!media-libs/jpeg:0
761 + !media-libs/jpeg:62
762 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
763 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
764 +RDEPEND="${COMMON_DEPEND}
765 + java? ( >=virtual/jre-1.5 )"
766 +DEPEND="${COMMON_DEPEND}
767 + amd64? ( ${ASM_DEPEND} )
768 + x86? ( ${ASM_DEPEND} )
769 + amd64-fbsd? ( ${ASM_DEPEND} )
770 + x86-fbsd? ( ${ASM_DEPEND} )
771 + amd64-linux? ( ${ASM_DEPEND} )
772 + x86-linux? ( ${ASM_DEPEND} )
773 + x64-macos? ( ${ASM_DEPEND} )
774 + java? ( >=virtual/jdk-1.5 )"
775 +
776 +MULTILIB_WRAPPED_HEADERS=( /usr/include/jconfig.h )
777 +
778 +src_prepare() {
779 + epatch "${FILESDIR}"/${PN}-1.2.0-x32.patch #420239
780 +
781 + if [[ -x ./configure ]]; then
782 + elibtoolize
783 + else
784 + eautoreconf
785 + fi
786 +
787 + epunt_cxx #424689
788 +
789 + java-pkg-opt-2_src_prepare
790 +}
791 +
792 +multilib_src_configure() {
793 + local myconf=()
794 + if multilib_is_native_abi; then
795 + myconf+=( $(use_with java) )
796 + if use java; then
797 + export JAVACFLAGS="$(java-pkg_javac-args)"
798 + export JNI_CFLAGS="$(java-pkg_get-jni-cflags)"
799 + fi
800 + else
801 + myconf+=( --without-java )
802 + fi
803 + [[ ${ABI} == "x32" ]] && myconf+=( --without-simd ) #420239
804 +
805 + ECONF_SOURCE=${S} \
806 + econf \
807 + $(use_enable static-libs static) \
808 + --with-mem-srcdst \
809 + "${myconf[@]}"
810 +}
811 +
812 +multilib_src_compile() {
813 + local _java_makeopts
814 + use java && _java_makeopts="-j1"
815 + emake ${_java_makeopts}
816 +
817 + if multilib_is_native_abi; then
818 + pushd ../debian/extra >/dev/null
819 + emake CC="$(tc-getCC)" CFLAGS="${LDFLAGS} ${CFLAGS}"
820 + popd >/dev/null
821 + fi
822 +}
823 +
824 +multilib_src_test() {
825 + emake test
826 +}
827 +
828 +multilib_src_install() {
829 + emake \
830 + DESTDIR="${D}" \
831 + docdir="${EPREFIX}"/usr/share/doc/${PF} \
832 + exampledir="${EPREFIX}"/usr/share/doc/${PF} \
833 + install
834 +
835 + if multilib_is_native_abi; then
836 + pushd "${WORKDIR}"/debian/extra >/dev/null
837 + emake \
838 + DESTDIR="${D}" prefix="${EPREFIX}"/usr \
839 + INSTALL="install -m755" INSTALLDIR="install -d -m755" \
840 + install
841 + popd >/dev/null
842 +
843 + if use java; then
844 + rm -rf "${ED}"/usr/classes
845 + java-pkg_dojar java/turbojpeg.jar
846 + fi
847 + fi
848 +}
849 +
850 +multilib_src_install_all() {
851 + prune_libtool_files
852 +
853 + insinto /usr/share/doc/${PF}/html
854 + doins -r "${S}"/doc/html/*
855 + newdoc "${WORKDIR}"/debian/changelog changelog.debian
856 + if use java; then
857 + insinto /usr/share/doc/${PF}/html/java
858 + doins -r "${S}"/java/doc/*
859 + newdoc "${S}"/java/README README.java
860 + fi
861 +}
862
863 diff --git a/media-libs/libjpeg-turbo/metadata.xml b/media-libs/libjpeg-turbo/metadata.xml
864 new file mode 100644
865 index 0000000..2df8087
866 --- /dev/null
867 +++ b/media-libs/libjpeg-turbo/metadata.xml
868 @@ -0,0 +1,13 @@
869 +<?xml version="1.0" encoding="UTF-8"?>
870 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
871 +<pkgmetadata>
872 + <herd>graphics</herd>
873 + <maintainer>
874 + <email>ssuominen@g.o</email>
875 + <name>Samuli Suominen</name>
876 + </maintainer>
877 + <maintainer>
878 + <email>anarchy@g.o</email>
879 + <name>Jory A. Pratt</name>
880 + </maintainer>
881 +</pkgmetadata>