1 |
commit: 4c03f78243963efce16ce414767f32d32c267026 |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 26 22:40:06 2019 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 26 22:45:31 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c03f782 |
7 |
|
8 |
media-libs/freeglut: Drop old versions |
9 |
|
10 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
11 |
|
12 |
media-libs/freeglut/Manifest | 1 - |
13 |
.../files/freeglut-3.0.0-bsd-usb-joystick.patch | 753 --------------------- |
14 |
.../freeglut-3.0.0-drop-unnecessary-x11-libs.patch | 30 - |
15 |
media-libs/freeglut/freeglut-3.0.0.ebuild | 44 -- |
16 |
4 files changed, 828 deletions(-) |
17 |
|
18 |
diff --git a/media-libs/freeglut/Manifest b/media-libs/freeglut/Manifest |
19 |
index 395bdc3311a..65e5ed2d160 100644 |
20 |
--- a/media-libs/freeglut/Manifest |
21 |
+++ b/media-libs/freeglut/Manifest |
22 |
@@ -1,2 +1 @@ |
23 |
-DIST freeglut-3.0.0.tar.gz 419095 BLAKE2B 6065044fb2816ddfebd363189cdb897e00fa433d79c09f5a705b80ff730e1312158ed5db8d7a2cbfc2ddac0d0a9400300c5c245d967c33c937da11303fc316de SHA512 9c45d5b203b26a7ff92331b3e080a48e806c92fbbe7c65d9262dd18c39cd6efdad8a795a80f499a2d23df84b4909dbd7c1bab20d7dd3555d3d88782ce9dd15b0 |
24 |
DIST freeglut-3.2.1.tar.gz 440228 BLAKE2B ed8a4b2361416cfee5540350ee50c32a56e5ea75d6834c677c5cec676967a04e13b2adf3da1cc9a3a2c73fbc6147b3b0bc91953a6edf1e35ce8c933eeff6f97a SHA512 aced4bbcd36269ce6f4ee1982e0f9e3fffbf18c94f785d3215ac9f4809b992e166c7ada496ed6174e13d77c0f7ef3ca4c57d8a282e96cbbe6ff086339ade3b08 |
25 |
|
26 |
diff --git a/media-libs/freeglut/files/freeglut-3.0.0-bsd-usb-joystick.patch b/media-libs/freeglut/files/freeglut-3.0.0-bsd-usb-joystick.patch |
27 |
deleted file mode 100644 |
28 |
index 505b3467ec4..00000000000 |
29 |
--- a/media-libs/freeglut/files/freeglut-3.0.0-bsd-usb-joystick.patch |
30 |
+++ /dev/null |
31 |
@@ -1,753 +0,0 @@ |
32 |
-From 5908c36a4a3964cdc8db5c7bfdfd4381ec0996df Mon Sep 17 00:00:00 2001 |
33 |
-From: dcnieho <dcnieho@7f0cb862-5218-0410-a997-914c9d46530a> |
34 |
-Date: Wed, 12 Jul 2017 20:44:35 +0000 |
35 |
-Subject: [PATCH] Fix build on NetBSD. |
36 |
- |
37 |
-(cherry picked from commit 06e1d815cf9abda49b845754ff420734446eb95b) |
38 |
- |
39 |
-(cherry picked from commit c4294ad59093c27159ea6028d33e3c9581df5354) |
40 |
- |
41 |
-git-svn-id: http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1829 7f0cb862-5218-0410-a997-914c9d46530a |
42 |
---- |
43 |
- src/fg_joystick.c | 5 ++--- |
44 |
- src/x11/fg_joystick_x11.c | 10 +++++----- |
45 |
- 2 files changed, 7 insertions(+), 8 deletions(-) |
46 |
- |
47 |
-diff --git a/src/fg_joystick.c b/src/fg_joystick.c |
48 |
-index 6f6771c..b73d7e7 100644 |
49 |
---- a/src/fg_joystick.c |
50 |
-+++ b/src/fg_joystick.c |
51 |
-@@ -46,21 +46,20 @@ |
52 |
- |
53 |
- # ifdef HAVE_USB_JS |
54 |
- # if defined(__NetBSD__) |
55 |
--/* XXX The below hack is done until freeglut's autoconf is updated. */ |
56 |
--# define HAVE_USBHID_H 1 |
57 |
- # ifdef HAVE_USBHID_H |
58 |
- # include <usbhid.h> |
59 |
- # else |
60 |
- # include <usb.h> |
61 |
- # endif |
62 |
-+# include <dev/usb/usb.h> |
63 |
- # elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
64 |
- # ifdef HAVE_USBHID_H |
65 |
- # include <usbhid.h> |
66 |
- # else |
67 |
- # include <libusbhid.h> |
68 |
- # endif |
69 |
-+# include <legacy/dev/usb/usb.h> |
70 |
- # endif |
71 |
--# include <legacy/dev/usb/usb.h> |
72 |
- # include <dev/usb/usbhid.h> |
73 |
- |
74 |
- /* Compatibility with older usb.h revisions */ |
75 |
-diff --git a/src/x11/fg_joystick_x11.c b/src/x11/fg_joystick_x11.c |
76 |
-index a37388b..04bc373 100644 |
77 |
---- a/src/x11/fg_joystick_x11.c |
78 |
-+++ b/src/x11/fg_joystick_x11.c |
79 |
-@@ -50,7 +50,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) |
80 |
- { |
81 |
- int status; |
82 |
- |
83 |
--#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) |
84 |
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
85 |
- int len; |
86 |
- |
87 |
- if ( joy->pJoystick.os->is_analog ) |
88 |
-@@ -215,7 +215,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) |
89 |
- |
90 |
- void fgPlatformJoystickOpen( SFG_Joystick* joy ) |
91 |
- { |
92 |
--#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ ) |
93 |
-+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) |
94 |
- int i = 0; |
95 |
- char *cp; |
96 |
- #endif |
97 |
-@@ -229,7 +229,7 @@ void fgPlatformJoystickOpen( SFG_Joystick* joy ) |
98 |
- # endif |
99 |
- #endif |
100 |
- |
101 |
--#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ ) |
102 |
-+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) |
103 |
- for( i = 0; i < _JS_MAX_AXES; i++ ) |
104 |
- joy->pJoystick.os->cache_axes[ i ] = 0.0f; |
105 |
- |
106 |
-@@ -409,7 +409,7 @@ void fgPlatformJoystickOpen( SFG_Joystick* joy ) |
107 |
- |
108 |
- void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident ) |
109 |
- { |
110 |
--#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ ) |
111 |
-+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) |
112 |
- fgJoystick[ ident ]->id = ident; |
113 |
- fgJoystick[ ident ]->error = GL_FALSE; |
114 |
- |
115 |
-@@ -436,7 +436,7 @@ void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident ) |
116 |
- |
117 |
- void fgPlatformJoystickClose ( int ident ) |
118 |
- { |
119 |
--#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ ) |
120 |
-+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) |
121 |
- if( fgJoystick[ident]->pJoystick.os ) |
122 |
- { |
123 |
- if( ! fgJoystick[ ident ]->error ) |
124 |
--- |
125 |
-2.19.2 |
126 |
- |
127 |
-From c0f0f1e0903a5dd848825db0fe1f01d5db37c4e1 Mon Sep 17 00:00:00 2001 |
128 |
-From: dcnieho <dcnieho@7f0cb862-5218-0410-a997-914c9d46530a> |
129 |
-Date: Wed, 12 Jul 2017 20:44:47 +0000 |
130 |
-Subject: [PATCH] some whitespace cleanup |
131 |
- |
132 |
-(cherry picked from commit 2dd5aa4aa1b5c19392f9abd00e0f6893907df205) |
133 |
- |
134 |
-git-svn-id: http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1830 7f0cb862-5218-0410-a997-914c9d46530a |
135 |
---- |
136 |
- src/fg_init.c | 32 ++-- |
137 |
- src/fg_joystick.c | 8 +- |
138 |
- src/fg_main.c | 14 +- |
139 |
- src/freeglutdll.def.in | 312 +++++++++++++++++----------------- |
140 |
- src/mswin/fg_joystick_mswin.c | 2 +- |
141 |
- src/mswin/fg_main_mswin.c | 160 ++++++++--------- |
142 |
- 6 files changed, 264 insertions(+), 264 deletions(-) |
143 |
- |
144 |
-diff --git a/src/fg_joystick.c b/src/fg_joystick.c |
145 |
-index b73d7e7..2f4f6ed 100644 |
146 |
---- a/src/fg_joystick.c |
147 |
-+++ b/src/fg_joystick.c |
148 |
-@@ -581,7 +581,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) |
149 |
- |
150 |
- void fgPlatformJoystickOpen( SFG_Joystick* joy ) |
151 |
- { |
152 |
-- int i = 0; |
153 |
-+ int i = 0; |
154 |
- OSStatus err; |
155 |
- |
156 |
- /* XXX FIXME: get joystick name in Mac */ |
157 |
-@@ -856,7 +856,7 @@ static void fghJoystickOpen( SFG_Joystick* joy ) |
158 |
- joy->num_axes = joy->num_buttons = 0; |
159 |
- joy->name[ 0 ] = '\0'; |
160 |
- |
161 |
-- fgPlatformJoystickOpen ( joy ); |
162 |
-+ fgPlatformJoystickOpen ( joy ); |
163 |
- |
164 |
- } |
165 |
- |
166 |
-@@ -878,7 +878,7 @@ static void fghJoystickInit( int ident ) |
167 |
- fgJoystick[ ident ]->num_axes = fgJoystick[ ident ]->num_buttons = 0; |
168 |
- fgJoystick[ ident ]->error = GL_TRUE; |
169 |
- |
170 |
-- fgPlatformJoystickInit( fgJoystick, ident ); |
171 |
-+ fgPlatformJoystickInit( fgJoystick, ident ); |
172 |
- |
173 |
- fghJoystickOpen( fgJoystick[ ident ] ); |
174 |
- } |
175 |
-@@ -906,7 +906,7 @@ void fgJoystickClose( void ) |
176 |
- { |
177 |
- if( fgJoystick[ ident ] ) |
178 |
- { |
179 |
-- fgPlatformJoystickClose ( ident ); |
180 |
-+ fgPlatformJoystickClose ( ident ); |
181 |
- |
182 |
- free( fgJoystick[ ident ] ); |
183 |
- fgJoystick[ ident ] = NULL; |
184 |
--- |
185 |
-2.19.2 |
186 |
- |
187 |
-From 6096caf2468ad4557968b9156ea9fcab2efb3fd1 Mon Sep 17 00:00:00 2001 |
188 |
-From: dcnieho <dcnieho@7f0cb862-5218-0410-a997-914c9d46530a> |
189 |
-Date: Wed, 12 Jul 2017 20:45:07 +0000 |
190 |
-Subject: [PATCH] moved static variables and functions that should not have |
191 |
- stuck behind in fg_joystick.c, but should have been in fg_joystick_x11.c |
192 |
- |
193 |
-(cherry picked from commit 0d98472817921dc95d070f13bba59b72d792a7b2) |
194 |
- |
195 |
-git-svn-id: http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1832 7f0cb862-5218-0410-a997-914c9d46530a |
196 |
---- |
197 |
- src/fg_joystick.c | 173 ---------------------------------- |
198 |
- src/x11/fg_joystick_x11.c | 190 +++++++++++++++++++++++++++++++++++++- |
199 |
- 2 files changed, 185 insertions(+), 178 deletions(-) |
200 |
- |
201 |
-diff --git a/src/fg_joystick.c b/src/fg_joystick.c |
202 |
-index 2f4f6ed..e548c04 100644 |
203 |
---- a/src/fg_joystick.c |
204 |
-+++ b/src/fg_joystick.c |
205 |
-@@ -68,8 +68,6 @@ |
206 |
- # endif |
207 |
- # endif |
208 |
- |
209 |
--static int hatmap_x[9] = { 0, 0, 1, 1, 1, 0, -1, -1, -1 }; |
210 |
--static int hatmap_y[9] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 }; |
211 |
- struct os_specific_s { |
212 |
- char fname [128 ]; |
213 |
- int fd; |
214 |
-@@ -98,178 +96,7 @@ struct os_specific_s { |
215 |
- # define UHIDDEV "/dev/uhid" |
216 |
- # define AJSDEV "/dev/joy" |
217 |
- |
218 |
--# ifdef HAVE_USB_JS |
219 |
--/* |
220 |
-- * fghJoystickFindUSBdev (and its helper, fghJoystickWalkUSBdev) try to locate |
221 |
-- * the full name of a USB device. If /dev/usbN isn't readable, we punt and |
222 |
-- * return the uhidN device name. We warn the user of this situation once. |
223 |
-- */ |
224 |
--static char *fghJoystickWalkUSBdev(int f, char *dev, char *out, int outlen) |
225 |
--{ |
226 |
-- struct usb_device_info di; |
227 |
-- int i, a; |
228 |
-- char *cp; |
229 |
-- |
230 |
-- for (a = 1; a < USB_MAX_DEVICES; a++) { |
231 |
-- di.udi_addr = a; |
232 |
-- if (ioctl(f, USB_DEVICEINFO, &di) != 0) |
233 |
-- return NULL; |
234 |
-- for (i = 0; i < USB_MAX_DEVNAMES; i++) |
235 |
-- if (di.udi_devnames[i][0] && |
236 |
-- strcmp(di.udi_devnames[i], dev) == 0) { |
237 |
-- cp = calloc( 1, strlen(di.udi_vendor) + strlen(di.udi_product) + 2); |
238 |
-- strcpy(cp, di.udi_vendor); |
239 |
-- strcat(cp, " "); |
240 |
-- strcat(cp, di.udi_product); |
241 |
-- strncpy(out, cp, outlen - 1); |
242 |
-- out[outlen - 1] = 0; |
243 |
-- free( cp ); |
244 |
-- return out; |
245 |
-- } |
246 |
-- } |
247 |
-- return NULL; |
248 |
--} |
249 |
-- |
250 |
--static int fghJoystickFindUSBdev(char *name, char *out, int outlen) |
251 |
--{ |
252 |
-- int i, f; |
253 |
-- char buf[50]; |
254 |
-- char *cp; |
255 |
-- static int protection_warned = 0; |
256 |
-- |
257 |
-- for (i = 0; i < 16; i++) { |
258 |
-- snprintf(buf, sizeof(buf), "%s%d", USBDEV, i); |
259 |
-- f = open(buf, O_RDONLY); |
260 |
-- if (f >= 0) { |
261 |
-- cp = fghJoystickWalkUSBdev(f, name, out, outlen); |
262 |
-- close(f); |
263 |
-- if (cp) |
264 |
-- return 1; |
265 |
-- } |
266 |
-- else if (errno == EACCES) { |
267 |
-- if (!protection_warned) { |
268 |
-- fgWarning ( "Can't open %s for read!", buf ); |
269 |
-- protection_warned = 1; |
270 |
-- } |
271 |
-- } |
272 |
-- } |
273 |
-- return 0; |
274 |
--} |
275 |
- |
276 |
--static int fghJoystickInitializeHID(struct os_specific_s *os, |
277 |
-- int *num_axes, int *num_buttons) |
278 |
--{ |
279 |
-- int size, is_joystick; |
280 |
--# ifdef HAVE_USBHID_H |
281 |
-- int report_id = 0; |
282 |
--# endif |
283 |
-- struct hid_data *d; |
284 |
-- struct hid_item h; |
285 |
-- report_desc_t rd; |
286 |
-- |
287 |
-- if ( ( rd = hid_get_report_desc( os->fd ) ) == 0 ) |
288 |
-- { |
289 |
-- fgWarning ( "error: %s: %s", os->fname, strerror( errno ) ); |
290 |
-- return FALSE; |
291 |
-- } |
292 |
-- |
293 |
-- os->hids = NULL; |
294 |
-- |
295 |
--# ifdef HAVE_USBHID_H |
296 |
-- if( ioctl( os->fd, USB_GET_REPORT_ID, &report_id ) < 0) |
297 |
-- { |
298 |
-- /*** XXX {report_id} may not be the right variable? ***/ |
299 |
-- fgWarning ( "error: %s%d: %s", UHIDDEV, report_id, strerror( errno ) ); |
300 |
-- return FALSE; |
301 |
-- } |
302 |
-- |
303 |
-- size = hid_report_size( rd, hid_input, report_id ); |
304 |
--# else |
305 |
-- size = hid_report_size( rd, 0, hid_input ); |
306 |
--# endif |
307 |
-- os->hid_data_buf = calloc( 1, size ); |
308 |
-- os->hid_dlen = size; |
309 |
-- |
310 |
-- is_joystick = 0; |
311 |
--# ifdef HAVE_USBHID_H |
312 |
-- d = hid_start_parse( rd, 1 << hid_input, report_id ); |
313 |
--# else |
314 |
-- d = hid_start_parse( rd, 1 << hid_input ); |
315 |
--# endif |
316 |
-- while( hid_get_item( d, &h ) ) |
317 |
-- { |
318 |
-- int usage, page, interesting_hid; |
319 |
-- |
320 |
-- page = HID_PAGE( h.usage ); |
321 |
-- usage = HID_USAGE( h.usage ); |
322 |
-- |
323 |
-- /* This test is somewhat too simplistic, but this is how MicroSoft |
324 |
-- * does, so I guess it works for all joysticks/game pads. */ |
325 |
-- is_joystick = is_joystick || |
326 |
-- ( h.kind == hid_collection && |
327 |
-- page == HUP_GENERIC_DESKTOP && |
328 |
-- ( usage == HUG_JOYSTICK || usage == HUG_GAME_PAD ) ); |
329 |
-- |
330 |
-- if( h.kind != hid_input ) |
331 |
-- continue; |
332 |
-- |
333 |
-- if( !is_joystick ) |
334 |
-- continue; |
335 |
-- |
336 |
-- interesting_hid = TRUE; |
337 |
-- if( page == HUP_GENERIC_DESKTOP ) |
338 |
-- { |
339 |
-- switch( usage ) |
340 |
-- { |
341 |
-- case HUG_X: |
342 |
-- case HUG_RX: |
343 |
-- case HUG_Y: |
344 |
-- case HUG_RY: |
345 |
-- case HUG_Z: |
346 |
-- case HUG_RZ: |
347 |
-- case HUG_SLIDER: |
348 |
-- if( *num_axes < _JS_MAX_AXES ) |
349 |
-- { |
350 |
-- os->axes_usage[ *num_axes ] = usage; |
351 |
-- ( *num_axes )++; |
352 |
-- } |
353 |
-- break; |
354 |
-- case HUG_HAT_SWITCH: |
355 |
-- /* Allocate two axes for a hat */ |
356 |
-- if( *num_axes + 1 < _JS_MAX_AXES ) |
357 |
-- { |
358 |
-- os->axes_usage[ *num_axes ] = usage; |
359 |
-- (*num_axes)++; |
360 |
-- os->axes_usage[ *num_axes ] = usage; |
361 |
-- (*num_axes)++; |
362 |
-- } |
363 |
-- break; |
364 |
-- default: |
365 |
-- interesting_hid = FALSE; |
366 |
-- break; |
367 |
-- } |
368 |
-- } |
369 |
-- else if( page == HUP_BUTTON ) |
370 |
-- { |
371 |
-- interesting_hid = ( usage > 0 ) && |
372 |
-- ( usage <= _JS_MAX_BUTTONS ); |
373 |
-- |
374 |
-- if( interesting_hid && usage - 1 > *num_buttons ) |
375 |
-- *num_buttons = usage - 1; |
376 |
-- } |
377 |
-- |
378 |
-- if( interesting_hid ) |
379 |
-- { |
380 |
-- h.next = os->hids; |
381 |
-- os->hids = calloc( 1, sizeof ( struct hid_item ) ); |
382 |
-- *os->hids = h; |
383 |
-- } |
384 |
-- } |
385 |
-- hid_end_parse( d ); |
386 |
-- |
387 |
-- return os->hids != NULL; |
388 |
--} |
389 |
--# endif |
390 |
- #endif |
391 |
- |
392 |
- /* |
393 |
-diff --git a/src/x11/fg_joystick_x11.c b/src/x11/fg_joystick_x11.c |
394 |
-index 04bc373..30ad4b5 100644 |
395 |
---- a/src/x11/fg_joystick_x11.c |
396 |
-+++ b/src/x11/fg_joystick_x11.c |
397 |
-@@ -42,8 +42,188 @@ |
398 |
- #include <fcntl.h> |
399 |
- |
400 |
- |
401 |
-+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
402 |
-+ |
403 |
-+static int hatmap_x[9] = {0, 0, 1, 1, 1, 0, -1, -1, -1}; |
404 |
-+static int hatmap_y[9] = {0, 1, 1, 0, -1, -1, -1, 0, 1}; |
405 |
-+ |
406 |
-+# ifdef HAVE_USB_JS |
407 |
-+/* |
408 |
-+* fghJoystickFindUSBdev (and its helper, fghJoystickWalkUSBdev) try to locate |
409 |
-+* the full name of a USB device. If /dev/usbN isn't readable, we punt and |
410 |
-+* return the uhidN device name. We warn the user of this situation once. |
411 |
-+*/ |
412 |
-+static char *fghJoystickWalkUSBdev(int f, char *dev, char *out, int outlen) |
413 |
-+{ |
414 |
-+ struct usb_device_info di; |
415 |
-+ int i, a; |
416 |
-+ char *cp; |
417 |
-+ |
418 |
-+ for (a = 1; a < USB_MAX_DEVICES; a++) { |
419 |
-+ di.udi_addr = a; |
420 |
-+ if (ioctl(f, USB_DEVICEINFO, &di) != 0) |
421 |
-+ return NULL; |
422 |
-+ for (i = 0; i < USB_MAX_DEVNAMES; i++) |
423 |
-+ if (di.udi_devnames[i][0] && |
424 |
-+ strcmp(di.udi_devnames[i], dev) == 0) { |
425 |
-+ cp = calloc(1, strlen(di.udi_vendor) + strlen(di.udi_product) + 2); |
426 |
-+ strcpy(cp, di.udi_vendor); |
427 |
-+ strcat(cp, " "); |
428 |
-+ strcat(cp, di.udi_product); |
429 |
-+ strncpy(out, cp, outlen - 1); |
430 |
-+ out[outlen - 1] = 0; |
431 |
-+ free(cp); |
432 |
-+ return out; |
433 |
-+ } |
434 |
-+ } |
435 |
-+ return NULL; |
436 |
-+} |
437 |
-+ |
438 |
-+static int fghJoystickFindUSBdev(char *name, char *out, int outlen) |
439 |
-+{ |
440 |
-+ int i, f; |
441 |
-+ char buf[50]; |
442 |
-+ char *cp; |
443 |
-+ static int protection_warned = 0; |
444 |
-+ |
445 |
-+ for (i = 0; i < 16; i++) { |
446 |
-+ snprintf(buf, sizeof(buf), "%s%d", USBDEV, i); |
447 |
-+ f = open(buf, O_RDONLY); |
448 |
-+ if (f >= 0) { |
449 |
-+ cp = fghJoystickWalkUSBdev(f, name, out, outlen); |
450 |
-+ close(f); |
451 |
-+ if (cp) |
452 |
-+ return 1; |
453 |
-+ } |
454 |
-+ else if (errno == EACCES) { |
455 |
-+ if (!protection_warned) { |
456 |
-+ fgWarning("Can't open %s for read!", buf); |
457 |
-+ protection_warned = 1; |
458 |
-+ } |
459 |
-+ } |
460 |
-+ } |
461 |
-+ return 0; |
462 |
-+} |
463 |
-+ |
464 |
-+static int fghJoystickInitializeHID(struct os_specific_s *os, |
465 |
-+ int *num_axes, int *num_buttons) |
466 |
-+{ |
467 |
-+ int size, is_joystick; |
468 |
-+# ifdef HAVE_USBHID_H |
469 |
-+ int report_id = 0; |
470 |
-+# endif |
471 |
-+ struct hid_data *d; |
472 |
-+ struct hid_item h; |
473 |
-+ report_desc_t rd; |
474 |
-+ |
475 |
-+ if ((rd = hid_get_report_desc(os->fd)) == 0) |
476 |
-+ { |
477 |
-+ fgWarning("error: %s: %s", os->fname, strerror(errno)); |
478 |
-+ return FALSE; |
479 |
-+ } |
480 |
-+ |
481 |
-+ os->hids = NULL; |
482 |
-+ |
483 |
-+# ifdef HAVE_USBHID_H |
484 |
-+ if (ioctl(os->fd, USB_GET_REPORT_ID, &report_id) < 0) |
485 |
-+ { |
486 |
-+ /*** XXX {report_id} may not be the right variable? ***/ |
487 |
-+ fgWarning("error: %s%d: %s", UHIDDEV, report_id, strerror(errno)); |
488 |
-+ return FALSE; |
489 |
-+ } |
490 |
-+ |
491 |
-+ size = hid_report_size(rd, hid_input, report_id); |
492 |
-+# else |
493 |
-+ size = hid_report_size(rd, 0, hid_input); |
494 |
-+# endif |
495 |
-+ os->hid_data_buf = calloc(1, size); |
496 |
-+ os->hid_dlen = size; |
497 |
-+ |
498 |
-+ is_joystick = 0; |
499 |
-+# ifdef HAVE_USBHID_H |
500 |
-+ d = hid_start_parse(rd, 1 << hid_input, report_id); |
501 |
-+# else |
502 |
-+ d = hid_start_parse(rd, 1 << hid_input); |
503 |
-+# endif |
504 |
-+ while (hid_get_item(d, &h)) |
505 |
-+ { |
506 |
-+ int usage, page, interesting_hid; |
507 |
-+ |
508 |
-+ page = HID_PAGE(h.usage); |
509 |
-+ usage = HID_USAGE(h.usage); |
510 |
-+ |
511 |
-+ /* This test is somewhat too simplistic, but this is how MicroSoft |
512 |
-+ * does, so I guess it works for all joysticks/game pads. */ |
513 |
-+ is_joystick = is_joystick || |
514 |
-+ (h.kind == hid_collection && |
515 |
-+ page == HUP_GENERIC_DESKTOP && |
516 |
-+ (usage == HUG_JOYSTICK || usage == HUG_GAME_PAD)); |
517 |
-+ |
518 |
-+ if (h.kind != hid_input) |
519 |
-+ continue; |
520 |
-+ |
521 |
-+ if (!is_joystick) |
522 |
-+ continue; |
523 |
-+ |
524 |
-+ interesting_hid = TRUE; |
525 |
-+ if (page == HUP_GENERIC_DESKTOP) |
526 |
-+ { |
527 |
-+ switch (usage) |
528 |
-+ { |
529 |
-+ case HUG_X: |
530 |
-+ case HUG_RX: |
531 |
-+ case HUG_Y: |
532 |
-+ case HUG_RY: |
533 |
-+ case HUG_Z: |
534 |
-+ case HUG_RZ: |
535 |
-+ case HUG_SLIDER: |
536 |
-+ if (*num_axes < _JS_MAX_AXES) |
537 |
-+ { |
538 |
-+ os->axes_usage[*num_axes] = usage; |
539 |
-+ (*num_axes)++; |
540 |
-+ } |
541 |
-+ break; |
542 |
-+ case HUG_HAT_SWITCH: |
543 |
-+ /* Allocate two axes for a hat */ |
544 |
-+ if (*num_axes + 1 < _JS_MAX_AXES) |
545 |
-+ { |
546 |
-+ os->axes_usage[*num_axes] = usage; |
547 |
-+ (*num_axes)++; |
548 |
-+ os->axes_usage[*num_axes] = usage; |
549 |
-+ (*num_axes)++; |
550 |
-+ } |
551 |
-+ break; |
552 |
-+ default: |
553 |
-+ interesting_hid = FALSE; |
554 |
-+ break; |
555 |
-+ } |
556 |
-+ } |
557 |
-+ else if (page == HUP_BUTTON) |
558 |
-+ { |
559 |
-+ interesting_hid = (usage > 0) && |
560 |
-+ (usage <= _JS_MAX_BUTTONS); |
561 |
-+ |
562 |
-+ if (interesting_hid && usage - 1 > *num_buttons) |
563 |
-+ *num_buttons = usage - 1; |
564 |
-+ } |
565 |
-+ |
566 |
-+ if (interesting_hid) |
567 |
-+ { |
568 |
-+ h.next = os->hids; |
569 |
-+ os->hids = calloc(1, sizeof(struct hid_item)); |
570 |
-+ *os->hids = h; |
571 |
-+ } |
572 |
-+ } |
573 |
-+ hid_end_parse(d); |
574 |
-+ |
575 |
-+ return os->hids != NULL; |
576 |
-+} |
577 |
-+# endif |
578 |
-+#endif |
579 |
-+ |
580 |
-+ |
581 |
- /*this should be defined in a header file */ |
582 |
--#define MAX_NUM_JOYSTICKS 2 |
583 |
-+#define MAX_NUM_JOYSTICKS 2 |
584 |
- extern SFG_Joystick *fgJoystick [ MAX_NUM_JOYSTICKS ]; |
585 |
- |
586 |
- void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) |
587 |
-@@ -216,15 +396,15 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) |
588 |
- void fgPlatformJoystickOpen( SFG_Joystick* joy ) |
589 |
- { |
590 |
- #if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) |
591 |
-- int i = 0; |
592 |
-+ int i = 0; |
593 |
- char *cp; |
594 |
- #endif |
595 |
- #ifdef JS_NEW |
596 |
- unsigned char u; |
597 |
-- int i=0; |
598 |
-+ int i=0; |
599 |
- #else |
600 |
- # if defined( __linux__ ) || TARGET_HOST_SOLARIS |
601 |
-- int i = 0; |
602 |
-+ int i = 0; |
603 |
- int counter = 0; |
604 |
- # endif |
605 |
- #endif |
606 |
-@@ -448,7 +628,7 @@ void fgPlatformJoystickClose ( int ident ) |
607 |
- free( fgJoystick[ ident ]->pJoystick.os->hid_data_buf ); |
608 |
- #endif |
609 |
- free( fgJoystick[ident]->pJoystick.os ); |
610 |
-- } |
611 |
-+ } |
612 |
- #endif |
613 |
- |
614 |
- if( ! fgJoystick[ident]->error ) |
615 |
--- |
616 |
-2.19.2 |
617 |
- |
618 |
-From f310b56bb6f93e255cf880c8970c794e0f2efc8d Mon Sep 17 00:00:00 2001 |
619 |
-From: dcnieho <dcnieho@7f0cb862-5218-0410-a997-914c9d46530a> |
620 |
-Date: Mon, 31 Jul 2017 20:49:26 +0000 |
621 |
-Subject: [PATCH] Fix build on NetBSD. |
622 |
- |
623 |
-(cherry picked from commit 1236c7644508227b616e97e29e123b34257e36d1) |
624 |
- |
625 |
-git-svn-id: http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1835 7f0cb862-5218-0410-a997-914c9d46530a |
626 |
---- |
627 |
- src/fg_joystick.c | 59 ------------------------------------- |
628 |
- src/x11/fg_joystick_x11.c | 61 +++++++++++++++++++++++++++++++++++++++ |
629 |
- 2 files changed, 61 insertions(+), 59 deletions(-) |
630 |
- |
631 |
-diff --git a/src/fg_joystick.c b/src/fg_joystick.c |
632 |
-index e548c04..b24476a 100644 |
633 |
---- a/src/fg_joystick.c |
634 |
-+++ b/src/fg_joystick.c |
635 |
-@@ -40,65 +40,6 @@ |
636 |
- #define JS_TRUE 1 |
637 |
- #define JS_FALSE 0 |
638 |
- |
639 |
--/* BSD defines from "jsBSD.cxx" around lines 42-270 */ |
640 |
-- |
641 |
--#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
642 |
-- |
643 |
--# ifdef HAVE_USB_JS |
644 |
--# if defined(__NetBSD__) |
645 |
--# ifdef HAVE_USBHID_H |
646 |
--# include <usbhid.h> |
647 |
--# else |
648 |
--# include <usb.h> |
649 |
--# endif |
650 |
--# include <dev/usb/usb.h> |
651 |
--# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
652 |
--# ifdef HAVE_USBHID_H |
653 |
--# include <usbhid.h> |
654 |
--# else |
655 |
--# include <libusbhid.h> |
656 |
--# endif |
657 |
--# include <legacy/dev/usb/usb.h> |
658 |
--# endif |
659 |
--# include <dev/usb/usbhid.h> |
660 |
-- |
661 |
--/* Compatibility with older usb.h revisions */ |
662 |
--# if !defined(USB_MAX_DEVNAMES) && defined(MAXDEVNAMES) |
663 |
--# define USB_MAX_DEVNAMES MAXDEVNAMES |
664 |
--# endif |
665 |
--# endif |
666 |
-- |
667 |
--struct os_specific_s { |
668 |
-- char fname [128 ]; |
669 |
-- int fd; |
670 |
-- int is_analog; |
671 |
-- /* The following structure members are specific to analog joysticks */ |
672 |
-- struct joystick ajs; |
673 |
--# ifdef HAVE_USB_JS |
674 |
-- /* The following structure members are specific to USB joysticks */ |
675 |
-- struct hid_item *hids; |
676 |
-- int hid_dlen; |
677 |
-- int hid_offset; |
678 |
-- char *hid_data_buf; |
679 |
-- int axes_usage [ _JS_MAX_AXES ]; |
680 |
--# endif |
681 |
-- /* We keep button and axes state ourselves, as they might not be updated |
682 |
-- * on every read of a USB device |
683 |
-- */ |
684 |
-- int cache_buttons; |
685 |
-- float cache_axes [ _JS_MAX_AXES ]; |
686 |
--}; |
687 |
-- |
688 |
--/* Idents lower than USB_IDENT_OFFSET are for analog joysticks. */ |
689 |
--# define USB_IDENT_OFFSET 2 |
690 |
-- |
691 |
--# define USBDEV "/dev/usb" |
692 |
--# define UHIDDEV "/dev/uhid" |
693 |
--# define AJSDEV "/dev/joy" |
694 |
-- |
695 |
-- |
696 |
--#endif |
697 |
-- |
698 |
- /* |
699 |
- * Functions associated with the "jsJoystick" class in PLIB |
700 |
- */ |
701 |
-diff --git a/src/x11/fg_joystick_x11.c b/src/x11/fg_joystick_x11.c |
702 |
-index 30ad4b5..8c75bbe 100644 |
703 |
---- a/src/x11/fg_joystick_x11.c |
704 |
-+++ b/src/x11/fg_joystick_x11.c |
705 |
-@@ -42,8 +42,68 @@ |
706 |
- #include <fcntl.h> |
707 |
- |
708 |
- |
709 |
-+/* BSD defines from "jsBSD.cxx" around lines 42-270 */ |
710 |
-+ |
711 |
-+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
712 |
-+ |
713 |
-+# ifdef HAVE_USB_JS |
714 |
-+# if defined(__NetBSD__) |
715 |
-+# ifdef HAVE_USBHID_H |
716 |
-+# include <usbhid.h> |
717 |
-+# else |
718 |
-+# include <usb.h> |
719 |
-+# endif |
720 |
-+# include <dev/usb/usb.h> |
721 |
-+# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
722 |
-+# ifdef HAVE_USBHID_H |
723 |
-+# include <usbhid.h> |
724 |
-+# else |
725 |
-+# include <libusbhid.h> |
726 |
-+# endif |
727 |
-+# include <legacy/dev/usb/usb.h> |
728 |
-+# endif |
729 |
-+# include <dev/usb/usbhid.h> |
730 |
-+ |
731 |
-+/* Compatibility with older usb.h revisions */ |
732 |
-+# if !defined(USB_MAX_DEVNAMES) && defined(MAXDEVNAMES) |
733 |
-+# define USB_MAX_DEVNAMES MAXDEVNAMES |
734 |
-+# endif |
735 |
-+# endif |
736 |
-+ |
737 |
-+struct os_specific_s { |
738 |
-+ char fname [128 ]; |
739 |
-+ int fd; |
740 |
-+ int is_analog; |
741 |
-+ /* The following structure members are specific to analog joysticks */ |
742 |
-+ struct joystick ajs; |
743 |
-+# ifdef HAVE_USB_JS |
744 |
-+ /* The following structure members are specific to USB joysticks */ |
745 |
-+ struct hid_item *hids; |
746 |
-+ int hid_dlen; |
747 |
-+ int hid_offset; |
748 |
-+ char *hid_data_buf; |
749 |
-+ int axes_usage [ _JS_MAX_AXES ]; |
750 |
-+# endif |
751 |
-+ /* We keep button and axes state ourselves, as they might not be updated |
752 |
-+ * on every read of a USB device |
753 |
-+ */ |
754 |
-+ int cache_buttons; |
755 |
-+ float cache_axes [ _JS_MAX_AXES ]; |
756 |
-+}; |
757 |
-+ |
758 |
-+/* Idents lower than USB_IDENT_OFFSET are for analog joysticks. */ |
759 |
-+# define USB_IDENT_OFFSET 2 |
760 |
-+ |
761 |
-+# define USBDEV "/dev/usb" |
762 |
-+# define UHIDDEV "/dev/uhid" |
763 |
-+# define AJSDEV "/dev/joy" |
764 |
-+ |
765 |
-+ |
766 |
-+#endif |
767 |
-+ |
768 |
- #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
769 |
- |
770 |
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
771 |
- static int hatmap_x[9] = {0, 0, 1, 1, 1, 0, -1, -1, -1}; |
772 |
- static int hatmap_y[9] = {0, 1, 1, 0, -1, -1, -1, 0, 1}; |
773 |
- |
774 |
-@@ -104,6 +164,7 @@ static int fghJoystickFindUSBdev(char *name, char *out, int outlen) |
775 |
- } |
776 |
- return 0; |
777 |
- } |
778 |
-+#endif |
779 |
- |
780 |
- static int fghJoystickInitializeHID(struct os_specific_s *os, |
781 |
- int *num_axes, int *num_buttons) |
782 |
--- |
783 |
-2.19.2 |
784 |
- |
785 |
|
786 |
diff --git a/media-libs/freeglut/files/freeglut-3.0.0-drop-unnecessary-x11-libs.patch b/media-libs/freeglut/files/freeglut-3.0.0-drop-unnecessary-x11-libs.patch |
787 |
deleted file mode 100644 |
788 |
index 761a6bfce7c..00000000000 |
789 |
--- a/media-libs/freeglut/files/freeglut-3.0.0-drop-unnecessary-x11-libs.patch |
790 |
+++ /dev/null |
791 |
@@ -1,30 +0,0 @@ |
792 |
-From bbdaa724ef363e34bd19fb2308739e59a9e8ddc8 Mon Sep 17 00:00:00 2001 |
793 |
-From: jtsiomb <jtsiomb@7f0cb862-5218-0410-a997-914c9d46530a> |
794 |
-Date: Tue, 26 Mar 2019 18:55:42 +0000 |
795 |
-Subject: [PATCH] Applied Christian's change to drop unnecessary dependency to |
796 |
- X11 libraries we don't actually use, by asking cmake to link with X11_X11_LIB |
797 |
- instead of the catch-all X11_LIBRARIES. |
798 |
- |
799 |
-git-svn-id: http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1845 7f0cb862-5218-0410-a997-914c9d46530a |
800 |
---- |
801 |
- CMakeLists.txt | 4 ++-- |
802 |
- 1 file changed, 2 insertions(+), 2 deletions(-) |
803 |
- |
804 |
-diff --git a/CMakeLists.txt b/CMakeLists.txt |
805 |
-index d1c20e8..e324a02 100644 |
806 |
---- a/CMakeLists.txt |
807 |
-+++ b/CMakeLists.txt |
808 |
-@@ -312,8 +312,8 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) |
809 |
- INCLUDE(CheckIncludeFiles) |
810 |
- IF(UNIX AND NOT(ANDROID OR BLACKBERRY OR FREEGLUT_WAYLAND)) |
811 |
- FIND_PACKAGE(X11 REQUIRED) |
812 |
-- INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR}) |
813 |
-- LIST(APPEND LIBS ${X11_LIBRARIES}) |
814 |
-+ INCLUDE_DIRECTORIES(${X11_X11_INCLUDE_PATH}) |
815 |
-+ LIST(APPEND LIBS ${X11_X11_LIB}) |
816 |
- IF(X11_Xrandr_FOUND) |
817 |
- SET(HAVE_X11_EXTENSIONS_XRANDR_H TRUE) |
818 |
- LIST(APPEND LIBS ${X11_Xrandr_LIB}) |
819 |
--- |
820 |
-2.19.2 |
821 |
- |
822 |
|
823 |
diff --git a/media-libs/freeglut/freeglut-3.0.0.ebuild b/media-libs/freeglut/freeglut-3.0.0.ebuild |
824 |
deleted file mode 100644 |
825 |
index 1ac3aea844d..00000000000 |
826 |
--- a/media-libs/freeglut/freeglut-3.0.0.ebuild |
827 |
+++ /dev/null |
828 |
@@ -1,44 +0,0 @@ |
829 |
-# Copyright 1999-2019 Gentoo Authors |
830 |
-# Distributed under the terms of the GNU General Public License v2 |
831 |
- |
832 |
-EAPI=6 |
833 |
- |
834 |
-inherit cmake-multilib |
835 |
- |
836 |
-DESCRIPTION="Completely OpenSourced alternative to the OpenGL Utility Toolkit (GLUT) library" |
837 |
-HOMEPAGE="http://freeglut.sourceforge.net/" |
838 |
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
839 |
- |
840 |
-LICENSE="MIT" |
841 |
-SLOT="0" |
842 |
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" |
843 |
-IUSE="debug static-libs" |
844 |
- |
845 |
-# enabling GLES support seems to cause build failures |
846 |
-RDEPEND=">=virtual/glu-9.0-r1[${MULTILIB_USEDEP}] |
847 |
- >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] |
848 |
- >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}] |
849 |
- >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}] |
850 |
- >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}] |
851 |
- >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}] |
852 |
- >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]" |
853 |
-# gles? ( media-libs/mesa[gles1,${MULTILIB_USEDEP}] ) |
854 |
-DEPEND="${RDEPEND} |
855 |
- virtual/pkgconfig |
856 |
- x11-base/xorg-proto" |
857 |
- |
858 |
-HTML_DOCS=( doc/. ) |
859 |
- |
860 |
-PATCHES=( |
861 |
- "${FILESDIR}"/${P}-drop-unnecessary-x11-libs.patch |
862 |
- "${FILESDIR}"/${P}-bsd-usb-joystick.patch |
863 |
-) |
864 |
- |
865 |
-src_configure() { |
866 |
- local mycmakeargs=( |
867 |
- "-DFREEGLUT_GLES=OFF" |
868 |
- "-DFREEGLUT_BUILD_STATIC_LIBS=$(usex static-libs ON OFF)" |
869 |
- ) |
870 |
-# $(cmake-utils_use gles FREEGLUT_GLES) |
871 |
- cmake-multilib_src_configure |
872 |
-} |