2024-02-07 01:22:34 +00:00
{ lib
, stdenv
, fetchFromGitHub
, kernel
, libdrm
, python3
} :
2023-10-09 19:29:22 +00:00
2023-07-15 17:15:38 +00:00
let
python3WithLibs = python3 . withPackages ( ps : with ps ; [
pybind11
] ) ;
in
2024-02-07 01:22:34 +00:00
stdenv . mkDerivation ( finalAttrs : {
2020-04-24 23:36:52 +00:00
pname = " e v d i " ;
2024-07-27 06:49:29 +00:00
version = " 1 . 1 4 . 5 " ;
2020-04-24 23:36:52 +00:00
src = fetchFromGitHub {
owner = " D i s p l a y L i n k " ;
2024-02-07 01:22:34 +00:00
repo = " e v d i " ;
2024-04-21 15:54:59 +00:00
rev = " r e f s / t a g s / v ${ finalAttrs . version } " ;
2024-07-27 06:49:29 +00:00
hash = " s h a 2 5 6 - G + z N F w K W t A F r 2 A a p Q o u k j F Q l F I t I P 5 Q 5 m 5 T W u v T M Y 8 k = " ;
2020-04-24 23:36:52 +00:00
} ;
2023-11-16 04:20:00 +00:00
env . NIX_CFLAGS_COMPILE = toString [
" - W n o - e r r o r "
" - W n o - e r r o r = d i s c a r d e d - q u a l i f i e r s " # for Linux 4.19 compatibility
" - W n o - e r r o r = s i g n - c o m p a r e "
] ;
2022-02-10 20:34:41 +00:00
2020-04-24 23:36:52 +00:00
nativeBuildInputs = kernel . moduleBuildDependencies ;
2024-02-07 01:22:34 +00:00
buildInputs = [
kernel
libdrm
python3WithLibs
] ;
2020-04-24 23:36:52 +00:00
2022-03-30 09:31:56 +00:00
makeFlags = kernel . makeFlags ++ [
2024-07-27 06:49:29 +00:00
# This was removed in https://github.com/DisplayLink/evdi/commit/9884501a20346ff85d8a8e3782e9ac9795013ced#diff-5d2a962cad1c08060cbab9e0bba5330ed63958b64ac04024593562cec55f176dL52
" C O N F I G _ D R M _ E V D I = m "
2020-04-24 23:36:52 +00:00
" K V E R = ${ kernel . modDirVersion } "
" K D I R = ${ kernel . dev } / l i b / m o d u l e s / ${ kernel . modDirVersion } / b u i l d "
] ;
hardeningDisable = [ " f o r m a t " " p i c " " f o r t i f y " ] ;
installPhase = ''
2024-02-07 01:22:34 +00:00
runHook preInstall
2020-04-24 23:36:52 +00:00
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
2024-02-07 01:22:34 +00:00
runHook postInstall
2020-04-24 23:36:52 +00:00
'' ;
2022-07-14 12:49:19 +00:00
enableParallelBuilding = true ;
2021-01-15 22:18:51 +00:00
meta = with lib ; {
2024-02-07 01:22:34 +00:00
broken = kernel . kernelOlder " 4 . 1 9 " ;
2024-05-15 15:35:15 +00:00
changelog = " h t t p s : / / g i t h u b . c o m / D i s p l a y L i n k / e v d i / r e l e a s e s / t a g / v ${ finalAttrs . version } " ;
2020-04-24 23:36:52 +00:00
description = " E x t e n s i b l e V i r t u a l D i s p l a y I n t e r f a c e " ;
2024-02-07 01:22:34 +00:00
homepage = " h t t p s : / / w w w . d i s p l a y l i n k . c o m / " ;
license = with licenses ; [ lgpl21Only gpl2Only ] ;
2024-07-31 10:19:44 +00:00
maintainers = [ ] ;
2020-04-24 23:36:52 +00:00
platforms = platforms . linux ;
} ;
2024-02-07 01:22:34 +00:00
} )