meson: hook up a dtd check via xmllint

This commit is contained in:
Peter Hutterer 2023-02-23 09:52:57 +10:00
parent b7ac763241
commit 36a3fd0166
4 changed files with 44 additions and 3 deletions

View file

@ -32,14 +32,14 @@ variables:
# See the documentation here: #
# https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html #
###############################################################################
FEDORA_PACKAGES: 'git diffutils gcc gcc-c++ pkgconf-pkg-config meson systemd-devel libxkbcommon-devel doxygen python3-attrs python3-pytest python3-dbusmock python3-jinja2 '
FEDORA_PACKAGES: 'git diffutils gcc gcc-c++ pkgconf-pkg-config meson systemd-devel libxkbcommon-devel libxml2 doxygen python3-attrs python3-pytest python3-dbusmock python3-jinja2 '
############################ end of package lists #############################
# these tags should be updated each time the list of packages is updated
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular
# libinput version
FEDORA_TAG: '2023-02-02.0'
FEDORA_TAG: '2023-02-23.0'
FDO_UPSTREAM_REPO: libinput/libei

View file

@ -3,7 +3,7 @@
#
# We're happy to rebuild all containers when one changes.
.default_tag: &default_tag '2023-02-02.0'
.default_tag: &default_tag '2023-02-23.0'
distributions:
- name: fedora
@ -20,6 +20,7 @@ distributions:
- meson
- systemd-devel
- libxkbcommon-devel
- libxml2
- doxygen
- python3-attrs
- python3-pytest

View file

@ -1,2 +1,10 @@
scanner = find_program('ei-scanner')
protocol_xml = files('protocol.xml')
protocol_dtd = files('protocol.dtd')
xmllint = find_program('xmllint', required: false)
if xmllint.found()
test('dtdcheck', xmllint,
args: ['--dtdvalid', protocol_dtd, protocol_xml]
)
endif

32
proto/protocol.dtd Normal file
View file

@ -0,0 +1,32 @@
<!ELEMENT protocol (copyright?, description?, interface+)>
<!ATTLIST protocol name CDATA #REQUIRED>
<!ELEMENT copyright (#PCDATA)>
<!ELEMENT interface (description?,(request|event|enum)+)>
<!ATTLIST interface name CDATA #REQUIRED>
<!ATTLIST interface version CDATA #REQUIRED>
<!ELEMENT request (description?,arg*)>
<!ATTLIST request name CDATA #REQUIRED>
<!ATTLIST request type CDATA #IMPLIED>
<!ATTLIST request since CDATA #IMPLIED>
<!ELEMENT event (description?,arg*)>
<!ATTLIST event name CDATA #REQUIRED>
<!ATTLIST event type CDATA #IMPLIED>
<!ATTLIST event since CDATA #IMPLIED>
<!ELEMENT enum (description?,entry*)>
<!ATTLIST enum name CDATA #REQUIRED>
<!ATTLIST enum since CDATA #IMPLIED>
<!ATTLIST enum bitfield CDATA #IMPLIED>
<!ELEMENT entry (description?)>
<!ATTLIST entry name CDATA #REQUIRED>
<!ATTLIST entry value CDATA #REQUIRED>
<!ATTLIST entry summary CDATA #IMPLIED>
<!ATTLIST entry since CDATA #IMPLIED>
<!ELEMENT arg (description?)>
<!ATTLIST arg name CDATA #REQUIRED>
<!ATTLIST arg type CDATA #REQUIRED>
<!ATTLIST arg summary CDATA #IMPLIED>
<!ATTLIST arg interface CDATA #IMPLIED>
<!ATTLIST arg allow-null CDATA #IMPLIED>
<!ATTLIST arg enum CDATA #IMPLIED>
<!ELEMENT description (#PCDATA)>
<!ATTLIST description summary CDATA #REQUIRED>