AtlatestRepositorysigil-ui
1
#!/bin/sh2
# Regenerate the Wayland protocol code from the XML files kept beside it:3
# native/wayland for the library, test/wayland for the test input driver.4
# The output is checked in, so building sigil-ui needs neither5
# wayland-scanner nor the Wayland development headers. The other headers in6
# native/wayland/include are copied from libwayland's wayland-client.7
#8
# Usage: scripts/generate-wayland-protocols (needs wayland-scanner >= 1.20)9
set -eu10
root=$(cd "$(dirname "$0")/.." && pwd)11
command -v wayland-scanner >/dev/null || { echo "wayland-scanner is not on PATH" >&2; exit 1; }13
generate() {14
cd "$1"15
for xml in protocols/*.xml; do16
name=$(basename "$xml" .xml)17
if [ "$name" = wayland ]; then18
wayland-scanner client-header "$xml" include/wayland-client-protocol.h19
elif [ "$name" != tablet-v2 ]; then20
# tablet-v2 is here only for the interface cursor-shape refers to.21
wayland-scanner client-header "$xml" "$name-client-protocol.h"22
fi23
wayland-scanner private-code "$xml" "$name-protocol.c"24
done25
echo "generated in $1: $(ls *.h *.c | tr '\n' ' ')"26
}28
generate "$root/native/wayland"29
generate "$root/test/wayland"