2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, kernel, libdrm }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "evdi";
|
2021-07-14 22:03:04 +00:00
|
|
|
version = "unstable-2021-06-11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "DisplayLink";
|
|
|
|
repo = pname;
|
2021-07-14 22:03:04 +00:00
|
|
|
rev = "65e12fca334f2f42396f4e8d16592d53cab34dd6";
|
|
|
|
sha256 = "sha256-81IfdYKadKT7vRdkmxzfGo4KHa4UJ8uJ0K6djQCr22U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
# Linux 5.13 support
|
|
|
|
# The patches break compilation for older kernels
|
|
|
|
patches = lib.optional (kernel.kernelAtLeast "5.13") [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/DisplayLink/evdi/commit/c5f5441d0a115d2cfc8125b8bafaa05b2edc7938.patch";
|
|
|
|
sha256 = "sha256-tWYgBrRh3mXPebhUygOvJ07V87g9JU66hREriACfEVI=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/DisplayLink/evdi/commit/5f04d2e2df4cfd21dc15d31f1152c6a66fa48a78.patch";
|
|
|
|
sha256 = "sha256-690/eUiEVWvnT/YAVgKcLo86dgolF9giWRuPxXpL+eQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
buildInputs = [ kernel libdrm ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"KVER=${kernel.modDirVersion}"
|
|
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" "pic" "fortify" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 module/evdi.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/evdi/evdi.ko
|
2020-07-18 16:06:22 +00:00
|
|
|
install -Dm755 library/libevdi.so $out/lib/libevdi.so
|
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 = "Extensible Virtual Display Interface";
|
2020-07-18 16:06:22 +00:00
|
|
|
maintainers = with maintainers; [ eyjhb ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2021-07-14 22:03:04 +00:00
|
|
|
license = with licenses; [ lgpl21Only gpl2Only ];
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.displaylink.com/";
|
2021-07-14 22:03:04 +00:00
|
|
|
broken = kernel.kernelOlder "4.19" || stdenv.isAarch64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|