[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][xorg-team/lib/mesa][debian-unstable] Share a single JSON manifest per Vulkan driver between all architectures



Title: GitLab

Timo Aaltonen pushed to branch debian-unstable at X Strike Force / lib / mesa

Commits:

  • 82eed41b
    by Simon McVittie at 2025-04-23T16:47:51+01:00
    Share a single JSON manifest per Vulkan driver between all architectures
    
    Because our Vulkan driver libraries are installed to a directory in the
    dynamic linker's search path, we can list them in their JSON manifest
    by the library's basename rather than its absolute path. This makes the
    content of the JSON manifest the same for each architecture, so it can
    be a single file shared between architectures via dpkg's multiarch file
    reference-counting.
    
    This avoids multiarch file collisions between pairs of architectures
    that have the same Meson CPU name but a different library directory,
    such as armel and armhf.
    
    The JSON manifests for Mesa's EGL driver and Vulkan layers, and for the
    Nvidia proprietary driver's Vulkan driver, are already implemented
    this way.
    
    Closes: #980148
    Signed-off-by: Simon McVittie <smcv@debian.org>
    
    

2 changed files:

Changes:

  • debian/merge-vulkan-driver-manifests.sh
    1
    +#!/bin/sh
    
    2
    +# Copyright 2025 Collabora Ltd.
    
    3
    +# SPDX-License-Identifier: MIT
    
    4
    +
    
    5
    +# Usage: debian/merge-vulkan-driver-manifests.sh debian/tmp
    
    6
    +# DEB_HOST_MULTIARCH must be set in the environment.
    
    7
    +#
    
    8
    +# If the JSON manifest describing a Vulkan driver contains for example
    
    9
    +# "library_path": "/usr/lib/x86_64-linux-gnu/libvulkan_lvp.so"
    
    10
    +# then replace it with
    
    11
    +# "library_path": "libvulkan_lvp.so"
    
    12
    +# to get the same content for each architecture, and rename from for example
    
    13
    +# "lvp_icd.x86_64.json"
    
    14
    +# to
    
    15
    +# "lvp_icd.json"
    
    16
    +# so that the same JSON manifest will be shared between all multiarch
    
    17
    +# architectures.
    
    18
    +#
    
    19
    +# This avoids multiarch collisions on pairs of architectures where the
    
    20
    +# Meson CPU name is the same but the library path is different, notably
    
    21
    +# armel/armhf. https://bugs.debian.org/980148
    
    22
    +
    
    23
    +set -eu
    
    24
    +
    
    25
    +DESTDIR="$1"
    
    26
    +
    
    27
    +for file in "$DESTDIR"/usr/share/vulkan/icd.d/*.*.json; do
    
    28
    +	if grep -q 'library_path.*/usr/lib/'"${DEB_HOST_MULTIARCH}"'/lib[^/"]*\.so' "${file}"; then
    
    29
    +		replacement="${file%.*.json}.json"
    
    30
    +		sed -E -e '/library_path/ s,/usr/lib/'"${DEB_HOST_MULTIARCH}"'/(lib[^/"]*\.so),\1,' \
    
    31
    +			< "${file}" > "${replacement}"
    
    32
    +		diff -s -u "${file}" "${replacement}" || true
    
    33
    +		rm "${file}"
    
    34
    +	else
    
    35
    +		echo "multiarch library path not found in $file, leaving it as-is"
    
    36
    +	fi
    
    37
    +done

  • debian/rules
    ... ... @@ -233,6 +233,7 @@ override_dh_auto_configure: rewrite_wrap_files
    233 233
     
    
    234 234
     override_dh_auto_install:
    
    235 235
     	dh_auto_install
    
    236
    +	debian/merge-vulkan-driver-manifests.sh debian/tmp
    
    236 237
     	for file in debian/*.links.in; \
    
    237 238
     	do \
    
    238 239
     		sed -e"s,\$${DEB_HOST_MULTIARCH},$(DEB_HOST_MULTIARCH),g" \
    


  • Reply to: