2023-05-24 13:37:59 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, kernel, fetchurl, fetchpatch }:
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "xone";
|
|
|
|
version = "0.3";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "medusalix";
|
2022-08-12 12:06:08 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-h+j4xCV9R6hp9trsv1NByh9m0UBafOz42ZuYUjclILE=";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
patches = [
|
|
|
|
# Fix build on kernel 6.3
|
|
|
|
(fetchpatch {
|
|
|
|
name = "kernel-6.3.patch";
|
|
|
|
url = "https://github.com/medusalix/xone/commit/bbf0dcc484c3f5611f4e375da43e0e0ef08f3d18.patch";
|
|
|
|
hash = "sha256-A2OzRRk4XT++rS6k6EIyiPy/LJptvVRUxoP7CIGrPWU=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
setSourceRoot = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
export sourceRoot=$(pwd)/${src.name}
|
2022-03-05 16:20:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"-C"
|
|
|
|
"${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
"M=$(sourceRoot)"
|
|
|
|
"VERSION=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
buildFlags = [ "modules" ];
|
|
|
|
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
|
|
|
|
installTargets = [ "modules_install" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Linux kernel driver for Xbox One and Xbox Series X|S accessories";
|
|
|
|
homepage = "https://github.com/medusalix/xone";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with lib.maintainers; [ rhysmdnz ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|