Discussion:
[Xcb] [PATCH 3/4] xcb-proto: add meson build system
Marty E. Plummer
2018-08-02 06:02:48 UTC
Permalink
Signed-off-by: Marty E. Plummer <***@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
Marty E. Plummer
2018-08-02 06:02:46 UTC
Permalink
Signed-off-by: Marty E. Plummer <***@startmail.com>
---
Makefile.am | 2 +-
configure.ac | 2 +-
{xcbgen => lib/xcbgen}/Makefile.am | 0
{xcbgen => lib/xcbgen}/__init__.py | 0
{xcbgen => lib/xcbgen}/align.py | 0
{xcbgen => lib/xcbgen}/error.py | 0
{xcbgen => lib/xcbgen}/expr.py | 0
{xcbgen => lib/xcbgen}/matcher.py | 0
{xcbgen => lib/xcbgen}/state.py | 0
{xcbgen => lib/xcbgen}/xtypes.py | 0
10 files changed, 2 insertions(+), 2 deletions(-)
rename {xcbgen => lib/xcbgen}/Makefile.am (100%)
rename {xcbgen => lib/xcbgen}/__init__.py (100%)
rename {xcbgen => lib/xcbgen}/align.py (100%)
rename {xcbgen => lib/xcbgen}/error.py (100%)
rename {xcbgen => lib/xcbgen}/expr.py (100%)
rename {xcbgen => lib/xcbgen}/matcher.py (100%)
rename {xcbgen => lib/xcbgen}/state.py (100%)
rename {xcbgen => lib/xcbgen}/xtypes.py (100%)

diff --git a/Makefile.am b/Makefile.am
index 6bc14ad..31dc320 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src xcbgen
+SUBDIRS = src lib/xcbgen

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xcb-proto.pc
diff --git a/configure.ac b/configure.ac
index 88b3439..74ca2e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,4 +19,4 @@ AM_PATH_PYTHON([2.5])
xcbincludedir='${datadir}/xcb'
AC_SUBST(xcbincludedir)

-AC_OUTPUT([Makefile src/Makefile xcbgen/Makefile xcb-proto.pc])
+AC_OUTPUT([Makefile src/Makefile lib/xcbgen/Makefile xcb-proto.pc])
diff --git a/xcbgen/Makefile.am b/lib/xcbgen/Makefile.am
similarity index 100%
rename from xcbgen/Makefile.am
rename to lib/xcbgen/Makefile.am
diff --git a/xcbgen/__init__.py b/lib/xcbgen/__init__.py
similarity index 100%
rename from xcbgen/__init__.py
rename to lib/xcbgen/__init__.py
diff --git a/xcbgen/align.py b/lib/xcbgen/align.py
similarity index 100%
rename from xcbgen/align.py
rename to lib/xcbgen/align.py
diff --git a/xcbgen/error.py b/lib/xcbgen/error.py
similarity index 100%
rename from xcbgen/error.py
rename to lib/xcbgen/error.py
diff --git a/xcbgen/expr.py b/lib/xcbgen/expr.py
similarity index 100%
rename from xcbgen/expr.py
rename to lib/xcbgen/expr.py
diff --git a/xcbgen/matcher.py b/lib/xcbgen/matcher.py
similarity index 100%
rename from xcbgen/matcher.py
rename to lib/xcbgen/matcher.py
diff --git a/xcbgen/state.py b/lib/xcbgen/state.py
similarity index 100%
rename from xcbgen/state.py
rename to lib/xcbgen/state.py
diff --git a/xcbgen/xtypes.py b/lib/xcbgen/xtypes.py
similarity index 100%
rename from xcbgen/xtypes.py
rename to lib/xcbgen/xtypes.py
--
2.18.0
Marty E. Plummer
2018-08-02 06:02:47 UTC
Permalink
Signed-off-by: Marty E. Plummer <***@startmail.com>
---
setup.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 setup.py

diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..96b20bd
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+
+from distutils.core import setup
+
+setup(
+ name = 'xcbgen',
+ version = '1.13',
+ url = 'https://xcb.freedesktop.org',
+ package_dir = {'': 'lib'},
+ packages = ['xcbgen'],
+
+ classifiers = [
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: POSIX',
+ 'Programming Language :: Python',
+ 'Topic :: Software Development'
+ ]
+)
--
2.18.0
Marty E. Plummer
2018-08-02 06:02:49 UTC
Permalink
Doesn't work due to subdir, will ask the meson people about it and fix.

Signed-off-by: Marty E. Plummer <***@startmail.com>
---
src/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/meson.build b/src/meson.build
index 5be2f78..b8c07fe 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -41,8 +41,8 @@ if xmllint.found()
#foreach p : proto
# run_command(xmllint, '--noout', '--schema', schema, p)
#endforeach
- run_target('check-local',
- command : [ xmllint, '--noout', '--schema', schema, proto ]
+ test('check-local',
+ xmllint, args : ['--noout', '--schema', schema, proto ]
)
else
warning('xmllint not found; unable to validate against schema.')
--
2.18.0
Loading...