diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2024-02-06 06:44:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 06:44:39 +0100 |
commit | 119232480d2d72eed7ce3fbbe00a61faade2d7d8 (patch) | |
tree | bcdf8e4a871a8b2478c7a5187290bc74918d4d17 /pkgs | |
parent | 9d29b950794e06555ba13c743b645716b177ec08 (diff) | |
parent | 12490c715146458a288cf48a8bb6035df22d4464 (diff) |
Merge pull request #285313 from drupol/displaylink/refactor
displaylink, evdi: refactor
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/os-specific/linux/displaylink/default.nix | 25 | ||||
-rw-r--r-- | pkgs/os-specific/linux/evdi/default.nix | 28 |
2 files changed, 35 insertions, 18 deletions
diff --git a/pkgs/os-specific/linux/displaylink/default.nix b/pkgs/os-specific/linux/displaylink/default.nix index 408dfa408e1d7..476ea57d44ecd 100644 --- a/pkgs/os-specific/linux/displaylink/default.nix +++ b/pkgs/os-specific/linux/displaylink/default.nix @@ -4,10 +4,8 @@ , util-linux , libusb1 , evdi -, systemd -, makeWrapper +, makeBinaryWrapper , requireFile -, substituteAll }: let @@ -17,9 +15,8 @@ let else if stdenv.hostPlatform.system == "aarch64-linux" then "aarch64-linux-gnu" else throw "Unsupported architecture"; libPath = lib.makeLibraryPath [ stdenv.cc.cc util-linux libusb1 evdi ]; - in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "displaylink"; version = "5.8.0-63.33"; @@ -41,15 +38,21 @@ stdenv.mkDerivation rec { ''; }; - nativeBuildInputs = [ unzip makeWrapper ]; + nativeBuildInputs = [ + makeBinaryWrapper + unzip + ]; unpackPhase = '' + runHook preUnpack unzip $src - chmod +x displaylink-driver-${version}.run - ./displaylink-driver-${version}.run --target . --noexec --nodiskspace + chmod +x displaylink-driver-${finalAttrs.version}.run + ./displaylink-driver-${finalAttrs.version}.run --target . --noexec --nodiskspace + runHook postUnpack ''; installPhase = '' + runHook preInstall install -Dt $out/lib/displaylink *.spkg install -Dm755 ${bins}/DisplayLinkManager $out/bin/DisplayLinkManager mkdir -p $out/lib/udev/rules.d $out/share @@ -63,6 +66,7 @@ stdenv.mkDerivation rec { # We introduce a dependency on the source file so that it need not be redownloaded everytime echo $src >> "$out/share/workspace_dependencies.pin" + runHook postInstall ''; dontStrip = true; @@ -71,10 +75,11 @@ stdenv.mkDerivation rec { meta = with lib; { description = "DisplayLink DL-5xxx, DL-41xx and DL-3x00 Driver for Linux"; homepage = "https://www.displaylink.com/"; + hydraPlatforms = []; license = licenses.unfree; + mainProgram = "DisplayLinkManager"; maintainers = with maintainers; [ abbradar ]; platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; - hydraPlatforms = []; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; }; -} +}) diff --git a/pkgs/os-specific/linux/evdi/default.nix b/pkgs/os-specific/linux/evdi/default.nix index f4ad16523afb5..059c7891a52be 100644 --- a/pkgs/os-specific/linux/evdi/default.nix +++ b/pkgs/os-specific/linux/evdi/default.nix @@ -1,17 +1,23 @@ -{ lib, stdenv, fetchFromGitHub, kernel, libdrm, python3 }: +{ lib +, stdenv +, fetchFromGitHub +, kernel +, libdrm +, python3 +}: let python3WithLibs = python3.withPackages (ps: with ps; [ pybind11 ]); in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "evdi"; version = "1.14.1-unstable-2024-01-30"; src = fetchFromGitHub { owner = "DisplayLink"; - repo = pname; + repo = "evdi"; rev = "d21a6ea3c69ba180457966a04b6545d321cf46ca"; hash = "sha256-Txa9yX9h3GfmHRRNvhrfrsUoQhqRWbBt4gJYAZTNe0w="; }; @@ -24,7 +30,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - buildInputs = [ kernel libdrm python3WithLibs ]; + buildInputs = [ + kernel + libdrm + python3WithLibs + ]; makeFlags = kernel.makeFlags ++ [ "KVER=${kernel.modDirVersion}" @@ -34,19 +44,21 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" "pic" "fortify" ]; installPhase = '' + runHook preInstall install -Dm755 module/evdi.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/evdi/evdi.ko install -Dm755 library/libevdi.so $out/lib/libevdi.so + runHook postInstall ''; enableParallelBuilding = true; meta = with lib; { + broken = kernel.kernelOlder "4.19"; changelog = "https://github.com/DisplayLink/evdi/releases/tag/v${version}"; description = "Extensible Virtual Display Interface"; + homepage = "https://www.displaylink.com/"; + license = with licenses; [ lgpl21Only gpl2Only ]; maintainers = with maintainers; [ ]; platforms = platforms.linux; - license = with licenses; [ lgpl21Only gpl2Only ]; - homepage = "https://www.displaylink.com/"; - broken = kernel.kernelOlder "4.19"; }; -} +}) |