2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
kernel,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "digimend";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "13";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "digimend";
|
|
|
|
repo = "digimend-kernel-drivers";
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-YYCxTyoZGMnqC2nKkRi5Z1uofldGvJDGY2/sO9iMNIo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed 's/udevadm /true /' -i Makefile
|
|
|
|
sed 's/depmod /true /' -i Makefile
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Fix build on Linux kernel >= 5.18
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=implicit-fallthrough" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Remove module reload hack.
|
|
|
|
# The hid-rebind unloads and then reloads the hid-* module to ensure that
|
|
|
|
# the extra/ module is loaded.
|
|
|
|
rm -r $out/lib/udev
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
makeFlags = kernel.makeFlags ++ [
|
2020-04-24 23:36:52 +00:00
|
|
|
"KVERSION=${kernel.modDirVersion}"
|
|
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
"DESTDIR=${placeholder "out"}"
|
2022-03-30 09:31:56 +00:00
|
|
|
"INSTALL_MOD_PATH=${placeholder "out"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "DIGImend graphics tablet drivers for the Linux kernel";
|
|
|
|
homepage = "https://digimend.github.io/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ gebner ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|