nixpkgs/pkgs/os-specific/linux/xone/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.3 KiB
Nix
Raw Normal View History

2024-09-17 13:18:58 +01:00
{ stdenv, lib, fetchFromGitHub, kernel, fetchpatch }:
2022-02-19 22:14:59 +00:00
2024-03-16 17:44:03 +00:00
stdenv.mkDerivation (finalAttrs: {
2022-08-07 04:32:33 +01:00
pname = "xone";
2024-03-16 17:44:03 +00:00
version = "0.3-unstable-2024-03-16";
2022-02-19 22:14:59 +00:00
src = fetchFromGitHub {
owner = "medusalix";
2024-03-16 17:44:03 +00:00
repo = "xone";
rev = "948d2302acdd6333295eaba4da06d96677290ad3";
hash = "sha256-srAEw1ai5KT0rmVUL3Dut9R2mNb00AAZVCcINikh2sM=";
2022-02-19 22:14:59 +00:00
};
2024-09-17 13:18:58 +01:00
patches = [
# Fix build on kernel 6.11
# https://github.com/medusalix/xone/pull/48
(fetchpatch {
name = "kernel-6.11.patch";
url = "https://github.com/medusalix/xone/commit/28df566c38e0ee500fd5f74643fc35f21a4ff696.patch";
hash = "sha256-X14oZmxqqZJoBZxPXGZ9R8BAugx/hkSOgXlGwR5QCm8=";
})
];
setSourceRoot = ''
2024-03-16 17:44:03 +00:00
export sourceRoot=$(pwd)/${finalAttrs.src.name}
'';
2022-02-19 22:14:59 +00:00
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = [
"-C"
"${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"M=$(sourceRoot)"
2024-03-16 17:44:03 +00:00
"VERSION=${finalAttrs.version}"
2022-02-19 22:14:59 +00:00
];
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";
2024-05-26 13:16:07 +01:00
license = licenses.gpl2Plus;
2022-02-19 22:14:59 +00:00
maintainers = with lib.maintainers; [ rhysmdnz ];
platforms = platforms.linux;
};
}
2024-03-16 17:44:03 +00:00
)