summaryrefslogtreecommitdiff
path: root/games-util/xboxdrv
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-util/xboxdrv
reinit the tree, so we can have metadata
Diffstat (limited to 'games-util/xboxdrv')
-rw-r--r--games-util/xboxdrv/Manifest13
-rw-r--r--games-util/xboxdrv/files/github-144.patch15
-rw-r--r--games-util/xboxdrv/files/org.seul.Xboxdrv.conf7
-rw-r--r--games-util/xboxdrv/files/xboxdrv-0.8.8-fix-c++14.patch16
-rw-r--r--games-util/xboxdrv/files/xboxdrv-0.8.8-scons.patch13
-rw-r--r--games-util/xboxdrv/files/xboxdrv.confd5
-rw-r--r--games-util/xboxdrv/files/xboxdrv.initd18
-rw-r--r--games-util/xboxdrv/files/xboxdrv.service14
-rw-r--r--games-util/xboxdrv/files/xboxdrv.udev-rules5
-rw-r--r--games-util/xboxdrv/metadata.xml8
-rw-r--r--games-util/xboxdrv/xboxdrv-0.8.8.ebuild63
11 files changed, 177 insertions, 0 deletions
diff --git a/games-util/xboxdrv/Manifest b/games-util/xboxdrv/Manifest
new file mode 100644
index 000000000000..eeaeb90e1d07
--- /dev/null
+++ b/games-util/xboxdrv/Manifest
@@ -0,0 +1,13 @@
+AUX github-144.patch 491 SHA256 1a4e332f0847b4e25cfbfa64dfc0e11ebdd19245e66c239894dc71f36b66164c SHA512 058eb9515a74742d6aef1de3acc76b8731947fe4a3aa1179243d0b14cab5f978aef98d9b140371dd03a5165f96e167b1dc7297378545f266e887ea0b3188c79e WHIRLPOOL 16e1123ab42df8da898e426bc5adc7944cfbf2ebd49d5ea5e5c14a6cc0a6848aaeeb38903691a3e8a2a8d3d937e86d0db17aa3180589bc8634a68aba787aac92
+AUX org.seul.Xboxdrv.conf 247 SHA256 be9338d20d388e7ba882eac8ef4ee93e5328b12c071263c623a2f3795e00bdb6 SHA512 1416e80d326481e224ce3381a8feeacf304107f945d787183c74118aae955e191cc89269e8de44d6ce4efc2502def6957b690e9bad70072fcf0bbd47c8ab12cc WHIRLPOOL 4150838bb20ae2c6a11546dc95368666a28d8ac10d990cd6106cf4cfd3c70e89f1aa552064a3a00591917ca4e37452e45c26bb9fd6eac26bef334a8bb0655ddf
+AUX xboxdrv-0.8.8-fix-c++14.patch 337 SHA256 ef66b7afa308ce36e11ec90765b871bec4c753cdfe222d15ab065ed24a7391eb SHA512 97b504a0acf7fd52ef0f4accacd89e9211136809c7559bd8958d2b235d732df2659fb5b794512e2ff3aaf33f22d97e2f4b42187eab9406a36e7b6cb9fd651832 WHIRLPOOL e29d1237c96148c606670c557d6b9c04edd5ba73b6cd53e16d4f29cbf40f5a19f623d5b469a4f427f41089553f877016a49103891b4e4fb3ec69ea54c02eea49
+AUX xboxdrv-0.8.8-scons.patch 584 SHA256 1d3f6c6803576c4bfbba5dbb31c9cd40e21780b057aff2d4dc4ab6285f5d391f SHA512 25b7b1e57f7ad9b48ad566c81b97b9354a353535564462e8c4b550190c920718165044508d28b3d5fee6155bb41752afbd8038fab59239c58e1aee82d62c5910 WHIRLPOOL 3f87b720813425589e08872732a2ede47cc773f32b4a1eb908281fa37308066ecbc97e0092c40788e14794682840370916056525b1cb98802c4c5166203613c8
+AUX xboxdrv.confd 211 SHA256 da8054d48e83544f9eea1b1bc2125c53c334986508df61e7a3feda68767035d2 SHA512 4c8a784a18979746a45653244e451fe1ba9e7cbb14301cc18f58e474e51f7569177364c5a96cbe0275db2b359424febd27c040ede5820148aadb80e90ebf8178 WHIRLPOOL 429dce51c646ed3fe96a4447585ceed53f0a7ae0b14f2b4ccdb947d3c7d5dc4d160e2a23aba182646a2c6802383296c0644abb327215751c7ab55c88576efda0
+AUX xboxdrv.initd 446 SHA256 134d62c7eb83fb66ce199593521672016168a30a51512a948d3298d4d4aaf0ff SHA512 e87d4b4b4313cb4ae983aef4ab7fa799f6b466e0f504eb15905b82f5b8bca2f0ff6f3d9a7d9963c048b6189e2a4c4b862a3f39d4201c2f5f02234362ad7b3af1 WHIRLPOOL 1d272d3e270bace0b857e378eec1d6ba7a0cd153d8c91f40e500d29da0fea19f2ae03cb7ca166dae113906623523a7c12aa411da8e24c1cb61563341cfa88354
+AUX xboxdrv.service 371 SHA256 8f0f7d536d7f2c452a3d64f94caf1ef97f6daba8e57005f556bb9e278beaa0a8 SHA512 80e7657edae9c771740628ef5f9752b79d50288ead33afe97e71ffc6e7d7c24343eeb213668cdc823b28742976e2e56f4defdcd823716897f3262be1fc7832e9 WHIRLPOOL c26e38a756b8f3f3ec690017a968ae5f0262d976c85e81dcb6df2ab2de92dc6201b8935d61f62fd606c60aa2f1a74eaa49e853258f0c0235492c3ac2001dc55e
+AUX xboxdrv.udev-rules 225 SHA256 7a55625ff3fd9fae1b9bde594898d411c3d8649e605890c0e5c9aa3246fca9d7 SHA512 eb9e535bb18077e4c61db8fa5020a779b856a6df29eb4daa72a2ab9675720f809a981b0e4706fbbc6bf5a368cc162c7151cd6ae10399d091f10d2f75b1c48a3e WHIRLPOOL f6fb8b02f985222d1eaf4d7a3d643f3ab4146a167ebeb99d5fd3f44c4a7eb3cc2af60876319b84828e90dd342bddacf41825157e851d7fc8ebd68b5e413982ee
+DIST xboxdrv-linux-0.8.8.tar.bz2 267919 SHA256 f4fb8c09c0ce3841798f129ae4c2caf3f6db9786d78ad941994e425e3ffc168a SHA512 2978b33d23636431ee0cc393ea32d3d26ebe9f2b914f0bf8bc0e096f98202726768142e653bc5765ac55084b105ff3a6214bdf6e745fdd8aa167260c54c10494 WHIRLPOOL a27c0c68171cb08c6edc12aeafb84ae3a2edb14b8d4a87ad607f722581a58955d11808acb8c0b7169581850f52dd76be2c100de5e284a1521d10f0ae108a867d
+EBUILD xboxdrv-0.8.8.ebuild 1401 SHA256 19f7123b279a6240678d05f6f8f44a7865b88e3457f5d6f31cc978b94de0b3a1 SHA512 51298e029b45e5194e3ac07ad7f964edb2901dcd2031249f43d33db8c2f6a4ebba46cfc961d57cf022a38b5cfc6cf45e019db5e4f3fe4d04996da8410dddfea4 WHIRLPOOL e2ce14f962560e7c60cac1be9a83eb8229e7d30a21f38a53b3c3c66813c08b5cff5939e223637a5d0f85abf6542a4568260269022a729b92a613261d1a7a1798
+MISC ChangeLog 3655 SHA256 413210964ebcbfdc733ad73031a6a37b605007d64956e3d47e57cb10ec8147f1 SHA512 3af0fa29759914d8466deff2abcafa17c39b7305e529e9eee244915b7bc212fc9a4d8cff3475ab2bea90e5f9875a574b3eb61c5e1c06d834f070db74918cd539 WHIRLPOOL cc7f2cafb6ebdb8143c1f50b31516b47def5fc31abeb26382f510bc53f0880fe2dc5571c2ad22efcd1b8152e1603b49f6d2d5f80cc8b30de4c48f17766ad4b3f
+MISC ChangeLog-2015 5140 SHA256 ae0a5c2b8b6c2fd0e0cb815b8e81d8d3e60c80ade6e2de0834fbc68a917f3bd9 SHA512 33d6486227c59f06663c559bb47fa22a14dff618905ad40dcfa2cef351d4e2e1d978a1670c5387caa2b965cde826210f8bdfaedee97fbf009e56ffe054a525fb WHIRLPOOL 207755bbfee1b147869f16a0149dd40897f94fcd72e26ccf3e5e767aaa91ca57b14acee09c787dcc807e814d4e4e30c4e147e38a8b11869fe68d3e243462503e
+MISC metadata.xml 252 SHA256 0dd0e558bb7ccc4f24cb9c9c43790c108e559f3462861b2ff6eb267a345beaab SHA512 90798aff93ec7e3881b882e7b10bb1680e8cb7d82b0ef4280e562ab0c9e8a2daba8afe57333dc64697322267a4b651c00ee9b4fdeb56278ff70c073da7b91638 WHIRLPOOL c6c72f145f4ccc4863ad4c1a236eac601fb00f0e9550568f98d5e6f5eeb16f361b4c18eac8d80a1534e398fac595a6819a86297164be0818d04de6d643f01d7c
diff --git a/games-util/xboxdrv/files/github-144.patch b/games-util/xboxdrv/files/github-144.patch
new file mode 100644
index 000000000000..5782e1a8cd52
--- /dev/null
+++ b/games-util/xboxdrv/files/github-144.patch
@@ -0,0 +1,15 @@
+diff -Naur xboxdrv-linux-0.8.5.orig/src/usb_gsource.cpp xboxdrv-linux-0.8.5/src/usb_gsource.cpp
+--- xboxdrv-linux-0.8.5.orig/src/usb_gsource.cpp 2013-04-07 18:27:49.000000000 +0100
++++ xboxdrv-linux-0.8.5/src/usb_gsource.cpp 2016-07-02 12:35:41.692355904 +0100
+@@ -174,7 +174,10 @@
+ gboolean
+ USBGSource::on_source()
+ {
+- libusb_handle_events(NULL);
++ struct timeval to;
++ to.tv_sec = 0;
++ to.tv_usec = 0;
++ libusb_handle_events_timeout_completed(NULL, &to, NULL);
+ return TRUE;
+ }
+
diff --git a/games-util/xboxdrv/files/org.seul.Xboxdrv.conf b/games-util/xboxdrv/files/org.seul.Xboxdrv.conf
new file mode 100644
index 000000000000..fc685d6e8e83
--- /dev/null
+++ b/games-util/xboxdrv/files/org.seul.Xboxdrv.conf
@@ -0,0 +1,7 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <policy context="default">
+ <allow own="org.seul.Xboxdrv"/>
+ </policy>
+</busconfig>
diff --git a/games-util/xboxdrv/files/xboxdrv-0.8.8-fix-c++14.patch b/games-util/xboxdrv/files/xboxdrv-0.8.8-fix-c++14.patch
new file mode 100644
index 000000000000..80a8d8f550e1
--- /dev/null
+++ b/games-util/xboxdrv/files/xboxdrv-0.8.8-fix-c++14.patch
@@ -0,0 +1,16 @@
+Cast boost::shared_ptr explicitly for C++14.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=594674
+
+--- a/src/controller_slot.cpp
++++ b/src/controller_slot.cpp
+@@ -67,9 +67,9 @@ ControllerSlot::disconnect()
+ }
+
+ bool
+ ControllerSlot::is_connected() const
+ {
+- return m_thread;
++ return static_cast<bool>(m_thread);
+ }
+
+ /* EOF */
diff --git a/games-util/xboxdrv/files/xboxdrv-0.8.8-scons.patch b/games-util/xboxdrv/files/xboxdrv-0.8.8-scons.patch
new file mode 100644
index 000000000000..d6df8d99e32e
--- /dev/null
+++ b/games-util/xboxdrv/files/xboxdrv-0.8.8-scons.patch
@@ -0,0 +1,13 @@
+https://dev.gentoo.org/~vapier/scons-blows.txt
+
+diff -Naur xboxdrv-linux-0.8.8.orig/SConstruct xboxdrv-linux-0.8.8/SConstruct
+--- xboxdrv-linux-0.8.8.orig/SConstruct 2015-11-09 10:19:35.000000000 +0000
++++ xboxdrv-linux-0.8.8/SConstruct 2016-07-02 16:13:52.560961836 +0100
+@@ -84,6 +84,7 @@
+ opts.Add('CXXFLAGS', 'C++ Compiler flags')
+ opts.Add('LINKFLAGS', 'Linker Compiler flags')
+ opts.Add('AR', 'Library archiver')
++opts.Add('RANLIB', 'Archive indexer')
+ opts.Add('CC', 'C Compiler')
+ opts.Add('CXX', 'C++ Compiler')
+ opts.Add('BUILD', 'Build type: release, custom, development')
diff --git a/games-util/xboxdrv/files/xboxdrv.confd b/games-util/xboxdrv/files/xboxdrv.confd
new file mode 100644
index 000000000000..99363c95dafb
--- /dev/null
+++ b/games-util/xboxdrv/files/xboxdrv.confd
@@ -0,0 +1,5 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+XBOXDRV_OPTS=""
+#XBOXDRV_OPTS="${XBOXDRV_OPTS} --next-controller --config /etc/xboxdrv/controller.ini"
diff --git a/games-util/xboxdrv/files/xboxdrv.initd b/games-util/xboxdrv/files/xboxdrv.initd
new file mode 100644
index 000000000000..8602c7e12531
--- /dev/null
+++ b/games-util/xboxdrv/files/xboxdrv.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PIDFILE="/var/run/${SVCNAME}.pid"
+
+start() {
+ ebegin "Starting xboxdrv"
+ start-stop-daemon --start --pidfile "${PIDFILE}" --exec /usr/bin/xboxdrv -- \
+ --daemon --detach --pid-file "${PIDFILE}" ${XBOXDRV_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping xboxdrv"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/games-util/xboxdrv/files/xboxdrv.service b/games-util/xboxdrv/files/xboxdrv.service
new file mode 100644
index 000000000000..b0d372696e0a
--- /dev/null
+++ b/games-util/xboxdrv/files/xboxdrv.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Userspace Xbox 360 Controller driver
+BindsTo=sys-subsystem-usb-xbox-controller0.device
+After=sys-subsystem-usb-xbox-controller0.device
+
+[Service]
+BusName=org.seul.Xboxdrv
+ExecStart=/usr/bin/xboxdrv --silent --daemon
+KillSignal=SIGINT
+# xboxdrv can not stop gracefully if controller gets unplugged
+TimeoutStopSec=2
+
+[Install]
+WantedBy=multi-user.target
diff --git a/games-util/xboxdrv/files/xboxdrv.udev-rules b/games-util/xboxdrv/files/xboxdrv.udev-rules
new file mode 100644
index 000000000000..c571b2b5ab02
--- /dev/null
+++ b/games-util/xboxdrv/files/xboxdrv.udev-rules
@@ -0,0 +1,5 @@
+SUBSYSTEM=="usb", ACTION=="add",\
+ ENV{ID_MODEL_FROM_DATABASE}=="Xbox*Controller|Xbox*Controller S",\
+ TAG+="systemd",\
+ ENV{SYSTEMD_ALIAS}="/sys/subsystem/usb/xbox/controller$number",\
+ ENV{SYSTEMD_WANTS}+="xboxdrv.service"
diff --git a/games-util/xboxdrv/metadata.xml b/games-util/xboxdrv/metadata.xml
new file mode 100644
index 000000000000..3c186688e265
--- /dev/null
+++ b/games-util/xboxdrv/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/games-util/xboxdrv/xboxdrv-0.8.8.ebuild b/games-util/xboxdrv/xboxdrv-0.8.8.ebuild
new file mode 100644
index 000000000000..0e0a20838083
--- /dev/null
+++ b/games-util/xboxdrv/xboxdrv-0.8.8.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit linux-info scons-utils toolchain-funcs systemd udev
+
+MY_P=${PN}-linux-${PV}
+DESCRIPTION="Userspace Xbox 360 Controller driver"
+HOMEPAGE="http://pingus.seul.org/~grumbel/xboxdrv/"
+SRC_URI="http://pingus.seul.org/~grumbel/xboxdrv/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+RDEPEND="dev-libs/boost:=
+ dev-libs/dbus-glib:=
+ virtual/libudev:=
+ sys-apps/dbus:=
+ dev-libs/glib:2=
+ virtual/libusb:1=
+ x11-libs/libX11:="
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-scons.patch
+ "${FILESDIR}"/github-144.patch
+ "${FILESDIR}"/${P}-fix-c++14.patch
+)
+
+CONFIG_CHECK="~INPUT_EVDEV ~INPUT_JOYDEV ~INPUT_UINPUT ~!JOYSTICK_XPAD"
+
+src_compile() {
+ escons \
+ BUILD=custom \
+ CXX="$(tc-getCXX)" \
+ AR="$(tc-getAR)" \
+ RANLIB="$(tc-getRANLIB)" \
+ CXXFLAGS="-Wall ${CXXFLAGS}" \
+ LINKFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dobin xboxdrv
+ doman doc/xboxdrv.1
+ dodoc AUTHORS NEWS PROTOCOL README.md TODO
+
+ newinitd "${FILESDIR}"/xboxdrv.initd xboxdrv
+ newconfd "${FILESDIR}"/xboxdrv.confd xboxdrv
+
+ insinto /etc/dbus-1/system.d/
+ doins "${FILESDIR}/org.seul.Xboxdrv.conf"
+
+ udev_newrules "${FILESDIR}"/xboxdrv.udev-rules 99-xbox-controller.rules
+ systemd_dounit "${FILESDIR}"/xboxdrv.service
+}
+
+pkg_postinst() {
+ udev_reload
+}