[Spice-devel] [PATCH spice-protocol 1/2] Add support for building with meson
Frediano Ziglio
fziglio at redhat.com
Tue May 8 16:27:23 UTC 2018
>
> On 05/05/18 08:35, Frediano Ziglio wrote:
> >>
> >> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
> >> ---
> >> Makefile.am | 2 ++
> >> meson.build | 23 +++++++++++++++++++++++
> >> spice/Makefile.am | 2 ++
> >> spice/meson.build | 22 ++++++++++++++++++++++
> >> 4 files changed, 49 insertions(+)
> >> create mode 100644 meson.build
> >> create mode 100644 spice/meson.build
> >>
> >> diff --git a/Makefile.am b/Makefile.am
> >> index 82f19e4..c464fa7 100644
> >> --- a/Makefile.am
> >> +++ b/Makefile.am
> >> @@ -22,4 +22,6 @@ MAINTAINERCLEANFILES = \
> >> `find "$(srcdir)" -type f -name Makefile.in -print` \
> >> $(NULL)
> >>
> >> +EXTRA_DIST = meson.build
> >> +
> >> -include $(top_srcdir)/git.mk
> >> diff --git a/meson.build b/meson.build
> >> new file mode 100644
> >> index 0000000..5ed4177
> >> --- /dev/null
> >> +++ b/meson.build
> >> @@ -0,0 +1,23 @@
> >> +#
> >> +# project definition
> >> +#
> >> +project('spice-protocol', 'c',
> >> + version : '0.12.14',
> >> + license : 'BSD',
> >> + meson_version : '>= 0.41.0')
> >> +
> >> +subdir('spice')
> >> +
> >> +#
> >> +# spice-protocol.pc generation
> >> +#
> >> +datadir = get_option('datadir')
> >> +pkgconfig_dir = join_paths(get_option('prefix'), datadir, 'pkgconfig')
> >> +
> >> +pkgconfig = import('pkgconfig')
> >> +pkgconfig.generate(name : meson.project_name(),
> >> + description : 'SPICE protocol headers',
> >> + version : meson.project_version(),
> >> + subdirs : 'spice-1',
> >> + install_dir : pkgconfig_dir,
> >> + variables :
> >> 'datadir=@0@'.format(join_paths('${prefix}',
> >> datadir)))
> >> diff --git a/spice/Makefile.am b/spice/Makefile.am
> >> index 4f9a607..e41f41d 100644
> >> --- a/spice/Makefile.am
> >> +++ b/spice/Makefile.am
> >> @@ -22,4 +22,6 @@ spice_protocol_include_HEADERS = \
> >> stream-device.h \
> >> $(NULL)
> >>
> >> +EXTRA_DIST = meson.build
> >> +
> >> -include $(top_srcdir)/git.mk
> >> diff --git a/spice/meson.build b/spice/meson.build
> >> new file mode 100644
> >> index 0000000..5b1ff30
> >> --- /dev/null
> >> +++ b/spice/meson.build
> >> @@ -0,0 +1,22 @@
> >> +spice_protocol_headers = [
> >> + 'barrier.h',
> >> + 'controller_prot.h',
> >> + 'end-packed.h',
> >> + 'enums.h',
> >> + 'error_codes.h',
> >> + 'foreign_menu_prot.h',
> >> + 'ipc_ring.h',
> >> + 'macros.h',
> >> + 'protocol.h',
> >> + 'qxl_dev.h',
> >> + 'qxl_windows.h',
> >> + 'start-packed.h',
> >> + 'stats.h',
> >> + 'types.h',
> >> + 'vd_agent.h',
> >> + 'vdi_dev.h',
> >> + 'stream-device.h',
> >> +]
> >> +
> >> +install_headers(spice_protocol_headers,
> >> + subdir : join_paths('spice-1', 'spice'))
> >
> > build and install are working correctly.
> > dist is not working but I don't think is a requirement for the moment.
>
> At least for me it works fine, which command did you use?
>
> $ meson ./build
> $ ninja -C build dist
>
> In the end the tarball can be found in ./build/meson-dist/ directory.
>
Ok, I understood the problem, I was using spice-protocol as a submodule of
spice-common.
> > Other stuff that does not work is .gitignore generation (not needed too)
> >
>
> This is currently tied to autotools, I think we should a new .gitignore
> file whenever we remove autotools, as many of the ignored files would
> have been gone together with that removal.
>
> > I would start merging Meson support, for me:
> >
> > Acked-by: Frediano Ziglio <fziglio at redhat.com>
> >
> > Frediano
> >
>
Frediano
More information about the Spice-devel
mailing list