From aa7366e13e7b4ee8fb350ee0d68b230a5580b41b Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Fri, 22 Apr 2022 10:23:18 +0200 Subject: [PATCH] games-util/xone: add new package --- games-util/xone/Manifest | 2 ++ games-util/xone/files/Makefile | 7 ++++ games-util/xone/metadata.xml | 12 +++++++ games-util/xone/xone-0.2.ebuild | 59 +++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 games-util/xone/Manifest create mode 100644 games-util/xone/files/Makefile create mode 100644 games-util/xone/metadata.xml create mode 100644 games-util/xone/xone-0.2.ebuild diff --git a/games-util/xone/Manifest b/games-util/xone/Manifest new file mode 100644 index 0000000..c331dd7 --- /dev/null +++ b/games-util/xone/Manifest @@ -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 diff --git a/games-util/xone/files/Makefile b/games-util/xone/files/Makefile new file mode 100644 index 0000000..2cb4644 --- /dev/null +++ b/games-util/xone/files/Makefile @@ -0,0 +1,7 @@ +KERNEL_DIR ?= /usr/src/linux +PWD := $(shell pwd) + +all: module + +module: + @$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules diff --git a/games-util/xone/metadata.xml b/games-util/xone/metadata.xml new file mode 100644 index 0000000..9b3c95f --- /dev/null +++ b/games-util/xone/metadata.xml @@ -0,0 +1,12 @@ + + + + + medusalix/xone + + + 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). + + diff --git a/games-util/xone/xone-0.2.ebuild b/games-util/xone/xone-0.2.ebuild new file mode 100644 index 0000000..ff223f5 --- /dev/null +++ b/games-util/xone/xone-0.2.ebuild @@ -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 +}