summary refs log tree commit diff
path: root/pkgs/development/libraries/intel-media-driver
diff options
context:
space:
mode:
authorRob Ashton <robashton@codeofrob.com>2019-11-12 09:08:03 +0000
committerMichael Weiss <dev.primeos@gmail.com>2021-01-08 14:41:31 +0100
commit0e061a859577bee26f602330eccfb08123c0bf33 (patch)
treec415435a83123761aea0b50a2c1c169b7b910ce3 /pkgs/development/libraries/intel-media-driver
parent464633d5f741c53db3d219a98b221d168fe1e656 (diff)
downloadnixpkgs-0e061a859577bee26f602330eccfb08123c0bf33.tar
nixpkgs-0e061a859577bee26f602330eccfb08123c0bf33.tar.gz
nixpkgs-0e061a859577bee26f602330eccfb08123c0bf33.tar.bz2
nixpkgs-0e061a859577bee26f602330eccfb08123c0bf33.tar.lz
nixpkgs-0e061a859577bee26f602330eccfb08123c0bf33.tar.xz
nixpkgs-0e061a859577bee26f602330eccfb08123c0bf33.tar.zst
nixpkgs-0e061a859577bee26f602330eccfb08123c0bf33.zip
intel-media-driver: Fix runtime issues due to the libX11 dependency
X11 is an optional run-time and optional build-time dependency of iHD.
A patchelf is required to join these two worlds together, and a lot of
machines that'll run the intel-media-driver won't have X11 on them, so
make it optional.

Fix #73236.

Co-Authored-By: Michael Weiss <dev.primeos@gmail.com>
Diffstat (limited to 'pkgs/development/libraries/intel-media-driver')
-rw-r--r--pkgs/development/libraries/intel-media-driver/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/development/libraries/intel-media-driver/default.nix b/pkgs/development/libraries/intel-media-driver/default.nix
index 153e41a777c..6f2f543af06 100644
--- a/pkgs/development/libraries/intel-media-driver/default.nix
+++ b/pkgs/development/libraries/intel-media-driver/default.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchFromGitHub
 , cmake, pkg-config
-, libva, libpciaccess, intel-gmmlib, libX11
+, libva, libpciaccess, intel-gmmlib
+, enableX11 ? true, libX11
 }:
 
 stdenv.mkDerivation rec {
@@ -23,7 +24,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkg-config ];
 
-  buildInputs = [ libva libpciaccess intel-gmmlib libX11 ];
+  buildInputs = [ libva libpciaccess intel-gmmlib ]
+    ++ stdenv.lib.optional enableX11 libX11;
 
   meta = with stdenv.lib; {
     description = "Intel Media Driver for VAAPI — Broadwell+ iGPUs";
@@ -38,4 +40,9 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux;
     maintainers = with maintainers; [ primeos jfrankenau ];
   };
+
+  postFixup = stdenv.lib.optionalString enableX11 ''
+    patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${stdenv.lib.makeLibraryPath [ libX11  ]}" \
+      $out/lib/dri/iHD_drv_video.so
+  '';
 }