2020-12-20 22:42:39 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, unzip
|
|
|
|
, util-linux
|
|
|
|
, libusb1
|
|
|
|
, evdi
|
|
|
|
, systemd
|
|
|
|
, makeWrapper
|
|
|
|
, requireFile
|
|
|
|
, substituteAll
|
|
|
|
}:
|
2016-08-27 16:46:43 +00:00
|
|
|
let
|
|
|
|
arch =
|
2018-08-20 19:11:29 +00:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "x86"
|
2016-08-27 16:46:43 +00:00
|
|
|
else throw "Unsupported architecture";
|
2017-05-01 12:23:41 +00:00
|
|
|
bins = "${arch}-ubuntu-1604";
|
2020-11-24 15:29:28 +00:00
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc util-linux libusb1 evdi ];
|
2016-08-27 16:46:43 +00:00
|
|
|
|
2020-12-20 22:42:39 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "displaylink";
|
2020-07-11 10:01:26 +00:00
|
|
|
version = "5.3.1.34";
|
2016-08-27 16:46:43 +00:00
|
|
|
|
2017-08-17 04:24:28 +00:00
|
|
|
src = requireFile rec {
|
2016-08-27 16:46:43 +00:00
|
|
|
name = "displaylink.zip";
|
2020-07-11 10:01:26 +00:00
|
|
|
sha256 = "1c1kbjgpb71f73qnyl44rvwi6l4ivddq789rwvvh0ahw2jm324hy";
|
2017-08-17 04:24:28 +00:00
|
|
|
message = ''
|
|
|
|
In order to install the DisplayLink drivers, you must first
|
|
|
|
comply with DisplayLink's EULA and download the binaries and
|
|
|
|
sources from here:
|
|
|
|
|
2020-07-11 10:01:26 +00:00
|
|
|
https://www.displaylink.com/downloads/file?id=1576
|
2017-08-17 04:24:28 +00:00
|
|
|
|
|
|
|
Once you have downloaded the file, please use the following
|
|
|
|
commands and re-run the installation:
|
|
|
|
|
2019-11-05 18:13:36 +00:00
|
|
|
mv \$PWD/"DisplayLink USB Graphics Software for Ubuntu ${lib.versions.majorMinor version}.zip" \$PWD/${name}
|
2017-08-17 04:24:28 +00:00
|
|
|
nix-prefetch-url file://\$PWD/${name}
|
|
|
|
'';
|
2016-08-27 16:46:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
|
|
|
|
2018-12-09 11:48:15 +00:00
|
|
|
unpackPhase = ''
|
2017-05-01 12:23:41 +00:00
|
|
|
unzip $src
|
2016-08-27 16:46:43 +00:00
|
|
|
chmod +x displaylink-driver-${version}.run
|
2019-11-18 14:18:16 +00:00
|
|
|
./displaylink-driver-${version}.run --target . --noexec --nodiskspace
|
2018-12-09 11:48:15 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-05-01 12:23:41 +00:00
|
|
|
install -Dt $out/lib/displaylink *.spkg
|
|
|
|
install -Dm755 ${bins}/DisplayLinkManager $out/bin/DisplayLinkManager
|
2020-12-20 22:42:39 +00:00
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
cp ${./99-displaylink.rules} $out/lib/udev/rules.d/99-displaylink.rules
|
2017-05-01 12:23:41 +00:00
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
|
|
--set-rpath ${libPath} \
|
|
|
|
$out/bin/DisplayLinkManager
|
|
|
|
wrapProgram $out/bin/DisplayLinkManager \
|
|
|
|
--run "cd $out/lib/displaylink"
|
2016-08-27 16:46:43 +00:00
|
|
|
'';
|
|
|
|
|
2018-02-22 09:56:12 +00:00
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2018-12-09 11:48:15 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-08-27 16:46:43 +00:00
|
|
|
description = "DisplayLink DL-5xxx, DL-41xx and DL-3x00 Driver for Linux";
|
2020-07-16 08:18:22 +00:00
|
|
|
maintainers = with maintainers; [ nshalman abbradar peterhoeg eyjhb ];
|
2016-08-27 16:46:43 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
license = licenses.unfree;
|
2019-11-05 18:13:36 +00:00
|
|
|
homepage = "https://www.displaylink.com/";
|
2016-08-27 16:46:43 +00:00
|
|
|
};
|
|
|
|
}
|