3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/displaylink/default.nix
Silvan Mosberger f5fa5fa4d6 pkgs: refactor needless quoting of homepage meta attribute (#27809)
* pkgs: refactor needless quoting of homepage meta attribute

A lot of packages are needlessly quoting the homepage meta attribute
(about 1400, 22%), this commit refactors all of those instances.

* pkgs: Fixing some links that were wrongfully unquoted in the previous
commit

* Fixed some instances
2017-08-01 22:03:30 +02:00

54 lines
1.7 KiB
Nix

{ stdenv, lib, fetchurl, unzip, utillinux, libusb1, evdi, systemd, makeWrapper }:
let
arch =
if stdenv.system == "x86_64-linux" then "x64"
else if stdenv.system == "i686-linux" then "x86"
else throw "Unsupported architecture";
bins = "${arch}-ubuntu-1604";
libPath = lib.makeLibraryPath [ stdenv.cc.cc utillinux libusb1 evdi ];
in stdenv.mkDerivation rec {
name = "displaylink-${version}";
version = "1.3.52";
src = fetchurl {
name = "displaylink.zip";
url = "http://www.displaylink.com/downloads/file?id=744";
sha256 = "0ridpsxcf761vym0nlpq702qa46ynddzci17bjmyax2pph7khr0k";
};
nativeBuildInputs = [ unzip makeWrapper ];
buildCommand = ''
unzip $src
chmod +x displaylink-driver-${version}.run
./displaylink-driver-${version}.run --target . --noexec
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"
)
sed -i '2iPATH=${systemd}/bin:$PATH' $out/lib/udev/displaylink.sh
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"
fixupPhase
'';
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;
homepage = http://www.displaylink.com/;
};
}