linuxPackages.nvidiaPackages.beta: fix icds

This commit is contained in:
Kiskae 2024-07-23 19:07:56 +02:00
parent 0384602eac
commit 21bc7a6efd
2 changed files with 11 additions and 9 deletions

View File

@ -112,16 +112,17 @@ installPhase() {
# EGL
if [ "$useGLVND" = "1" ]; then
sed -E "s#(libEGL_nvidia)#$i/lib/\\1#" 10_nvidia.json > 10_nvidia.json.fixed
sed -E "s#(libnvidia-egl-wayland)#$i/lib/\\1#" 10_nvidia_wayland.json > 10_nvidia_wayland.json.fixed
mkdir -p "$i/share/egl/egl_external_platform.d"
for icdname in $(find . -name '*_nvidia*.json')
do
cat "$icdname" | jq ".ICD.library_path |= \"$i/lib/\(.)\"" | tee "$i/share/egl/egl_external_platform.d/$icdname"
done
install -Dm644 10_nvidia.json.fixed $i/share/glvnd/egl_vendor.d/10_nvidia.json
install -Dm644 10_nvidia_wayland.json.fixed $i/share/egl/egl_external_platform.d/10_nvidia_wayland.json
if [[ -f "15_nvidia_gbm.json" ]]; then
sed -E "s#(libnvidia-egl-gbm)#$i/lib/\\1#" 15_nvidia_gbm.json > 15_nvidia_gbm.json.fixed
install -Dm644 15_nvidia_gbm.json.fixed $i/share/egl/egl_external_platform.d/15_nvidia_gbm.json
# glvnd icd
mkdir -p "$i/share/glvnd/egl_vendor.d"
mv "$i/share/egl/egl_external_platform.d/10_nvidia.json" "$i/share/glvnd/egl_vendor.d/10_nvidia.json"
if [[ -f "$i/share/egl/egl_external_platform.d/15_nvidia_gbm.json" ]]; then
mkdir -p $i/lib/gbm
ln -s $i/lib/libnvidia-allocator.so $i/lib/gbm/nvidia-drm_gbm.so
fi

View File

@ -41,6 +41,7 @@
, nukeReferences
, which
, libarchive
, jq
, # Whether to build the libraries only (i.e. not the kernel module or
# nvidia-settings). Used to support 32-bit binaries on 64-bit
# Linux.
@ -175,7 +176,7 @@ let
libPath = libPathFor pkgs;
libPath32 = optionalString i686bundled (libPathFor pkgsi686Linux);
nativeBuildInputs = [ perl nukeReferences which libarchive ]
nativeBuildInputs = [ perl nukeReferences which libarchive jq ]
++ optionals (!libsOnly) kernel.moduleBuildDependencies;
disallowedReferences = optionals (!libsOnly) [ kernel.dev ];