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
2 changed files:
Changes:
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 |
... | ... | @@ -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" \
|