games-util/xone: add new package

This commit is contained in:
Max Luebke 2022-04-22 10:23:18 +02:00
parent aa0606c317
commit aa7366e13e
4 changed files with 80 additions and 0 deletions

2
games-util/xone/Manifest Normal file
View File

@ -0,0 +1,2 @@
DIST xone-0.2-driver.cab 199891 BLAKE2B f531a9f4b8220ee4501431b308ee6e29a8dea26467020df25b7fa22228543cc560e1170d13b1cb3490c64c48bf610e3fb7ddfb743e4a2028f5980e02d0c36790 SHA512 0906debd6c1f4706348ec1b1cbf233ea2c45bbc0b8882593740964036808722f5bb701f43da803320609e02072cd16dada572d337fd4c05cc1cf6dde6fd38908
DIST xone-0.2.tar.gz 49684 BLAKE2B 9b197d3867d66331d619ee705a286f3374fe3314800ea6df060ee4458e4c1d71e37bd14ffa36ff7083702c3b6093ec928725c26d23b8713a4f213e80ae3f73db SHA512 63b31063e4a5b74f37e0ac09e5aed0d292d9d433b56e90e0449cd2e0371ae60206e87aeacb57e1c033302296c9989876cc2e66cdbe90a8bd80ff2780397b1520

View File

@ -0,0 +1,7 @@
KERNEL_DIR ?= /usr/src/linux
PWD := $(shell pwd)
all: module
module:
@$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<upstream>
<remote-id type="github">medusalix/xone</remote-id>
</upstream>
<longdescription>
xone is a Linux kernel driver for Xbox One and Xbox Series X|S
accessories. It serves as a modern replacement for xpad, aiming to be
compatible with Microsoft's Game Input Protocol (GIP).
</longdescription>
</pkgmetadata>

View File

@ -0,0 +1,59 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit linux-mod
DESCRIPTION="Linux kernel driver for Xbox One and Xbox Series X|S accessories"
HOMEPAGE="https://github.com/medusalix/xone"
SRC_URI="https://github.com/medusalix/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab -> ${P}-driver.cab"
LICENSE="GPL-2 MS-TOU"
RESTRICT="bindist mirror"
SLOT="0"
KEYWORDS="~amd64"
MODULE_NAMES="
xone-wired(kernel/drivers/input/joystick)
xone-dongle(kernel/drivers/input/joystick)
xone-gip-bus(kernel/drivers/input/joystick)
xone-gip-common(kernel/drivers/input/joystick)
xone-gip-gamepad(kernel/drivers/input/joystick)
xone-gip-headset(kernel/drivers/input/joystick)
xone-gip-chatpad(kernel/drivers/input/joystick)
"
BUILD_TARGETS="module"
BUILD_PARAMS="KERNEL_DIR=${KERNEL_DIR}"
BDEPEND="app-arch/cabextract"
src_unpack() {
unpack ${P}.tar.gz
cabextract -F FW_ACC_00U.bin -d "${S}" "${DISTDIR}/${P}-driver.cab" > /dev/null \
|| die "Failed to unpack driver"
}
src_prepare() {
cp "${FILESDIR}/Makefile" "${S}" || die
eapply_user
}
src_install() {
linux-mod_src_install
einfo "Installing module blacklist"
insinto /etc/modprobe.d/
newins "${S}"/install/modprobe.conf xone-blacklist.conf
einfo "Installing Microsoft binary firmware"
insinto /lib/firmware/
newins "${S}"/FW_ACC_00U.bin xow_dongle.bin
}