linuxPackages.hid-fanatecff: init at 0.2.2

This commit is contained in:
Christian Harke
2025-08-17 23:20:32 +02:00
parent ca79114141
commit 0faf4787f6
2 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchFromGitHub,
kernel,
kernelModuleMakeFlags,
bashNonInteractive,
linuxConsoleTools,
nix-update-script,
}:
let
moduleDir = "lib/modules/${kernel.modDirVersion}/kernel/drivers/hid";
in
stdenv.mkDerivation (finalAttrs: {
pname = "hid-fanatecff";
version = "0.2.2";
src = fetchFromGitHub {
owner = "gotzl";
repo = "hid-fanatecff";
tag = finalAttrs.version;
hash = "sha256-aVuTnrxw7zWMZ1U21DUKDvcYlIp7iHJHaX8ijmUd/TE=";
};
nativeBuildInputs = kernel.moduleBuildDependencies;
postPatch = ''
mkdir -p $out/{lib/udev/rules.d,${moduleDir}}
sed -i '/depmod/d' Makefile
substituteInPlace Makefile \
--replace-fail '/etc/udev/rules.d' "$out/lib/udev/rules.d"
substituteInPlace fanatec.rules \
--replace-fail '/usr/bin/evdev-joystick' '${lib.getExe' linuxConsoleTools "evdev-joystick"}' \
--replace-fail '/bin/sh' '${lib.getExe bashNonInteractive}'
'';
makeFlags = kernelModuleMakeFlags ++ [
"KVERSION=${kernel.modDirVersion}"
"KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"MODULEDIR=$(out)/${moduleDir}"
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Linux module driver for Fanatec driving wheels";
homepage = "https://github.com/gotzl/hid-fanatecff";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ rake5k ];
platforms = lib.platforms.linux;
mainProgram = "hid-fanatecff";
};
})

View File

@@ -481,6 +481,8 @@ in
nct6687d = callPackage ../os-specific/linux/nct6687d { };
hid-fanatecff = callPackage ../os-specific/linux/hid-fanatecff { };
new-lg4ff = callPackage ../os-specific/linux/new-lg4ff { };
zenergy = callPackage ../os-specific/linux/zenergy { };