2020-12-29 15:07:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, unzip
|
|
|
|
, util-linux
|
|
|
|
, libusb1
|
|
|
|
, evdi
|
|
|
|
, systemd
|
|
|
|
, makeWrapper
|
|
|
|
, requireFile
|
|
|
|
, substituteAll
|
|
|
|
}:
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2023-11-16 04:20:00 +00:00
|
|
|
bins =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then "x64-ubuntu-1604"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "x86-ubuntu-1604"
|
|
|
|
else if stdenv.hostPlatform.system == "aarch64-linux" then "aarch64-linux-gnu"
|
2020-04-24 23:36:52 +00:00
|
|
|
else throw "Unsupported architecture";
|
2020-11-24 20:58:05 +00:00
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc util-linux libusb1 evdi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-29 15:07:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "displaylink";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "5.8.0-63.33";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = requireFile rec {
|
2023-10-09 19:29:22 +00:00
|
|
|
name = "displaylink-580.zip";
|
|
|
|
sha256 = "05m8vm6i9pc9pmvar021lw3ls60inlmq92nling0vj28skm55i92";
|
2020-04-24 23:36:52 +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:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
https://www.synaptics.com/products/displaylink-graphics/downloads/ubuntu-5.8
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
Once you have downloaded the file, please use the following
|
|
|
|
commands and re-run the installation:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
mv \$PWD/"DisplayLink USB Graphics Software for Ubuntu5.8-EXE.zip" \$PWD/${name}
|
2020-04-24 23:36:52 +00:00
|
|
|
nix-prefetch-url file://\$PWD/${name}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
unzip $src
|
|
|
|
chmod +x displaylink-driver-${version}.run
|
|
|
|
./displaylink-driver-${version}.run --target . --noexec --nodiskspace
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dt $out/lib/displaylink *.spkg
|
|
|
|
install -Dm755 ${bins}/DisplayLinkManager $out/bin/DisplayLinkManager
|
2022-02-10 20:34:41 +00:00
|
|
|
mkdir -p $out/lib/udev/rules.d $out/share
|
2020-12-29 15:07:52 +00:00
|
|
|
cp ${./99-displaylink.rules} $out/lib/udev/rules.d/99-displaylink.rules
|
2020-04-24 23:36:52 +00:00
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
|
|
--set-rpath ${libPath} \
|
|
|
|
$out/bin/DisplayLinkManager
|
|
|
|
wrapProgram $out/bin/DisplayLinkManager \
|
2022-04-27 09:35:20 +00:00
|
|
|
--chdir "$out/lib/displaylink"
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
# We introduce a dependency on the source file so that it need not be redownloaded everytime
|
|
|
|
echo $src >> "$out/share/workspace_dependencies.pin"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "DisplayLink DL-5xxx, DL-41xx and DL-3x00 Driver for Linux";
|
2022-09-09 14:08:57 +00:00
|
|
|
homepage = "https://www.displaylink.com/";
|
|
|
|
license = licenses.unfree;
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ abbradar ];
|
2023-11-16 04:20:00 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
|
2022-09-09 14:08:57 +00:00
|
|
|
hydraPlatforms = [];
|
2023-10-09 19:29:22 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|