1 |
commit: e3eae680d120f76bc3ee6c27618daa0b54cae3f9 |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 2 15:34:57 2016 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 2 15:35:12 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3eae680 |
7 |
|
8 |
games-util/xboxdrv: Remove old 0.8.5-r2 |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
.../files/xboxdrv-0.8.4-libusbx-1.0.13-fix.patch | 340 --------------------- |
13 |
games-util/xboxdrv/xboxdrv-0.8.5-r2.ebuild | 63 ---- |
14 |
2 files changed, 403 deletions(-) |
15 |
|
16 |
diff --git a/games-util/xboxdrv/files/xboxdrv-0.8.4-libusbx-1.0.13-fix.patch b/games-util/xboxdrv/files/xboxdrv-0.8.4-libusbx-1.0.13-fix.patch |
17 |
deleted file mode 100644 |
18 |
index 5b8d2f4..0000000 |
19 |
--- a/games-util/xboxdrv/files/xboxdrv-0.8.4-libusbx-1.0.13-fix.patch |
20 |
+++ /dev/null |
21 |
@@ -1,340 +0,0 @@ |
22 |
-commit 27cdd9c6a994f3059b8ae683adb711169341ffa5 |
23 |
-Author: Ingo Ruhnke <grumbel@×××××.com> |
24 |
-Date: Wed Dec 19 11:39:31 2012 +0100 |
25 |
- |
26 |
- Added additional bookkeeping to USBController to allow clean shutdowns with libusbx |
27 |
- |
28 |
- Fixes #28 |
29 |
- |
30 |
---- a/src/firestorm_dual_controller.cpp |
31 |
-+++ b/src/firestorm_dual_controller.cpp |
32 |
-@@ -99,8 +99,6 @@ FirestormDualController::FirestormDualController(libusb_device* dev, bool is_vsb |
33 |
- |
34 |
- FirestormDualController::~FirestormDualController() |
35 |
- { |
36 |
-- usb_cancel_read(); |
37 |
-- usb_release_interface(0); |
38 |
- } |
39 |
- |
40 |
- void |
41 |
---- a/src/generic_usb_controller.cpp |
42 |
-+++ b/src/generic_usb_controller.cpp |
43 |
-@@ -62,8 +62,6 @@ GenericUSBController::GenericUSBController(libusb_device* dev, |
44 |
- |
45 |
- GenericUSBController::~GenericUSBController() |
46 |
- { |
47 |
-- usb_cancel_read(); |
48 |
-- usb_release_interface(m_interface); |
49 |
- } |
50 |
- |
51 |
- void |
52 |
---- a/src/playstation3_usb_controller.cpp |
53 |
-+++ b/src/playstation3_usb_controller.cpp |
54 |
-@@ -37,8 +37,6 @@ Playstation3USBController::Playstation3USBController(libusb_device* dev, bool tr |
55 |
- |
56 |
- Playstation3USBController::~Playstation3USBController() |
57 |
- { |
58 |
-- usb_cancel_read(); |
59 |
-- usb_release_interface(0); |
60 |
- } |
61 |
- |
62 |
- #define HID_GET_REPORT 0x01 |
63 |
---- a/src/saitek_p2500_controller.cpp |
64 |
-+++ b/src/saitek_p2500_controller.cpp |
65 |
-@@ -66,8 +66,6 @@ SaitekP2500Controller::SaitekP2500Controller(libusb_device* dev, bool try_detach |
66 |
- |
67 |
- SaitekP2500Controller::~SaitekP2500Controller() |
68 |
- { |
69 |
-- usb_cancel_read(); |
70 |
-- usb_release_interface(0); |
71 |
- } |
72 |
- |
73 |
- void |
74 |
---- a/src/usb_controller.cpp |
75 |
-+++ b/src/usb_controller.cpp |
76 |
-@@ -28,7 +28,8 @@ |
77 |
- USBController::USBController(libusb_device* dev) : |
78 |
- m_dev(dev), |
79 |
- m_handle(0), |
80 |
-- m_read_transfer(), |
81 |
-+ m_transfers(), |
82 |
-+ m_interfaces(), |
83 |
- m_usbpath(), |
84 |
- m_usbid(), |
85 |
- m_name() |
86 |
-@@ -78,7 +79,29 @@ USBController::USBController(libusb_device* dev) : |
87 |
- |
88 |
- USBController::~USBController() |
89 |
- { |
90 |
-- //log_tmp("~USBController"); |
91 |
-+ // cancel all transfers |
92 |
-+ for(std::set<libusb_transfer*>::iterator it = m_transfers.begin(); it != m_transfers.end(); ++it) |
93 |
-+ { |
94 |
-+ libusb_cancel_transfer(*it); |
95 |
-+ } |
96 |
-+ |
97 |
-+ // wait for cancel to succeed |
98 |
-+ while (!m_transfers.empty()) |
99 |
-+ { |
100 |
-+ int ret = libusb_handle_events(NULL); |
101 |
-+ if (ret != 0) |
102 |
-+ { |
103 |
-+ log_error("libusb_handle_events() failure: " << ret); |
104 |
-+ } |
105 |
-+ } |
106 |
-+ |
107 |
-+ // release all claimed interfaces |
108 |
-+ for(std::set<int>::iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it) |
109 |
-+ { |
110 |
-+ libusb_release_interface(m_handle, *it); |
111 |
-+ } |
112 |
-+ |
113 |
-+ // read and write transfers might still be going on and might need to be canceled |
114 |
- libusb_close(m_handle); |
115 |
- } |
116 |
- |
117 |
-@@ -103,23 +126,26 @@ USBController::get_name() const |
118 |
- void |
119 |
- USBController::usb_submit_read(int endpoint, int len) |
120 |
- { |
121 |
-- assert(!m_read_transfer); |
122 |
-- |
123 |
-- m_read_transfer = libusb_alloc_transfer(0); |
124 |
-+ libusb_transfer* transfer = libusb_alloc_transfer(0); |
125 |
- |
126 |
- uint8_t* data = static_cast<uint8_t*>(malloc(sizeof(uint8_t) * len)); |
127 |
-- m_read_transfer->flags |= LIBUSB_TRANSFER_FREE_BUFFER; |
128 |
-- libusb_fill_interrupt_transfer(m_read_transfer, m_handle, |
129 |
-+ transfer->flags |= LIBUSB_TRANSFER_FREE_BUFFER; |
130 |
-+ libusb_fill_interrupt_transfer(transfer, m_handle, |
131 |
- endpoint | LIBUSB_ENDPOINT_IN, |
132 |
- data, len, |
133 |
- &USBController::on_read_data_wrap, this, |
134 |
- 0); // timeout |
135 |
- int ret; |
136 |
-- ret = libusb_submit_transfer(m_read_transfer); |
137 |
-+ ret = libusb_submit_transfer(transfer); |
138 |
- if (ret != LIBUSB_SUCCESS) |
139 |
- { |
140 |
-+ libusb_free_transfer(transfer); |
141 |
- raise_exception(std::runtime_error, "libusb_submit_transfer(): " << usb_strerror(ret)); |
142 |
- } |
143 |
-+ else |
144 |
-+ { |
145 |
-+ m_transfers.insert(transfer); |
146 |
-+ } |
147 |
- } |
148 |
- |
149 |
- void |
150 |
-@@ -127,7 +153,6 @@ USBController::usb_write(int endpoint, uint8_t* data_in, int len) |
151 |
- { |
152 |
- libusb_transfer* transfer = libusb_alloc_transfer(0); |
153 |
- transfer->flags |= LIBUSB_TRANSFER_FREE_BUFFER; |
154 |
-- transfer->flags |= LIBUSB_TRANSFER_FREE_TRANSFER; |
155 |
- |
156 |
- // copy data into a newly allocated buffer |
157 |
- uint8_t* data = static_cast<uint8_t*>(malloc(sizeof(uint8_t) * len)); |
158 |
-@@ -143,8 +168,13 @@ USBController::usb_write(int endpoint, uint8_t* data_in, int len) |
159 |
- ret = libusb_submit_transfer(transfer); |
160 |
- if (ret != LIBUSB_SUCCESS) |
161 |
- { |
162 |
-+ libusb_free_transfer(transfer); |
163 |
- raise_exception(std::runtime_error, "libusb_submit_transfer(): " << usb_strerror(ret)); |
164 |
- } |
165 |
-+ else |
166 |
-+ { |
167 |
-+ m_transfers.insert(transfer); |
168 |
-+ } |
169 |
- } |
170 |
- |
171 |
- void |
172 |
-@@ -154,7 +184,6 @@ USBController::usb_control(uint8_t bmRequestType, uint8_t bRequest, |
173 |
- { |
174 |
- libusb_transfer* transfer = libusb_alloc_transfer(0); |
175 |
- transfer->flags |= LIBUSB_TRANSFER_FREE_BUFFER; |
176 |
-- transfer->flags |= LIBUSB_TRANSFER_FREE_TRANSFER; |
177 |
- |
178 |
- // create and fill control buffer |
179 |
- uint8_t* data = static_cast<uint8_t*>(malloc(wLength + 8)); |
180 |
-@@ -168,14 +197,22 @@ USBController::usb_control(uint8_t bmRequestType, uint8_t bRequest, |
181 |
- ret = libusb_submit_transfer(transfer); |
182 |
- if (ret != LIBUSB_SUCCESS) |
183 |
- { |
184 |
-+ libusb_free_transfer(transfer); |
185 |
- raise_exception(std::runtime_error, "libusb_submit_transfer(): " << usb_strerror(ret)); |
186 |
- } |
187 |
-+ else |
188 |
-+ { |
189 |
-+ m_transfers.insert(transfer); |
190 |
-+ } |
191 |
- } |
192 |
- |
193 |
- void |
194 |
- USBController::on_control(libusb_transfer* transfer) |
195 |
- { |
196 |
- log_debug("control transfer"); |
197 |
-+ |
198 |
-+ m_transfers.erase(transfer); |
199 |
-+ libusb_free_transfer(transfer); |
200 |
- } |
201 |
- |
202 |
- void |
203 |
-@@ -183,19 +220,12 @@ USBController::on_write_data(libusb_transfer* transfer) |
204 |
- { |
205 |
- if (transfer->status != LIBUSB_TRANSFER_COMPLETED) |
206 |
- { |
207 |
-- log_error("USB write failure: " << transfer->length << ": " << usb_transfer_strerror(transfer->status)); |
208 |
-+ if (transfer->status != LIBUSB_TRANSFER_CANCELLED) |
209 |
-+ log_error("USB write failure: " << transfer->length << ": " << usb_transfer_strerror(transfer->status)); |
210 |
- } |
211 |
--} |
212 |
- |
213 |
--void |
214 |
--USBController::usb_cancel_read() |
215 |
--{ |
216 |
-- if (m_read_transfer) |
217 |
-- { |
218 |
-- libusb_cancel_transfer(m_read_transfer); |
219 |
-- libusb_free_transfer(m_read_transfer); |
220 |
-- m_read_transfer = 0; |
221 |
-- } |
222 |
-+ m_transfers.erase(transfer); |
223 |
-+ libusb_free_transfer(transfer); |
224 |
- } |
225 |
- |
226 |
- void |
227 |
-@@ -203,31 +233,30 @@ USBController::on_read_data(libusb_transfer* transfer) |
228 |
- { |
229 |
- assert(transfer); |
230 |
- |
231 |
-- // FIXME: check for LIBUSB_TRANSFER_COMPLETED |
232 |
-- |
233 |
-- // process data |
234 |
-- XboxGenericMsg msg; |
235 |
-- if (parse(transfer->buffer, transfer->actual_length, &msg)) |
236 |
-+ if (transfer->status != LIBUSB_TRANSFER_COMPLETED) |
237 |
- { |
238 |
-- submit_msg(msg); |
239 |
-- } |
240 |
-+ if (transfer->status != LIBUSB_TRANSFER_CANCELLED) |
241 |
-+ log_error("USB read failure: " << transfer->length << ": " << usb_transfer_strerror(transfer->status)); |
242 |
- |
243 |
-- if (false) // cleanup |
244 |
-- { |
245 |
-+ m_transfers.erase(transfer); |
246 |
- libusb_free_transfer(transfer); |
247 |
- } |
248 |
-- else // resubmit |
249 |
-- { |
250 |
-+ else |
251 |
-+ { |
252 |
-+ // process data |
253 |
-+ XboxGenericMsg msg; |
254 |
-+ if (parse(transfer->buffer, transfer->actual_length, &msg)) |
255 |
-+ { |
256 |
-+ submit_msg(msg); |
257 |
-+ } |
258 |
-+ |
259 |
- int ret; |
260 |
- ret = libusb_submit_transfer(transfer); |
261 |
- if (ret != LIBUSB_SUCCESS) // could also check for LIBUSB_ERROR_NO_DEVICE |
262 |
- { |
263 |
- log_error("failed to resubmit USB transfer: " << usb_strerror(ret)); |
264 |
- |
265 |
-- assert(m_read_transfer == transfer); |
266 |
-- |
267 |
- libusb_free_transfer(transfer); |
268 |
-- m_read_transfer = 0; |
269 |
- |
270 |
- send_disconnect(); |
271 |
- } |
272 |
-@@ -237,6 +266,11 @@ USBController::on_read_data(libusb_transfer* transfer) |
273 |
- void |
274 |
- USBController::usb_claim_interface(int ifnum, bool try_detach) |
275 |
- { |
276 |
-+ // keep track of all claimed interfaces so they can be released in |
277 |
-+ // the destructor |
278 |
-+ assert(m_interfaces.find(ifnum) == m_interfaces.end()); |
279 |
-+ m_interfaces.insert(ifnum); |
280 |
-+ |
281 |
- int err = usb_claim_n_detach_interface(m_handle, ifnum, try_detach); |
282 |
- if (err != 0) |
283 |
- { |
284 |
-@@ -247,13 +281,6 @@ USBController::usb_claim_interface(int ifnum, bool try_detach) |
285 |
- } |
286 |
- } |
287 |
- |
288 |
--void |
289 |
--USBController::usb_release_interface(int ifnum) |
290 |
--{ |
291 |
-- // should be called before closing the device handle |
292 |
-- libusb_release_interface(m_handle, ifnum); |
293 |
--} |
294 |
-- |
295 |
- int |
296 |
- USBController::usb_find_ep(int direction, uint8_t if_class, uint8_t if_subclass, uint8_t if_protocol) |
297 |
- { |
298 |
---- a/src/usb_controller.hpp |
299 |
-+++ b/src/usb_controller.hpp |
300 |
-@@ -22,6 +22,7 @@ |
301 |
- #include <libusb.h> |
302 |
- #include <string> |
303 |
- #include <memory> |
304 |
-+#include <set> |
305 |
- |
306 |
- #include "controller.hpp" |
307 |
- |
308 |
-@@ -31,7 +32,8 @@ protected: |
309 |
- libusb_device* m_dev; |
310 |
- libusb_device_handle* m_handle; |
311 |
- |
312 |
-- libusb_transfer* m_read_transfer; |
313 |
-+ std::set<libusb_transfer*> m_transfers; |
314 |
-+ std::set<int> m_interfaces; |
315 |
- |
316 |
- std::string m_usbpath; |
317 |
- std::string m_usbid; |
318 |
-@@ -50,10 +52,8 @@ public: |
319 |
- int usb_find_ep(int direction, uint8_t if_class, uint8_t if_subclass, uint8_t if_protocol); |
320 |
- |
321 |
- void usb_claim_interface(int ifnum, bool try_detach); |
322 |
-- void usb_release_interface(int ifnum); |
323 |
- |
324 |
- void usb_submit_read(int endpoint, int len); |
325 |
-- void usb_cancel_read(); |
326 |
- |
327 |
- void usb_write(int endpoint, uint8_t* data, int len); |
328 |
- void usb_control(uint8_t bmRequestType, uint8_t bRequest, |
329 |
---- a/src/xbox360_controller.cpp |
330 |
-+++ b/src/xbox360_controller.cpp |
331 |
-@@ -86,8 +86,6 @@ Xbox360Controller::Xbox360Controller(libusb_device* dev, |
332 |
- |
333 |
- Xbox360Controller::~Xbox360Controller() |
334 |
- { |
335 |
-- usb_cancel_read(); |
336 |
-- usb_release_interface(0); |
337 |
- } |
338 |
- |
339 |
- void |
340 |
---- a/src/xbox360_wireless_controller.cpp |
341 |
-+++ b/src/xbox360_wireless_controller.cpp |
342 |
-@@ -50,8 +50,6 @@ Xbox360WirelessController::Xbox360WirelessController(libusb_device* dev, int con |
343 |
- |
344 |
- Xbox360WirelessController::~Xbox360WirelessController() |
345 |
- { |
346 |
-- usb_cancel_read(); |
347 |
-- usb_release_interface(m_interface); |
348 |
- } |
349 |
- |
350 |
- void |
351 |
---- a/src/xbox_controller.cpp |
352 |
-+++ b/src/xbox_controller.cpp |
353 |
-@@ -41,8 +41,6 @@ XboxController::XboxController(libusb_device* dev, bool try_detach) : |
354 |
- |
355 |
- XboxController::~XboxController() |
356 |
- { |
357 |
-- usb_cancel_read(); |
358 |
-- usb_release_interface(0); |
359 |
- } |
360 |
- |
361 |
- void |
362 |
|
363 |
diff --git a/games-util/xboxdrv/xboxdrv-0.8.5-r2.ebuild b/games-util/xboxdrv/xboxdrv-0.8.5-r2.ebuild |
364 |
deleted file mode 100644 |
365 |
index f03ce60..0000000 |
366 |
--- a/games-util/xboxdrv/xboxdrv-0.8.5-r2.ebuild |
367 |
+++ /dev/null |
368 |
@@ -1,63 +0,0 @@ |
369 |
-# Copyright 1999-2015 Gentoo Foundation |
370 |
-# Distributed under the terms of the GNU General Public License v2 |
371 |
-# $Id$ |
372 |
- |
373 |
-EAPI=5 |
374 |
-inherit linux-info scons-utils toolchain-funcs systemd udev |
375 |
- |
376 |
-MY_P=${PN}-linux-${PV} |
377 |
-DESCRIPTION="Userspace Xbox 360 Controller driver" |
378 |
-HOMEPAGE="http://pingus.seul.org/~grumbel/xboxdrv/" |
379 |
-SRC_URI="http://pingus.seul.org/~grumbel/xboxdrv/${MY_P}.tar.bz2" |
380 |
- |
381 |
-LICENSE="GPL-3" |
382 |
-SLOT="0" |
383 |
-KEYWORDS="~amd64 ~x86" |
384 |
-IUSE="" |
385 |
- |
386 |
-RDEPEND="dev-libs/boost |
387 |
- dev-libs/dbus-glib:= |
388 |
- virtual/libudev:= |
389 |
- sys-apps/dbus:= |
390 |
- dev-libs/glib:2= |
391 |
- virtual/libusb:1= |
392 |
- x11-libs/libX11:=" |
393 |
-DEPEND="${RDEPEND} |
394 |
- virtual/pkgconfig" |
395 |
- |
396 |
-S=${WORKDIR}/${MY_P} |
397 |
- |
398 |
-CONFIG_CHECK="~INPUT_EVDEV ~INPUT_JOYDEV ~INPUT_UINPUT ~!JOYSTICK_XPAD" |
399 |
- |
400 |
-src_prepare() { |
401 |
- epatch "${FILESDIR}"/${P}-scons.patch |
402 |
-} |
403 |
- |
404 |
-src_compile() { |
405 |
- escons \ |
406 |
- BUILD=custom \ |
407 |
- CXX="$(tc-getCXX)" \ |
408 |
- AR="$(tc-getAR)" \ |
409 |
- RANLIB="$(tc-getRANLIB)" \ |
410 |
- CXXFLAGS="-Wall ${CXXFLAGS}" \ |
411 |
- LINKFLAGS="${LDFLAGS}" |
412 |
-} |
413 |
- |
414 |
-src_install() { |
415 |
- dobin xboxdrv |
416 |
- doman doc/xboxdrv.1 |
417 |
- dodoc AUTHORS NEWS PROTOCOL README TODO |
418 |
- |
419 |
- newinitd "${FILESDIR}"/xboxdrv.initd xboxdrv |
420 |
- newconfd "${FILESDIR}"/xboxdrv.confd xboxdrv |
421 |
- |
422 |
- insinto /etc/dbus-1/system.d/ |
423 |
- doins "${FILESDIR}/org.seul.Xboxdrv.conf" |
424 |
- |
425 |
- udev_newrules "${FILESDIR}"/xboxdrv.udev-rules 99-xbox-controller.rules |
426 |
- systemd_dounit "${FILESDIR}"/xboxdrv.service |
427 |
-} |
428 |
- |
429 |
-pkg_postinst() { |
430 |
- udev_reload |
431 |
-} |