2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, lib, unzip, utillinux,
|
2018-12-09 12:48:15 +01:00
|
|
|
libusb1, evdi, systemd, makeWrapper, requireFile, substituteAll }:
|
2016-08-27 18:46:43 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
arch =
|
2018-08-20 21:11:29 +02:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "x86"
|
2016-08-27 18:46:43 +02:00
|
|
|
else throw "Unsupported architecture";
|
2017-05-01 14:23:41 +02:00
|
|
|
bins = "${arch}-ubuntu-1604";
|
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc utillinux libusb1 evdi ];
|
2016-08-27 18:46:43 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "displaylink";
|
2019-11-05 19:13:36 +01:00
|
|
|
version = "5.2.14";
|
2016-08-27 18:46:43 +02:00
|
|
|
|
2017-08-17 06:24:28 +02:00
|
|
|
src = requireFile rec {
|
2016-08-27 18:46:43 +02:00
|
|
|
name = "displaylink.zip";
|
2019-11-05 19:13:36 +01:00
|
|
|
sha256 = "03b176y95f04rg3lcnjps9llsjbvd8yksh1fpvjwaciz48mnxh2i";
|
2017-08-17 06:24:28 +02: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:
|
|
|
|
|
2019-11-05 19:13:36 +01:00
|
|
|
http://www.displaylink.com/downloads/file?id=1369
|
2017-08-17 06:24:28 +02:00
|
|
|
|
|
|
|
Once you have downloaded the file, please use the following
|
|
|
|
commands and re-run the installation:
|
|
|
|
|
2019-11-05 19:13:36 +01:00
|
|
|
mv \$PWD/"DisplayLink USB Graphics Software for Ubuntu ${lib.versions.majorMinor version}.zip" \$PWD/${name}
|
2017-08-17 06:24:28 +02:00
|
|
|
nix-prefetch-url file://\$PWD/${name}
|
|
|
|
'';
|
2016-08-27 18:46:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
|
|
|
|
2018-12-09 12:48:15 +01:00
|
|
|
unpackPhase = ''
|
2017-05-01 14:23:41 +02:00
|
|
|
unzip $src
|
2016-08-27 18:46:43 +02:00
|
|
|
chmod +x displaylink-driver-${version}.run
|
2019-11-18 15:18:16 +01:00
|
|
|
./displaylink-driver-${version}.run --target . --noexec --nodiskspace
|
2018-12-09 12:48:15 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [ (substituteAll {
|
|
|
|
src = ./udev-installer.patch;
|
|
|
|
inherit systemd;
|
|
|
|
})];
|
2016-08-27 18:46:43 +02:00
|
|
|
|
2018-12-09 12:48:15 +01:00
|
|
|
installPhase = ''
|
2017-05-01 14:23:41 +02:00
|
|
|
sed -i "s,/opt/displaylink/udev.sh,$out/lib/udev/displaylink.sh,g" udev-installer.sh
|
|
|
|
( source udev-installer.sh
|
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
main systemd "$out/lib/udev/rules.d/99-displaylink.rules" "$out/lib/udev/displaylink.sh"
|
2016-08-27 18:46:43 +02:00
|
|
|
)
|
|
|
|
|
2017-05-01 14:23:41 +02:00
|
|
|
install -Dt $out/lib/displaylink *.spkg
|
|
|
|
install -Dm755 ${bins}/DisplayLinkManager $out/bin/DisplayLinkManager
|
|
|
|
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 18:46:43 +02:00
|
|
|
'';
|
|
|
|
|
2018-02-22 10:56:12 +01:00
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2018-12-09 12:48:15 +01:00
|
|
|
|
2016-08-27 18:46:43 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "DisplayLink DL-5xxx, DL-41xx and DL-3x00 Driver for Linux";
|
2019-11-05 19:13:36 +01:00
|
|
|
maintainers = with maintainers; [ nshalman abbradar peterhoeg ];
|
2016-08-27 18:46:43 +02:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
license = licenses.unfree;
|
2019-11-05 19:13:36 +01:00
|
|
|
homepage = "https://www.displaylink.com/";
|
2016-08-27 18:46:43 +02:00
|
|
|
};
|
|
|
|
}
|