2018-07-21 00:44:44 +00:00
|
|
|
{ stdenv, lib, unzip, utillinux,
|
2017-08-17 04:24:28 +00:00
|
|
|
libusb1, evdi, systemd, makeWrapper, requireFile }:
|
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";
|
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc utillinux libusb1 evdi ];
|
2016-08-27 16:46:43 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "displaylink-${version}";
|
2018-02-22 09:56:12 +00:00
|
|
|
version = "4.1.9";
|
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";
|
2018-02-22 09:56:12 +00:00
|
|
|
sha256 = "d762145014df7fea8ca7af12206a077d73d8e7f2259c8dc2ce7e5fb1e69ef9a3";
|
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:
|
|
|
|
|
2018-02-22 09:56:12 +00:00
|
|
|
http://www.displaylink.com/downloads/file?id=1087
|
2017-08-17 04:24:28 +00:00
|
|
|
|
|
|
|
Once you have downloaded the file, please use the following
|
|
|
|
commands and re-run the installation:
|
|
|
|
|
|
|
|
mv \$PWD/"DisplayLink USB Graphics Software for Ubuntu ${version}.zip" \$PWD/${name}
|
|
|
|
nix-prefetch-url file://\$PWD/${name}
|
|
|
|
'';
|
2016-08-27 16:46:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
2017-05-01 12:23:41 +00:00
|
|
|
unzip $src
|
2016-08-27 16:46:43 +00:00
|
|
|
chmod +x displaylink-driver-${version}.run
|
2017-05-01 12:23:41 +00:00
|
|
|
./displaylink-driver-${version}.run --target . --noexec
|
2016-08-27 16:46:43 +00:00
|
|
|
|
2017-05-01 12:23:41 +00: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 16:46:43 +00:00
|
|
|
)
|
2017-05-01 12:23:41 +00:00
|
|
|
sed -i '2iPATH=${systemd}/bin:$PATH' $out/lib/udev/displaylink.sh
|
2016-08-27 16:46:43 +00:00
|
|
|
|
2017-05-01 12:23:41 +00: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 16:46:43 +00:00
|
|
|
|
|
|
|
fixupPhase
|
|
|
|
'';
|
|
|
|
|
2018-02-22 09:56:12 +00:00
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2016-08-27 16:46:43 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "DisplayLink DL-5xxx, DL-41xx and DL-3x00 Driver for Linux";
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
license = licenses.unfree;
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = http://www.displaylink.com/;
|
2016-08-27 16:46:43 +00:00
|
|
|
};
|
|
|
|
}
|