intel-media-driver: enable x11 only on linux, split dev output, move meta to the file end

This commit is contained in:
Sandro Jäckel 2021-08-31 17:50:46 +02:00
parent 9a21867643
commit c0b250259c
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -1,13 +1,15 @@
{ lib, stdenv, fetchFromGitHub { lib, stdenv, fetchFromGitHub
, cmake, pkg-config , cmake, pkg-config
, libva, libpciaccess, intel-gmmlib , libva, libpciaccess, intel-gmmlib
, enableX11 ? true, libX11 , enableX11 ? stdenv.isLinux, libX11
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "intel-media-driver"; pname = "intel-media-driver";
version = "21.3.2"; version = "21.3.2";
outputs = [ "out" "dev" ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "intel"; owner = "intel";
repo = "media-driver"; repo = "media-driver";
@ -27,6 +29,11 @@ stdenv.mkDerivation rec {
buildInputs = [ libva libpciaccess intel-gmmlib ] buildInputs = [ libva libpciaccess intel-gmmlib ]
++ lib.optional enableX11 libX11; ++ lib.optional enableX11 libX11;
postFixup = lib.optionalString enableX11 ''
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${lib.makeLibraryPath [ libX11 ]}" \
$out/lib/dri/iHD_drv_video.so
'';
meta = with lib; { meta = with lib; {
description = "Intel Media Driver for VAAPI Broadwell+ iGPUs"; description = "Intel Media Driver for VAAPI Broadwell+ iGPUs";
longDescription = '' longDescription = ''
@ -40,9 +47,4 @@ stdenv.mkDerivation rec {
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ primeos jfrankenau ]; maintainers = with maintainers; [ primeos jfrankenau ];
}; };
postFixup = lib.optionalString enableX11 ''
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${lib.makeLibraryPath [ libX11 ]}" \
$out/lib/dri/iHD_drv_video.so
'';
} }