[Xcb] [PATCH 3/4] xcb-proto: add meson build system

Marty E. Plummer hanetzer at startmail.com
Thu Aug 2 06:02:48 UTC 2018


Signed-off-by: Marty E. Plummer <hanetzer at startmail.com>
---
 meson.build       | 14 ++++++++++++
 meson_options.txt |  6 +++++
 src/meson.build   | 56 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 src/meson.build

diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..ba4bea4
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,14 @@
+project('xcb-proto', version: '1.13', license: 'MIT')
+
+subdir('src')
+
+pkg = import('pkgconfig')
+
+pkg.generate(
+    name: 'xcb-proto',
+    description: 'X protocol descriptions for XCB',
+    variables: [
+      'datarootdir=${prefix}/share',
+      'xcbincludedir=${datadir}/xcb'
+    ]
+)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..a0af6bc
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+option(
+    'install-proto',
+    type : 'boolean',
+    value : true,
+    description : 'Install xcb protocol xml files'
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..5be2f78
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,56 @@
+
+proto = [
+  'bigreq.xml',
+  'composite.xml',
+  'damage.xml',
+  'dpms.xml',
+  'dri2.xml',
+  'dri3.xml',
+  'ge.xml',
+  'glx.xml',
+  'present.xml',
+  'randr.xml',
+  'record.xml',
+  'render.xml',
+  'res.xml',
+  'screensaver.xml',
+  'shape.xml',
+  'shm.xml',
+  'sync.xml',
+  'xc_misc.xml',
+  'xevie.xml',
+  'xf86dri.xml',
+  'xf86vidmode.xml',
+  'xfixes.xml',
+  'xinerama.xml',
+  'xinput.xml',
+  'xkb.xml',
+  'xprint.xml',
+  'xproto.xml',
+  'xselinux.xml',
+  'xtest.xml',
+  'xvmc.xml',
+  'xv.xml'
+]
+
+schema = 'xcb.xsd'
+
+xmllint = find_program(['xmllint', '/usr/bin/xmllint'], required : false)
+if xmllint.found()
+  #do xml validation
+  #foreach p : proto
+  # run_command(xmllint, '--noout', '--schema', schema, p)
+  #endforeach
+  run_target('check-local',
+      command : [ xmllint, '--noout', '--schema', schema, proto ]
+  )
+else
+  warning('xmllint not found; unable to validate against schema.')
+endif
+
+if get_option('install-proto')
+  install_data(
+      files([ proto, schema ]),
+      install_dir : join_paths(get_option('datadir'), 'xcb')
+  )
+endif
-- 
2.18.0



More information about the Xcb mailing list