diff --git a/pkgs/os-specific/linux/veikk-linux-driver/default.nix b/pkgs/os-specific/linux/veikk-linux-driver/default.nix index 55ce63db7902..7663707fe662 100644 --- a/pkgs/os-specific/linux/veikk-linux-driver/default.nix +++ b/pkgs/os-specific/linux/veikk-linux-driver/default.nix @@ -6,17 +6,19 @@ kernelModuleMakeFlags, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "veikk-linux-driver"; version = "2.0"; src = fetchFromGitHub { owner = "jlam55555"; - repo = pname; - rev = "v${version}"; - sha256 = "11mg74ds58jwvdmi3i7c4chxs6v9g09r9ll22pc2kbxjdnrp8zrn"; + repo = "veikk-linux-driver"; + tag = "v${finalAttrs.version}"; + sha256 = "sha256-Nn90s22yrynYFYLSlBN4aRvdISPsxBFr21yiohs5r4Y="; }; + patches = [ ./fix-6.12-build.patch ]; + nativeBuildInputs = kernel.moduleBuildDependencies; buildInputs = [ kernel ]; @@ -26,16 +28,20 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/veikk install -Dm755 veikk.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/veikk + + runHook postInstall ''; - meta = with lib; { + meta = { description = "Linux driver for VEIKK-brand digitizers"; homepage = "https://github.com/jlam55555/veikk-linux-driver/"; - license = licenses.gpl2Only; - platforms = platforms.linux; - maintainers = with maintainers; [ nicbk ]; + license = lib.licenses.gpl2Only; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ nicbk ]; broken = kernel.kernelOlder "4.19"; }; -} +}) diff --git a/pkgs/os-specific/linux/veikk-linux-driver/fix-6.12-build.patch b/pkgs/os-specific/linux/veikk-linux-driver/fix-6.12-build.patch new file mode 100644 index 000000000000..feae73dd83e2 --- /dev/null +++ b/pkgs/os-specific/linux/veikk-linux-driver/fix-6.12-build.patch @@ -0,0 +1,26 @@ +https://github.com/torvalds/linux/commit/5f60d5f6bbc12e782fac78110b0ee62698f3b576 +--- + veikk_vdev.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/veikk_vdev.c b/veikk_vdev.c +index 9d0b49f..83e9efa 100644 +--- a/veikk_vdev.c ++++ b/veikk_vdev.c +@@ -6,7 +6,13 @@ + * - Set up the module parameters + */ + ++#include ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) + #include ++#else ++#include ++#endif + #include + #include "veikk.h" + +-- +2.49.0 +