Wayland: Get system wayland-protocols path via pkg-config (#15668)

This commit is contained in:
Colin Kinloch 2023-09-03 17:48:11 +01:00 committed by GitHub
parent 88437ca5a6
commit 320ba73f90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,17 +31,14 @@ while [ $# -gt 0 ]; do
done
WAYSCAN="$(exists wayland-scanner || :)"
PKGCONFIG="$(exists pkg-config || :)"
[ "${WAYSCAN}" ] || die 1 "Error: No wayscan in ($PATH)"
WAYLAND_PROTOS=''
if [ "$PROTOS" != 'no' ]; then
for protos in "$SHARE_DIR" /usr/local/share/wayland-protocols /usr/share/wayland-protocols; do
[ -d "$protos" ] || continue
WAYLAND_PROTOS="$protos"
break
done
if [ "$PROTOS" != 'no' -a "$PKGCONFIG" ]; then
WAYLAND_PROTOS="$($PKGCONFIG wayland-protocols --variable=pkgdatadir)"
fi
if [ -z "${WAYLAND_PROTOS}" ]; then