Gentoo Archives: gentoo-commits

From: Alexandre Restovtsev <tetromino@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:master commit in: media-libs/rply/, media-libs/rply/files/
Date: Sat, 29 Oct 2011 19:32:45
Message-Id: effaed15191317ab17eca172dcfc3a2c4c04adbd.tetromino@gentoo
1 commit: effaed15191317ab17eca172dcfc3a2c4c04adbd
2 Author: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 29 19:30:22 2011 +0000
4 Commit: Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
5 CommitDate: Sat Oct 29 19:30:22 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=effaed15
7
8 media-libs/rply: moved to gx86
9
10 ---
11 media-libs/rply/files/rply-1.01-lc_numeric.patch | 86 ----------
12 media-libs/rply/files/rply-1.01-stdint.h.patch | 185 ----------------------
13 media-libs/rply/files/rply_CMakeLists.txt | 39 -----
14 media-libs/rply/rply-1.01-r1.ebuild | 36 ----
15 4 files changed, 0 insertions(+), 346 deletions(-)
16
17 diff --git a/media-libs/rply/files/rply-1.01-lc_numeric.patch b/media-libs/rply/files/rply-1.01-lc_numeric.patch
18 deleted file mode 100644
19 index 6d98abd..0000000
20 --- a/media-libs/rply/files/rply-1.01-lc_numeric.patch
21 +++ /dev/null
22 @@ -1,86 +0,0 @@
23 -From 8a7a76b7dcc94e8e71725e26a146330c73377ebd Mon Sep 17 00:00:00 2001
24 -From: Alexandre Rostovtsev <tetromino@×××××.com>
25 -Date: Mon, 26 Sep 2011 04:46:44 -0400
26 -Subject: [PATCH 2/2] Switch LC_NUMERIC locale to "C" for decimal point
27 - separator safety
28 -
29 -Make sure to switch the LC_NUMERIC locale to "C" when using strtod() and
30 -fpritnf("%g",...) to ensure that '.' is used as the decimal point
31 -separator when reading and writing .ply files.
32 ----
33 - rply.c | 31 +++++++++++++++++++++++++++----
34 - 1 files changed, 27 insertions(+), 4 deletions(-)
35 -
36 -diff --git a/rply.c b/rply.c
37 -index 9eaa77f..789c002 100644
38 ---- a/rply.c
39 -+++ b/rply.c
40 -@@ -12,6 +12,7 @@
41 - #include <string.h>
42 - #include <limits.h>
43 - #include <float.h>
44 -+#include <locale.h>
45 - #include <stdarg.h>
46 - #include <stdlib.h>
47 - #include <stddef.h>
48 -@@ -1229,13 +1230,27 @@ static int oascii_uint32(p_ply ply, double value) {
49 - }
50 -
51 - static int oascii_float32(p_ply ply, double value) {
52 -+ char *curr_locale;
53 -+ int ret;
54 - if (value < -FLT_MAX || value > FLT_MAX) return 0;
55 -- return fprintf(ply->fp, "%g ", (float) value) > 0;
56 -+ /* Switch locale to C to use '.' as the decimal point separator */
57 -+ curr_locale = setlocale(LC_NUMERIC, NULL);
58 -+ setlocale(LC_NUMERIC, "C");
59 -+ ret = fprintf(ply->fp, "%g ", (float) value);
60 -+ setlocale(LC_NUMERIC, curr_locale);
61 -+ return ret > 0;
62 - }
63 -
64 - static int oascii_float64(p_ply ply, double value) {
65 -+ char *curr_locale;
66 -+ int ret;
67 - if (value < -DBL_MAX || value > DBL_MAX) return 0;
68 -- return fprintf(ply->fp, "%g ", value) > 0;
69 -+ /* Switch locale to C to use '.' as the decimal point separator */
70 -+ curr_locale = setlocale(LC_NUMERIC, NULL);
71 -+ setlocale(LC_NUMERIC, "C");
72 -+ ret = fprintf(ply->fp, "%g ", value);
73 -+ setlocale(LC_NUMERIC, curr_locale);
74 -+ return ret > 0;
75 - }
76 -
77 - static int obinary_int8(p_ply ply, double value) {
78 -@@ -1336,17 +1351,25 @@ static int iascii_uint32(p_ply ply, double *value) {
79 - }
80 -
81 - static int iascii_float32(p_ply ply, double *value) {
82 -- char *end;
83 -+ char *end, *curr_locale;
84 - if (!ply_read_word(ply)) return 0;
85 -+ /* Switch locale to C to use '.' as the decimal point separator */
86 -+ curr_locale = setlocale(LC_NUMERIC, NULL);
87 -+ setlocale(LC_NUMERIC, "C");
88 - *value = strtod(BWORD(ply), &end);
89 -+ setlocale(LC_NUMERIC, curr_locale);
90 - if (*end || *value < -FLT_MAX || *value > FLT_MAX) return 0;
91 - return 1;
92 - }
93 -
94 - static int iascii_float64(p_ply ply, double *value) {
95 -- char *end;
96 -+ char *end, *curr_locale;
97 - if (!ply_read_word(ply)) return 0;
98 -+ /* Switch locale to C to use '.' as the decimal point separator */
99 -+ curr_locale = setlocale(LC_NUMERIC, NULL);
100 -+ setlocale(LC_NUMERIC, "C");
101 - *value = strtod(BWORD(ply), &end);
102 -+ setlocale(LC_NUMERIC, curr_locale);
103 - if (*end || *value < -DBL_MAX || *value > DBL_MAX) return 0;
104 - return 1;
105 - }
106 ---
107 -1.7.6.1
108 -
109
110 diff --git a/media-libs/rply/files/rply-1.01-stdint.h.patch b/media-libs/rply/files/rply-1.01-stdint.h.patch
111 deleted file mode 100644
112 index 45c9116..0000000
113 --- a/media-libs/rply/files/rply-1.01-stdint.h.patch
114 +++ /dev/null
115 @@ -1,185 +0,0 @@
116 -From eeb09032068baed6d81cff01cdfcccd6d55a8152 Mon Sep 17 00:00:00 2001
117 -From: Alexandre Rostovtsev <tetromino@×××××.com>
118 -Date: Mon, 26 Sep 2011 04:45:49 -0400
119 -Subject: [PATCH 1/2] Use stdint.h types
120 -
121 -Use stdint.h types (int16_t and int32_t) instead of assuming that short
122 -and long must always a specific number of bytes. Also, use strtoul for
123 -reading uint32_t values.
124 ----
125 - rply.c | 61 ++++++++++++++++++++++++++++---------------------------------
126 - 1 files changed, 28 insertions(+), 33 deletions(-)
127 -
128 -diff --git a/rply.c b/rply.c
129 -index 042244f..9eaa77f 100644
130 ---- a/rply.c
131 -+++ b/rply.c
132 -@@ -15,6 +15,7 @@
133 - #include <stdarg.h>
134 - #include <stdlib.h>
135 - #include <stddef.h>
136 -+#include <stdint.h>
137 -
138 - #include "rply.h"
139 -
140 -@@ -1183,18 +1184,12 @@ static e_ply_storage_mode ply_arch_endian(void) {
141 - static int ply_type_check(void) {
142 - assert(sizeof(char) == 1);
143 - assert(sizeof(unsigned char) == 1);
144 -- assert(sizeof(short) == 2);
145 -- assert(sizeof(unsigned short) == 2);
146 -- assert(sizeof(long) == 4);
147 -- assert(sizeof(unsigned long) == 4);
148 -+ assert(sizeof(long) >= 4);
149 - assert(sizeof(float) == 4);
150 - assert(sizeof(double) == 8);
151 - if (sizeof(char) != 1) return 0;
152 - if (sizeof(unsigned char) != 1) return 0;
153 -- if (sizeof(short) != 2) return 0;
154 -- if (sizeof(unsigned short) != 2) return 0;
155 -- if (sizeof(long) != 4) return 0;
156 -- if (sizeof(unsigned long) != 4) return 0;
157 -+ if (sizeof(long) < 4) return 0;
158 - if (sizeof(float) != 4) return 0;
159 - if (sizeof(double) != 8) return 0;
160 - return 1;
161 -@@ -1214,23 +1209,23 @@ static int oascii_uint8(p_ply ply, double value) {
162 - }
163 -
164 - static int oascii_int16(p_ply ply, double value) {
165 -- if (value > SHRT_MAX || value < SHRT_MIN) return 0;
166 -- return fprintf(ply->fp, "%d ", (short) value) > 0;
167 -+ if (value > INT16_MAX || value < INT16_MIN) return 0;
168 -+ return fprintf(ply->fp, "%d ", (int16_t) value) > 0;
169 - }
170 -
171 - static int oascii_uint16(p_ply ply, double value) {
172 -- if (value > USHRT_MAX || value < 0) return 0;
173 -- return fprintf(ply->fp, "%d ", (unsigned short) value) > 0;
174 -+ if (value > UINT16_MAX || value < 0) return 0;
175 -+ return fprintf(ply->fp, "%d ", (uint16_t) value) > 0;
176 - }
177 -
178 - static int oascii_int32(p_ply ply, double value) {
179 -- if (value > LONG_MAX || value < LONG_MIN) return 0;
180 -- return fprintf(ply->fp, "%d ", (int) value) > 0;
181 -+ if (value > INT32_MAX || value < INT32_MIN) return 0;
182 -+ return fprintf(ply->fp, "%d ", (int32_t) value) > 0;
183 - }
184 -
185 - static int oascii_uint32(p_ply ply, double value) {
186 -- if (value > ULONG_MAX || value < 0) return 0;
187 -- return fprintf(ply->fp, "%d ", (unsigned int) value) > 0;
188 -+ if (value > UINT32_MAX || value < 0) return 0;
189 -+ return fprintf(ply->fp, "%d ", (uint32_t) value) > 0;
190 - }
191 -
192 - static int oascii_float32(p_ply ply, double value) {
193 -@@ -1256,26 +1251,26 @@ static int obinary_uint8(p_ply ply, double value) {
194 - }
195 -
196 - static int obinary_int16(p_ply ply, double value) {
197 -- short int16 = (short) value;
198 -- if (value > SHRT_MAX || value < SHRT_MIN) return 0;
199 -+ int16_t int16 = value;
200 -+ if (value > INT16_MAX || value < INT16_MIN) return 0;
201 - return ply->odriver->ochunk(ply, &int16, sizeof(int16));
202 - }
203 -
204 - static int obinary_uint16(p_ply ply, double value) {
205 -- unsigned short uint16 = (unsigned short) value;
206 -- if (value > USHRT_MAX || value < 0) return 0;
207 -+ uint16_t uint16 = value;
208 -+ if (value > UINT16_MAX || value < 0) return 0;
209 - return ply->odriver->ochunk(ply, &uint16, sizeof(uint16));
210 - }
211 -
212 - static int obinary_int32(p_ply ply, double value) {
213 -- long int32 = (long) value;
214 -- if (value > LONG_MAX || value < LONG_MIN) return 0;
215 -+ int32_t int32 = value;
216 -+ if (value > INT32_MAX || value < INT32_MIN) return 0;
217 - return ply->odriver->ochunk(ply, &int32, sizeof(int32));
218 - }
219 -
220 - static int obinary_uint32(p_ply ply, double value) {
221 -- unsigned long uint32 = (unsigned long) value;
222 -- if (value > ULONG_MAX || value < 0) return 0;
223 -+ uint32_t uint32 = value;
224 -+ if (value > UINT32_MAX || value < 0) return 0;
225 - return ply->odriver->ochunk(ply, &uint32, sizeof(uint32));
226 - }
227 -
228 -@@ -1312,7 +1307,7 @@ static int iascii_int16(p_ply ply, double *value) {
229 - char *end;
230 - if (!ply_read_word(ply)) return 0;
231 - *value = strtol(BWORD(ply), &end, 10);
232 -- if (*end || *value > SHRT_MAX || *value < SHRT_MIN) return 0;
233 -+ if (*end || *value > INT16_MAX || *value < INT16_MIN) return 0;
234 - return 1;
235 - }
236 -
237 -@@ -1320,7 +1315,7 @@ static int iascii_uint16(p_ply ply, double *value) {
238 - char *end;
239 - if (!ply_read_word(ply)) return 0;
240 - *value = strtol(BWORD(ply), &end, 10);
241 -- if (*end || *value > USHRT_MAX || *value < 0) return 0;
242 -+ if (*end || *value > UINT16_MAX || *value < 0) return 0;
243 - return 1;
244 - }
245 -
246 -@@ -1328,15 +1323,15 @@ static int iascii_int32(p_ply ply, double *value) {
247 - char *end;
248 - if (!ply_read_word(ply)) return 0;
249 - *value = strtol(BWORD(ply), &end, 10);
250 -- if (*end || *value > LONG_MAX || *value < LONG_MIN) return 0;
251 -+ if (*end || *value > INT32_MAX || *value < INT32_MIN) return 0;
252 - return 1;
253 - }
254 -
255 - static int iascii_uint32(p_ply ply, double *value) {
256 - char *end;
257 - if (!ply_read_word(ply)) return 0;
258 -- *value = strtol(BWORD(ply), &end, 10);
259 -- if (*end || *value < 0) return 0;
260 -+ *value = strtoul(BWORD(ply), &end, 10);
261 -+ if (*end || *value > UINT32_MAX || *value < 0) return 0;
262 - return 1;
263 - }
264 -
265 -@@ -1371,28 +1366,28 @@ static int ibinary_uint8(p_ply ply, double *value) {
266 - }
267 -
268 - static int ibinary_int16(p_ply ply, double *value) {
269 -- short int16;
270 -+ int16_t int16;
271 - if (!ply->idriver->ichunk(ply, &int16, sizeof(int16))) return 0;
272 - *value = int16;
273 - return 1;
274 - }
275 -
276 - static int ibinary_uint16(p_ply ply, double *value) {
277 -- unsigned short uint16;
278 -+ uint16_t uint16;
279 - if (!ply->idriver->ichunk(ply, &uint16, sizeof(uint16))) return 0;
280 - *value = uint16;
281 - return 1;
282 - }
283 -
284 - static int ibinary_int32(p_ply ply, double *value) {
285 -- long int32;
286 -+ int32_t int32;
287 - if (!ply->idriver->ichunk(ply, &int32, sizeof(int32))) return 0;
288 - *value = int32;
289 - return 1;
290 - }
291 -
292 - static int ibinary_uint32(p_ply ply, double *value) {
293 -- unsigned long uint32;
294 -+ uint32_t uint32;
295 - if (!ply->idriver->ichunk(ply, &uint32, sizeof(uint32))) return 0;
296 - *value = uint32;
297 - return 1;
298 ---
299 -1.7.6.1
300 -
301
302 diff --git a/media-libs/rply/files/rply_CMakeLists.txt b/media-libs/rply/files/rply_CMakeLists.txt
303 deleted file mode 100644
304 index 5497fff..0000000
305 --- a/media-libs/rply/files/rply_CMakeLists.txt
306 +++ /dev/null
307 @@ -1,39 +0,0 @@
308 -# Fedora's cmake file for rply
309 -# http://pkgs.fedoraproject.org/gitweb/?p=rply.git;a=blob;f=rply_CMakeLists.txt
310 -PROJECT(rply)
311 -cmake_minimum_required(VERSION 2.6)
312 -
313 -SET(RPLY_LIB_MAJOR_VERSION 1)
314 -SET(RPLY_LIB_MINOR_VERSION 01)
315 -
316 -SET(RPLY_CMAKE_DIR ${CMAKE_SOURCE_DIR}/CMake/ )
317 -SET(RPLY_LIBRARY librply.so )
318 -
319 -add_library(rply SHARED rply.c )
320 -set_target_properties( rply PROPERTIES
321 - VERSION ${RPLY_LIB_MAJOR_VERSION}.${RPLY_LIB_MINOR_VERSION}
322 - SOVERSION ${RPLY_LIB_MAJOR_VERSION}
323 - )
324 -
325 -include_directories( ${CMAKE_SOURCE_DIR} )
326 -add_executable(rply_convert etc/convert.c )
327 -add_executable(rply_dump etc/dump.c )
328 -add_executable(rply_sconvert etc/sconvert.c )
329 -target_link_libraries (rply_convert rply)
330 -target_link_libraries (rply_dump rply)
331 -target_link_libraries (rply_sconvert rply)
332 -
333 -# Installs the header files
334 -install(FILES rply.h DESTINATION include/rply)
335 -
336 -# Installs the target file
337 -install(TARGETS rply LIBRARY DESTINATION lib${LIB_SUFFIX})
338 -install(TARGETS rply_convert RUNTIME DESTINATION bin)
339 -install(TARGETS rply_dump RUNTIME DESTINATION bin)
340 -install(TARGETS rply_sconvert RUNTIME DESTINATION bin)
341 -
342 -#This should be the last line of the project
343 -SUBDIRS( CMake/export )
344 -
345 -
346 -
347
348 diff --git a/media-libs/rply/rply-1.01-r1.ebuild b/media-libs/rply/rply-1.01-r1.ebuild
349 deleted file mode 100644
350 index d776145..0000000
351 --- a/media-libs/rply/rply-1.01-r1.ebuild
352 +++ /dev/null
353 @@ -1,36 +0,0 @@
354 -# Copyright 1999-2011 Gentoo Foundation
355 -# Distributed under the terms of the GNU General Public License v2
356 -# $Header: $
357 -
358 -EAPI="4"
359 -
360 -inherit cmake-utils
361 -
362 -DESCRIPTION="A library to read and write PLY files"
363 -HOMEPAGE="http://w3.impa.br/~diego/software/rply/"
364 -SRC_URI="http://w3.impa.br/~diego/software/rply/${P}.tar.gz"
365 -
366 -LICENSE="MIT"
367 -SLOT="0"
368 -KEYWORDS="~amd64 ~x86"
369 -IUSE="doc"
370 -
371 -DEPEND=""
372 -RDEPEND="${DEPEND}"
373 -
374 -pkg_setup() {
375 - use doc && HTML_DOCS="manual/*"
376 -}
377 -
378 -src_prepare() {
379 - # rply doesn't have *any* build system - not even a Makefile!
380 - # For simplicity, use the cmake file that Fedora maintainers have created
381 - cp "${FILESDIR}/rply_CMakeLists.txt" CMakeLists.txt
382 - mkdir -p CMake/export
383 -
384 - # Use int16_t and int32_t instead of assuming e.g. that sizeof(long) == 4
385 - epatch "${FILESDIR}/${P}-stdint.h.patch"
386 -
387 - # Switch LC_NUMERIC locale to "C" to ensure "." is the decimal separator
388 - epatch "${FILESDIR}/${P}-lc_numeric.patch"
389 -}