[vala/wip/meson: 1/3] Add initial Meson build system



commit bcf51ced3a71fd2799f641be9884024202d95dcb
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Jan 9 14:47:55 2017 +0100

    Add initial Meson build system

 build-aux/meson/cat.py                  |   11 +
 ccode/meson.build                       |   71 +++++++
 codegen/meson.build                     |   49 +++++
 compiler/meson.build                    |   19 ++
 config.h.meson                          |   31 +++
 doc/meson.build                         |    7 +
 gee/meson.build                         |   33 ++++
 gobject-introspection/meson.build       |   47 +++++
 libvaladoc/meson.build                  |  166 ++++++++++++++++
 meson.build                             |  130 +++++++++++++
 unversioned-install.sh                  |   13 ++
 vala/meson.build                        |  174 +++++++++++++++++
 valadoc/doclets/devhelp/meson.build     |   12 ++
 valadoc/doclets/gtkdoc/meson.build      |   17 ++
 valadoc/doclets/html/meson.build        |   12 ++
 valadoc/doclets/meson.build             |    4 +
 valadoc/icons/meson.build               |   35 ++++
 valadoc/meson.build                     |   23 +++
 vapi/meson.build                        |  315 +++++++++++++++++++++++++++++++
 vapigen/meson.build                     |   46 +++++
 vapigen/vala-gen-introspect/meson.build |    9 +
 version.h.meson                         |    2 +
 22 files changed, 1226 insertions(+), 0 deletions(-)
---
diff --git a/build-aux/meson/cat.py b/build-aux/meson/cat.py
new file mode 100644
index 0000000..a9ab897
--- /dev/null
+++ b/build-aux/meson/cat.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+import sys, os
+from pathlib import Path
+
+output_fd = sys.stdout.buffer.fileno()
+for fname in sys.argv[1:]:
+       inputf = Path(fname)
+       with inputf.open('rb') as f:
+               while os.sendfile(output_fd, f.fileno(), None, 1 << 30) != 0:
+                       pass
diff --git a/ccode/meson.build b/ccode/meson.build
new file mode 100644
index 0000000..601b67f
--- /dev/null
+++ b/ccode/meson.build
@@ -0,0 +1,71 @@
+valaccode_sources = [
+       'valaccodeassignment.vala',
+       'valaccodebinaryexpression.vala',
+       'valaccodeblock.vala',
+       'valaccodebreakstatement.vala',
+       'valaccodecasestatement.vala',
+       'valaccodecastexpression.vala',
+       'valaccodecommaexpression.vala',
+       'valaccodecomment.vala',
+       'valaccodeconditionalexpression.vala',
+       'valaccodeconstant.vala',
+       'valaccodecontinuestatement.vala',
+       'valaccodedeclaration.vala',
+       'valaccodedeclarator.vala',
+       'valaccodedostatement.vala',
+       'valaccodeelementaccess.vala',
+       'valaccodeemptystatement.vala',
+       'valaccodeenum.vala',
+       'valaccodeenumvalue.vala',
+       'valaccodeexpressionstatement.vala',
+       'valaccodeexpression.vala',
+       'valaccodefile.vala',
+       'valaccodeforstatement.vala',
+       'valaccodefragment.vala',
+       'valaccodefunctioncall.vala',
+       'valaccodefunctiondeclarator.vala',
+       'valaccodefunction.vala',
+       'valaccodeggnucsection.vala',
+       'valaccodegotostatement.vala',
+       'valaccodeidentifier.vala',
+       'valaccodeifsection.vala',
+       'valaccodeifstatement.vala',
+       'valaccodeincludedirective.vala',
+       'valaccodeinitializerlist.vala',
+       'valaccodeinvalidexpression.vala',
+       'valaccodelabel.vala',
+       'valaccodelinedirective.vala',
+       'valaccodemacroreplacement.vala',
+       'valaccodememberaccess.vala',
+       'valaccodemodifiers.vala',
+       'valaccodenewline.vala',
+       'valaccodenode.vala',
+       'valaccodeoncesection.vala',
+       'valaccodeparameter.vala',
+       'valaccodeparenthesizedexpression.vala',
+       'valaccodereturnstatement.vala',
+       'valaccodestatement.vala',
+       'valaccodestruct.vala',
+       'valaccodeswitchstatement.vala',
+       'valaccodetypedefinition.vala',
+       'valaccodeunaryexpression.vala',
+       'valaccodevariabledeclarator.vala',
+       'valaccodewhilestatement.vala',
+       'valaccodewriter.vala'
+]
+
+valaccode_lib = static_library(
+       'valaccode',
+       valaccode_sources,
+       dependencies: [gobject_dep, valagee_dep],
+       install: false,
+       vala_args: ['--use-header'],
+       vala_header: 'valaccode.h',
+       vala_vapi: 'valaccode.vapi',
+)
+
+valaccode_dep = declare_dependency(
+       link_with: [valaccode_lib],
+       dependencies: [valagee_dep],
+       include_directories: include_directories('.'),
+)
diff --git a/codegen/meson.build b/codegen/meson.build
new file mode 100644
index 0000000..fa54259
--- /dev/null
+++ b/codegen/meson.build
@@ -0,0 +1,49 @@
+valacodegen_sources = [
+       'valaccode.vala',
+       'valaccodearraymodule.vala',
+       'valaccodeassignmentmodule.vala',
+       'valaccodeattribute.vala',
+       'valaccodebasemodule.vala',
+       'valaccodecompiler.vala',
+       'valaccodecontrolflowmodule.vala',
+       'valaccodedelegatemodule.vala',
+       'valaccodememberaccessmodule.vala',
+       'valaccodemethodcallmodule.vala',
+       'valaccodemethodmodule.vala',
+       'valaccodestructmodule.vala',
+       'valaclassregisterfunction.vala',
+       'valactype.vala',
+       'valaenumregisterfunction.vala',
+       'valagasyncmodule.vala',
+       'valagdbusclientmodule.vala',
+       'valagdbusmodule.vala',
+       'valagdbusservermodule.vala',
+       'valagerrormodule.vala',
+       'valagirwriter.vala',
+       'valagobjectmodule.vala',
+       'valagsignalmodule.vala',
+       'valagtkmodule.vala',
+       'valagtypemodule.vala',
+       'valagvariantmodule.vala',
+       'valainterfaceregisterfunction.vala',
+       'valastructregisterfunction.vala',
+       'valatyperegisterfunction.vala'
+]
+
+valacodegen_lib = shared_library(
+       'valacodegen',
+       valacodegen_sources,
+       dependencies: [gobject_dep, valacore_dep, valaccode_dep],
+       install_rpath: pkglibdir,
+       install_dir: pkglibdir,
+       install: [ true, false, false ],
+       vala_args: ['--use-header'],
+       vala_header: 'valacodegen.h',
+       vala_vapi: 'valacodegen.vapi',
+)
+
+valacodegen_dep = declare_dependency(
+       link_with: [valacodegen_lib],
+       dependencies: [valacore_dep, valaccode_dep],
+       include_directories: include_directories('.'),
+)
diff --git a/compiler/meson.build b/compiler/meson.build
new file mode 100644
index 0000000..c228723
--- /dev/null
+++ b/compiler/meson.build
@@ -0,0 +1,19 @@
+valac_sources = [
+       'valacompiler.vala'
+]
+
+valac_name = 'valac@0@'.format(vala_version_suffix)
+
+valac_exe = executable(
+       valac_name,
+       valac_sources,
+       dependencies: [glib_dep, valacodegen_dep],
+       install: true,
+)
+
+vala_name = 'vala@0@'.format(vala_version_suffix)
+
+# https://github.com/mesonbuild/meson/issues/1602
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ 
valac'.format(join_paths(get_option('prefix'), get_option('bindir')), valac_name))
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ 
@2@'.format(join_paths(get_option('prefix'), get_option('bindir')), valac_name, vala_name))
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ 
vala'.format(join_paths(get_option('prefix'), get_option('bindir')), valac_name))
diff --git a/config.h.meson b/config.h.meson
new file mode 100644
index 0000000..2c8f864
--- /dev/null
+++ b/config.h.meson
@@ -0,0 +1,31 @@
+/* Name of package */
+#mesondefine PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#mesondefine PACKAGE_BUGREPORT
+
+#mesondefine PACKAGE_DATADIR
+
+/* Define to the full name of this package. */
+#mesondefine PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#mesondefine PACKAGE_STRING
+
+/* Define to the suffix of this package */
+#mesondefine PACKAGE_SUFFIX
+
+/* Define to the one symbol short name of this package. */
+#mesondefine PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#mesondefine PACKAGE_URL
+
+/* Define to the version of this package. */
+#mesondefine PACKAGE_VERSION
+
+/* Version number of package */
+#mesondefine VERSION
+
+/* API-Version of package */
+#mesondefine API_VERSION
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..f3e8081
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,7 @@
+install_man(['vala-gen-introspect.1', 'valac.1', 'valadoc.1', 'vapigen.1'])
+
+# https://github.com/mesonbuild/meson/issues/1602
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@/man1; ln -fs --relative vala-gen-introspect.1.gz 
@1@'.format(join_paths(get_option('prefix'), get_option('mandir')), 'vala-gen-introspect@0  1 
gz'.format(vala_version_suffix)))
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@/man1; ln -fs --relative valac.1.gz 
@1@'.format(join_paths(get_option('prefix'), get_option('mandir')), 'valac@0  1 
gz'.format(vala_version_suffix)))
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@/man1; ln -fs --relative valadoc.1.gz 
@1@'.format(join_paths(get_option('prefix'), get_option('mandir')), 'valadoc@0  1 
gz'.format(vala_version_suffix)))
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@/man1; ln -fs --relative vapigen.1.gz 
@1@'.format(join_paths(get_option('prefix'), get_option('mandir')), 'vapigen@0  1 
gz'.format(vala_version_suffix)))
diff --git a/gee/meson.build b/gee/meson.build
new file mode 100644
index 0000000..b686add
--- /dev/null
+++ b/gee/meson.build
@@ -0,0 +1,33 @@
+valagee_sources = [
+       'arraylist.vala',
+       'collection.vala',
+       'hashmap.vala',
+       'hashset.vala',
+       'iterable.vala',
+       'iterator.vala',
+       'list.vala',
+       'mapiterator.vala',
+       'map.vala',
+       'set.vala',
+       'timsort.vala'
+]
+
+valagee_lib = static_library(
+       'valagee',
+       valagee_sources,
+       dependencies: [gobject_dep],
+       install: [ false, true, false ],
+       install_dir: [
+               false,
+               join_paths (get_option('includedir'), 'vala@0@'.format (vala_version_suffix)),
+               false
+       ],
+       vala_args: ['--use-header'],
+       vala_header: 'valagee.h',
+       vala_vapi: 'gee.vapi',
+)
+
+valagee_dep = declare_dependency(
+       link_with: [valagee_lib],
+       include_directories: include_directories('.', '..'),
+)
diff --git a/gobject-introspection/meson.build b/gobject-introspection/meson.build
new file mode 100644
index 0000000..f547ab1
--- /dev/null
+++ b/gobject-introspection/meson.build
@@ -0,0 +1,47 @@
+gidl_sources = [
+       'gidlmodule.c',
+       'gidlnode.c',
+       'gidlparser.c',
+       'gmetadata.c',
+]
+
+gidl_lib = static_library('gidl',
+       gidl_sources,
+       dependencies: [gobject_dep, gmodule_dep])
+
+gidl_dep = declare_dependency(
+       link_with: [gidl_lib],
+       include_directories: include_directories('.'),
+)
+
+flex = find_program('flex')
+bison = find_program('bison')
+
+lgen = generator(flex,
+       output: '@PLAINNAME@.c',
+       arguments: ['-o', '@OUTPUT@', '@INPUT@'])
+
+lfiles = lgen.process('scannerlexer.l')
+
+pgen = generator(bison,
+       output: ['@BASENAME@.c', '@BASENAME@.h'],
+       arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'],
+)
+
+pfiles = pgen.process('scannerparser.y')
+
+gen_introspect_sources = [
+       'gidlwriter.c',
+       'scanner.c',
+       lfiles,
+       pfiles,
+]
+
+gen_introspect_name = 'gen-introspect@0@'.format(vala_version_suffix)
+
+executable(gen_introspect_name,
+       gen_introspect_sources,
+       install: true,
+       install_dir: pkglibdir,
+       dependencies: [gobject_dep, gmodule_dep, gidl_dep],
+)
diff --git a/libvaladoc/meson.build b/libvaladoc/meson.build
new file mode 100644
index 0000000..11e725d
--- /dev/null
+++ b/libvaladoc/meson.build
@@ -0,0 +1,166 @@
+libvaladoc_sources = [
+       'doclet.vala',
+       'errorreporter.vala',
+       'filehelper.vala',
+       'moduleloader.vala',
+       'settings.vala',
+       'markupwriter.vala',
+       'gtkdocmarkupwriter.vala',
+       'devhelp-markupwriter.vala',
+       'ctyperesolver.vala',
+       'gtkdocrenderer.vala',
+       'documentation/commentscanner.vala',
+       'documentation/documentation.vala',
+       'documentation/documentationparser.vala',
+       'documentation/wiki.vala',
+       'documentation/wikiscanner.vala',
+       'documentation/gtkdoccommentparser.vala',
+       'documentation/gtkdoccommentscanner.vala',
+       'documentation/gtkdocmarkdownparser.vala',
+       'documentation/gtkdocmarkdownscanner.vala',
+       'documentation/importerhelper.vala',
+       'documentation/girmetadata.vala',
+       'importer/documentationimporter.vala',
+       'importer/valadocdocumentationimporter.vala',
+       'importer/valadocdocumentationimporterscanner.vala',
+       'importer/girdocumentationimporter.vala',
+       'importer/internalidregistrar.vala',
+       'api/symbolaccessibility.vala',
+       'api/sourcecomment.vala',
+       'api/girsourcecomment.vala',
+       'api/attributeargument.vala',
+       'api/attribute.vala',
+       'api/array.vala',
+       'api/callable.vala',
+       'api/childsymbolregistrar.vala',
+       'api/class.vala',
+       'api/constant.vala',
+       'api/delegate.vala',
+       'api/enum.vala',
+       'api/enumvalue.vala',
+       'api/errorcode.vala',
+       'api/errordomain.vala',
+       'api/field.vala',
+       'api/formalparameter.vala',
+       'api/formalparametertype.vala',
+       'api/interface.vala',
+       'api/item.vala',
+       'api/member.vala',
+       'api/method.vala',
+       'api/methodbindingtype.vala',
+       'api/namespace.vala',
+       'api/node.vala',
+       'api/nodetype.vala',
+       'api/ownership.vala',
+       'api/package.vala',
+       'api/pointer.vala',
+       'api/property.vala',
+       'api/propertyaccessor.vala',
+       'api/propertyaccessortype.vala',
+       'api/propertybindingtype.vala',
+       'api/signal.vala',
+       'api/signaturebuilder.vala',
+       'api/sourcefile.vala',
+       'api/struct.vala',
+       'api/symbol.vala',
+       'api/tree.vala',
+       'api/typeparameter.vala',
+       'api/typereference.vala',
+       'api/typesymbol.vala',
+       'api/browsable.vala',
+       'api/visitor.vala',
+       'api/driver.vala',
+       'content/block.vala',
+       'content/blockcontent.vala',
+       'content/comment.vala',
+       'content/contentfactory.vala',
+       'content/contentelement.vala',
+       'content/contentrenderer.vala',
+       'content/contentvisitor.vala',
+       'content/embedded.vala',
+       'content/headline.vala',
+       'content/inline.vala',
+       'content/inlinetaglet.vala',
+       'content/inlinecontent.vala',
+       'content/wikilink.vala',
+       'content/link.vala',
+       'content/list.vala',
+       'content/listitem.vala',
+       'content/page.vala',
+       'content/paragraph.vala',
+       'content/warning.vala',
+       'content/note.vala',
+       'content/resourcelocator.vala',
+       'content/run.vala',
+       'content/sourcecode.vala',
+       'content/styleattributes.vala',
+       'content/symbollink.vala',
+       'content/table.vala',
+       'content/tablecell.vala',
+       'content/tablerow.vala',
+       'content/taglet.vala',
+       'content/text.vala',
+       'charts/chart.vala',
+       'charts/chartfactory.vala',
+       'charts/hierarchychart.vala',
+       'charts/simplechartfactory.vala',
+       'parser/manyrule.vala',
+       'parser/oneofrule.vala',
+       'parser/optionalrule.vala',
+       'parser/parser.vala',
+       'parser/parsercallback.vala',
+       'parser/rule.vala',
+       'parser/scanner.vala',
+       'parser/sequencerule.vala',
+       'parser/stubrule.vala',
+       'parser/token.vala',
+       'parser/tokentype.vala',
+       'taglets/tagletdeprecated.vala',
+       'taglets/tagletinheritdoc.vala',
+       'taglets/tagletinit.vala',
+       'taglets/tagletlink.vala',
+       'taglets/tagletparam.vala',
+       'taglets/tagletreturn.vala',
+       'taglets/tagletsee.vala',
+       'taglets/tagletsince.vala',
+       'taglets/tagletthrows.vala',
+       'highlighter/scanner.vala',
+       'highlighter/codescanner.vala',
+       'highlighter/xmlscanner.vala',
+       'highlighter/codetoken.vala',
+       'highlighter/highlighter.vala',
+       'html/basicdoclet.vala',
+       'html/htmlchartfactory.vala',
+       'html/linkhelper.vala',
+       'html/cssclassresolver.vala',
+       'html/htmlmarkupwriter.vala',
+       'html/htmlrenderer.vala',
+]
+
+libvaladoc_lib = shared_library(
+       'valadoc@0@'.format(vala_version_suffix),
+       libvaladoc_sources,
+       dependencies: [gmodule_dep, valacore_dep, libgvc_dep],
+       soversion: '0.0.0',
+       install: true,
+       install_dir: [
+               true,
+               join_paths (get_option('includedir'), 'valadoc@0@'.format (vala_version_suffix)),
+               true
+       ],
+       c_args: ['-DPACKAGE_ICONDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'), 
'valadoc', 'icons'))],
+       vala_args: ['--use-header'],
+       vala_header: 'valadoc.h',
+       vala_vapi: 'valadoc@0@.vapi'.format(vala_version_suffix),
+)
+
+libvaladoc_dep = declare_dependency(link_with: [libvaladoc_lib], dependencies: [gmodule_dep, valacore_dep, 
libgvc_dep], include_directories: include_directories('.'))
+
+configure_file(input: 'valadoc.deps.in', output: 'valadoc@0@.deps'.format(vala_version_suffix), 
configuration: pkgconf)
+
+configure_file(
+       input: 'valadoc.pc.in',
+       output: 'valadoc@0@.pc'.format(vala_version_suffix),
+       configuration: pkgconf,
+       install_dir: pkg_install_dir,
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..833d35f
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,130 @@
+project('vala',
+       'c', 'vala',
+       version: '0.39.0',
+       meson_version: '>= 0.43',
+       license: 'LGPL2.1'
+)
+
+vala_version_required = '0.16.1'
+vala = meson.get_compiler('vala')
+if not vala.version().version_compare('>= @0@'.format(vala_version_required))
+       error('valac >= @0@ required!'.format(vala_version_required))
+endif
+
+vala_version = meson.project_version()
+vala_api_version = '0.40'
+vala_version_suffix = '-@0@'.format(vala_api_version)
+
+pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'vala@0@'.format(vala_version_suffix))
+pkglibdir = join_paths(get_option('prefix'), get_option('libdir'), 'vala@0@'.format(vala_version_suffix))
+
+
+conf = configuration_data()
+conf.set_quoted('PACKAGE', meson.project_name())
+conf.set_quoted('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/browse.cgi?product=vala')
+conf.set_quoted('PACKAGE_DATADIR', pkgdatadir)
+conf.set_quoted('PACKAGE_NAME', meson.project_name())
+conf.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), vala_version))
+conf.set_quoted('PACKAGE_SUFFIX', vala_version_suffix)
+conf.set_quoted('PACKAGE_TARNAME', meson.project_name())
+conf.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Projects/Vala')
+conf.set_quoted('PACKAGE_VERSION', vala_version)
+conf.set_quoted('VERSION', vala_version)
+conf.set_quoted('API_VERSION', vala_api_version)
+conf.set_quoted('BUILD_VERSION', vala_version)
+configure_file(input: 'config.h.meson', output: 'config.h', configuration: conf)
+
+
+vcs_tag(input: 'version.h.meson', output: 'version.h')
+
+
+pkgconf = configuration_data()
+pkgconf.set('prefix', get_option('prefix'))
+pkgconf.set('exec_prefix', '${prefix}')
+pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+pkgconf.set('bindir', '${exec_prefix}/@0@'.format(get_option('bindir')))
+pkgconf.set('datarootdir', '${prefix}/@0@'.format(get_option('datadir')))
+pkgconf.set('datadir', '${datarootdir}')
+pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
+pkgconf.set('pkgdatadir', '${datarootdir}/vala@0@'.format(vala_version_suffix))
+pkgconf.set('pkglibdir', '${exec_prefix}/@0@'.format(get_option('libdir'), 
'vala@0@'.format(vala_version_suffix)))
+pkgconf.set('PACKAGE_SUFFIX', vala_version_suffix)
+pkgconf.set('VERSION', vala_version)
+pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
+
+configure_file(
+       input: 'libvala.pc.in',
+       output: 'libvala@0@.pc'.format(vala_version_suffix),
+       configuration: pkgconf,
+       install_dir: pkg_install_dir
+)
+
+add_project_arguments([
+               '--disable-version-header',
+               '--hide-internal',
+               '--vapidir', join_paths(meson.source_root(), 'vapi'),
+               '--pkg', 'config',
+       ],
+       language: 'vala'
+)
+
+add_project_arguments([
+               '-Wno-discarded-qualifiers',
+               '-Wno-incompatible-pointer-types',
+               '-Wno-unused',
+               '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40',
+               '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40',
+       ],
+       language: 'c',
+)
+
+glib_version_required = '2.40.0'
+libgvc_version_required = '2.16'
+
+glib_dep = dependency('glib-2.0', version: '>= @0@'.format(glib_version_required))
+gobject_dep = dependency('gobject-2.0', version: '>= @0@'.format(glib_version_required))
+gmodule_dep = dependency('gmodule-2.0', version: '>= @0@'.format(glib_version_required))
+libgvc_dep = dependency('libgvc', version: '>= @0@'.format(libgvc_version_required))
+
+# Check for CGraph support of libgvc
+cc = meson.get_compiler('c')
+if cc.run('''#include <gvc.h>
+               int main(void) {
+               #ifdef WITH_CGRAPH
+                       return 0;
+               #else
+                       return -1;
+               #endif
+               }''',
+               dependencies: libgvc_dep).returncode() == 0
+       add_project_arguments('-D', 'WITH_CGRAPH', language: 'vala')
+endif
+
+subdir('gobject-introspection')
+subdir('gee')
+subdir('vala')
+subdir('ccode')
+subdir('codegen')
+subdir('compiler')
+subdir('vapigen')
+subdir('libvaladoc')
+subdir('valadoc')
+subdir('vapi')
+subdir('doc')
+
+install_data('vala.m4', install_dir: join_paths('share', 'aclocal'))
+
+pycat = find_program(join_paths(meson.source_root(), 'build-aux', 'meson', 'cat.py'))
+#custom_target(
+#      'libvala@0@.vapi'.format(vala_version_suffix),
+#      command: [pycat, '@INPUT@'],
+#      depends: [valagee_lib, valacore_lib],
+#      capture: true,
+#      install: true,
+#      install_dir: join_paths('share', 'vala', 'vapi'),
+#      input: [
+#              join_paths(meson.current_build_dir(), 'gee', 'gee.vapi'),
+#              join_paths(meson.current_build_dir(), 'vala', 'vala.vapi'),
+#      ],
+#      output: 'libvala@0@.vapi'.format(vala_version_suffix),
+#)
diff --git a/unversioned-install.sh b/unversioned-install.sh
new file mode 100644
index 0000000..fcc9178
--- /dev/null
+++ b/unversioned-install.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cd "${DESTDIR}/${MESON_INSTALL_PREFIX}/mydir"
+ln -s -f "${DESTDIR}/${MESON_INSTALL_PREFIX}/mydir"
+touch "${DESTDIR}/${MESON_INSTALL_PREFIX}/mydir/file.dat"
+
+install-exec-hook:
+       cd $(DESTDIR)$(bindir) && $(LN_S) -f vapigen@PACKAGE_SUFFIX@$(EXEEXT) vapigen$(EXEEXT)
+       cd $(DESTDIR)$(bindir) && $(LN_S) -f vapicheck@PACKAGE_SUFFIX@$(EXEEXT) vapicheck$(EXEEXT)
+
+install-data-hook:
+       cd $(DESTDIR)$(pkgconfigdir) && $(LN_S) -f vapigen@PACKAGE_SUFFIX@.pc vapigen.pc
+
diff --git a/vala/meson.build b/vala/meson.build
new file mode 100644
index 0000000..eba0323
--- /dev/null
+++ b/vala/meson.build
@@ -0,0 +1,174 @@
+valacore_sources = [
+       'valaaddressofexpression.vala',
+       'valaarraycopymethod.vala',
+       'valaarraycreationexpression.vala',
+       'valaarraylengthfield.vala',
+       'valaarraymovemethod.vala',
+       'valaarrayresizemethod.vala',
+       'valaarraytype.vala',
+       'valaassignment.vala',
+       'valaattribute.vala',
+       'valabaseaccess.vala',
+       'valabasicblock.vala',
+       'valabinaryexpression.vala',
+       'valablock.vala',
+       'valabooleanliteral.vala',
+       'valabooleantype.vala',
+       'valabreakstatement.vala',
+       'valacallable.vala',
+       'valacallabletype.vala',
+       'valacastexpression.vala',
+       'valacatchclause.vala',
+       'valacharacterliteral.vala',
+       'valaclasstype.vala',
+       'valaclass.vala',
+       'valacodecontext.vala',
+       'valacodegenerator.vala',
+       'valacodenode.vala',
+       'valacodevisitor.vala',
+       'valacodewriter.vala',
+       'valacomment.vala',
+       'valaconditionalexpression.vala',
+       'valaconstant.vala',
+       'valaconstructor.vala',
+       'valacontinuestatement.vala',
+       'valacreationmethod.vala',
+       'valadatatype.vala',
+       'valadeclarationstatement.vala',
+       'valadelegatetype.vala',
+       'valadelegate.vala',
+       'valadeletestatement.vala',
+       'valadestructor.vala',
+       'valadostatement.vala',
+       'valadynamicmethod.vala',
+       'valadynamicproperty.vala',
+       'valadynamicsignal.vala',
+       'valaelementaccess.vala',
+       'valaemptystatement.vala',
+       'valaenum.vala',
+       'valaenumvaluetype.vala',
+       'valaenumvalue.vala',
+       'valaerrorcode.vala',
+       'valaerrordomain.vala',
+       'valaerrortype.vala',
+       'valaexpressionstatement.vala',
+       'valaexpression.vala',
+       'valafieldprototype.vala',
+       'valafield.vala',
+       'valafloatingtype.vala',
+       'valaflowanalyzer.vala',
+       'valaforeachstatement.vala',
+       'valaforstatement.vala',
+       'valagenerictype.vala',
+       'valagenieparser.vala',
+       'valageniescanner.vala',
+       'valagenietokentype.vala',
+       'valagircomment.vala',
+       'valagirparser.vala',
+       'valaifstatement.vala',
+       'valainitializerlist.vala',
+       'valaintegerliteral.vala',
+       'valaintegertype.vala',
+       'valainterfacetype.vala',
+       'valainterface.vala',
+       'valainvalidtype.vala',
+       'valalambdaexpression.vala',
+       'valaliteral.vala',
+       'valalocalvariable.vala',
+       'valalockable.vala',
+       'valalockstatement.vala',
+       'valaloop.vala',
+       'valamarkupreader.vala',
+       'valamemberaccess.vala',
+       'valamemberinitializer.vala',
+       'valamethodcall.vala',
+       'valamethodtype.vala',
+       'valamethod.vala',
+       'valanamedargument.vala',
+       'valanamespace.vala',
+       'valanullliteral.vala',
+       'valanulltype.vala',
+       'valaobjectcreationexpression.vala',
+       'valaobjecttypesymbol.vala',
+       'valaobjecttype.vala',
+       'valaparameter.vala',
+       'valaparser.vala',
+       'valaphifunction.vala',
+       'valapointerindirection.vala',
+       'valapointertype.vala',
+       'valapostfixexpression.vala',
+       'valaprofile.vala',
+       'valapropertyaccessor.vala',
+       'valaproperty.vala',
+       'valarealliteral.vala',
+       'valareferencetransferexpression.vala',
+       'valareferencetype.vala',
+       'valaregexliteral.vala',
+       'valareport.vala',
+       'valareturnstatement.vala',
+       'valascanner.vala',
+       'valascope.vala',
+       'valasemanticanalyzer.vala',
+       'valasignaltype.vala',
+       'valasignal.vala',
+       'valasizeofexpression.vala',
+       'valasliceexpression.vala',
+       'valasourcefile.vala',
+       'valasourcelocation.vala',
+       'valasourcereference.vala',
+       'valastatementlist.vala',
+       'valastatement.vala',
+       'valastringliteral.vala',
+       'valastruct.vala',
+       'valastructvaluetype.vala',
+       'valasubroutine.vala',
+       'valaswitchlabel.vala',
+       'valaswitchsection.vala',
+       'valaswitchstatement.vala',
+       'valasymbolresolver.vala',
+       'valasymbol.vala',
+       'valatargetvalue.vala',
+       'valatemplate.vala',
+       'valathrowstatement.vala',
+       'valatokentype.vala',
+       'valatrystatement.vala',
+       'valatuple.vala',
+       'valatypecheck.vala',
+       'valatypeofexpression.vala',
+       'valatypeparameter.vala',
+       'valatypesymbol.vala',
+       'valaunaryexpression.vala',
+       'valaunlockstatement.vala',
+       'valaunresolvedsymbol.vala',
+       'valaunresolvedtype.vala',
+       'valausedattr.vala',
+       'valausingdirective.vala',
+       'valavaluetype.vala',
+       'valavariable.vala',
+       'valaversionattribute.vala',
+       'valavoidtype.vala',
+       'valawhilestatement.vala',
+       'valayieldstatement.vala',
+]
+
+valacore_lib = shared_library(
+       'vala@0@'.format(vala_version_suffix),
+       valacore_sources,
+       dependencies: [gobject_dep, gmodule_dep, valagee_dep],
+       soversion: '0.0.0',
+       install: true,
+       vala_args: ['--use-header'],
+       vala_header: 'vala.h',
+       vala_vapi: 'vala.vapi',
+       install_dir: [
+               true,
+               join_paths (get_option('includedir'), 'vala@0@'.format (vala_version_suffix)),
+               false
+       ],
+)
+
+valacore_dep = declare_dependency(
+       link_with: [valacore_lib],
+       dependencies: [valagee_dep],
+       include_directories: include_directories('.', '..'),
+)
diff --git a/valadoc/doclets/devhelp/meson.build b/valadoc/doclets/devhelp/meson.build
new file mode 100644
index 0000000..a3c79c6
--- /dev/null
+++ b/valadoc/doclets/devhelp/meson.build
@@ -0,0 +1,12 @@
+doclet_devhelp_sources = [
+       'doclet.vala',
+]
+
+shared_module(
+       'doclet',
+       doclet_devhelp_sources,
+       dependencies: [gobject_dep, libvaladoc_dep],
+       install: true,
+       install_dir: join_paths(get_option('libdir'), 'valadoc', 'doclets', 'devhelp'),
+       c_args: ['-DPACKAGE_ICONDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'), 
'valadoc', 'icons'))],
+)
diff --git a/valadoc/doclets/gtkdoc/meson.build b/valadoc/doclets/gtkdoc/meson.build
new file mode 100644
index 0000000..68e2bfe
--- /dev/null
+++ b/valadoc/doclets/gtkdoc/meson.build
@@ -0,0 +1,17 @@
+doclet_gtkdoc_sources = [
+       'commentconverter.vala',
+       'dbus.vala',
+       'doclet.vala',
+       'gcomment.vala',
+       'generator.vala',
+       'utils.vala',
+]
+
+shared_module(
+       'doclet',
+       doclet_gtkdoc_sources,
+       dependencies: [gobject_dep, libvaladoc_dep],
+       install: true,
+       install_dir: join_paths (get_option('libdir'), 'valadoc', 'doclets', 'gtkdoc'),
+       c_args: ['-DPACKAGE_ICONDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'), 
'valadoc', 'icons'))],
+)
diff --git a/valadoc/doclets/html/meson.build b/valadoc/doclets/html/meson.build
new file mode 100644
index 0000000..aee2242
--- /dev/null
+++ b/valadoc/doclets/html/meson.build
@@ -0,0 +1,12 @@
+doclet_html_sources = [
+       'doclet.vala',
+]
+
+shared_module(
+       'doclet',
+       doclet_html_sources,
+       dependencies: [gobject_dep, libvaladoc_dep],
+       install: true,
+       install_dir: join_paths (get_option('libdir'), 'valadoc', 'doclets', 'html'),
+       c_args: ['-DPACKAGE_ICONDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'), 
'valadoc', 'icons'))],
+)
diff --git a/valadoc/doclets/meson.build b/valadoc/doclets/meson.build
new file mode 100644
index 0000000..b517bf4
--- /dev/null
+++ b/valadoc/doclets/meson.build
@@ -0,0 +1,4 @@
+# FIXME clashing shared_module targetnames
+#subdir('devhelp')
+#subdir('gtkdoc')
+subdir('html')
diff --git a/valadoc/icons/meson.build b/valadoc/icons/meson.build
new file mode 100644
index 0000000..194f957
--- /dev/null
+++ b/valadoc/icons/meson.build
@@ -0,0 +1,35 @@
+install_data([
+               'abstractclass.png',
+               'abstractmethod.png',
+               'abstractproperty.png',
+               'class.png',
+               'coll_close.png',
+               'coll_open.png',
+               'constant.png',
+               'constructor.png',
+               'delegate.png',
+               'devhelpstyle.css',
+               'enum.png',
+               'enumvalue.png',
+               'errorcode.png',
+               'errordomain.png',
+               'field.png',
+               'interface.png',
+               'method.png',
+               'namespace.png',
+               'package.png',
+               'packages.png',
+               'property.png',
+               'scripts.js',
+               'signal.png',
+               'staticmethod.png',
+               'struct.png',
+               'style.css',
+               'tip.png',
+               'virtualmethod.png',
+               'virtualproperty.png',
+               'warning.png',
+               'wikistyle.css',
+       ],
+       install_dir: join_paths('share', 'valadoc', 'icons'),
+)
diff --git a/valadoc/meson.build b/valadoc/meson.build
new file mode 100644
index 0000000..7abe14a
--- /dev/null
+++ b/valadoc/meson.build
@@ -0,0 +1,23 @@
+valadoc_sources = [
+       'driver.vala',
+       'girwriter.vala',
+       'initializerbuilder.vala',
+       'symbolresolver.vala',
+       'treebuilder.vala',
+       'valadoc.vala',
+]
+
+valadoc_name = 'valadoc@0@'.format(vala_version_suffix)
+
+executable(
+       valadoc_name,
+       valadoc_sources,
+       dependencies: [gobject_dep, valacodegen_dep, libvaladoc_dep],
+       install: true,
+)
+
+# https://github.com/mesonbuild/meson/issues/1602
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ 
valadoc'.format(join_paths(get_option('prefix'), get_option('bindir')), valadoc_name))
+
+subdir('doclets')
+subdir('icons')
diff --git a/vapi/meson.build b/vapi/meson.build
new file mode 100644
index 0000000..ca23b83
--- /dev/null
+++ b/vapi/meson.build
@@ -0,0 +1,315 @@
+vapis = [
+       'alsa.vapi',
+       'alsa.deps',
+       'atk.vapi',
+       'atspi-2.vapi',
+       'atspi-2.deps',
+       'avahi-client.vapi',
+       'avahi-gobject.deps',
+       'avahi-gobject.vapi',
+       'bzlib.vapi',
+       'cairo.vapi',
+       'cairo-xcb.deps',
+       'cairo-xcb.vapi',
+       'ccss-1.vapi',
+       'clutter-1.0.deps',
+       'clutter-1.0.vapi',
+       'clutter-gdk-1.0.deps',
+       'clutter-gdk-1.0.vapi',
+       'clutter-gst-1.0.deps',
+       'clutter-gst-1.0.vapi',
+       'clutter-gst-2.0.deps',
+       'clutter-gst-2.0.vapi',
+       'clutter-gst-3.0.deps',
+       'clutter-gst-3.0.vapi',
+       'clutter-gtk-0.10.deps',
+       'clutter-gtk-0.10.vapi',
+       'clutter-gtk-1.0.deps',
+       'clutter-gtk-1.0.vapi',
+       'clutter-x11-1.0.deps',
+       'clutter-x11-1.0.vapi',
+       'cogl-1.0.vapi',
+       'cogl-1.0.deps',
+       'cogl-pango-1.0.vapi',
+       'cogl-pango-1.0.deps',
+       'curses.vapi',
+       'dbus-glib-1.vapi',
+       'enchant.vapi',
+       'fuse.deps',
+       'fuse.vapi',
+       'gconf-2.0.vapi',
+       'geocode-glib-1.0.deps',
+       'geocode-glib-1.0.vapi',
+       'glib-2.0.vapi',
+       'gdk-2.0.deps',
+       'gdk-2.0.vapi',
+       'gdk-3.0.deps',
+       'gdk-3.0.vapi',
+       'gdk-pixbuf-2.0.deps',
+       'gdk-pixbuf-2.0.vapi',
+       'gdk-x11-2.0.deps',
+       'gdk-x11-2.0.vapi',
+       'gdk-x11-3.0.deps',
+       'gdk-x11-3.0.vapi',
+       'gdl-1.0.deps',
+       'gdl-1.0.vapi',
+       'gdl-3.0.deps',
+       'gdl-3.0.vapi',
+       'gdu.deps',
+       'gdu.vapi',
+       'gdu-gtk.deps',
+       'gdu-gtk.vapi',
+       'gedit-2.20.vapi',
+       'gedit-2.20.deps',
+       'gio-2.0.vapi',
+       'gio-unix-2.0.deps',
+       'gio-unix-2.0.vapi',
+       'gio-windows-2.0.deps',
+       'gio-windows-2.0.vapi',
+       'gmodule-2.0.vapi',
+       'gnet-2.0.deps',
+       'gnet-2.0.vapi',
+       'gnome-desktop-2.0.deps',
+       'gnome-desktop-2.0.vapi',
+       'gnome-vfs-2.0.vapi',
+       'gnutls.vapi',
+       'gobject-2.0.vapi',
+       'gobject-introspection-1.0.vapi',
+       'goocanvas.deps',
+       'goocanvas.vapi',
+       'graphene-1.0.deps',
+       'graphene-1.0.vapi',
+       'gsl.vapi',
+       'gstreamer-0.10.deps',
+       'gstreamer-0.10.vapi',
+       'gstreamer-app-0.10.deps',
+       'gstreamer-app-0.10.vapi',
+       'gstreamer-audio-0.10.deps',
+       'gstreamer-audio-0.10.vapi',
+       'gstreamer-base-0.10.deps',
+       'gstreamer-base-0.10.vapi',
+       'gstreamer-cdda-0.10.deps',
+       'gstreamer-cdda-0.10.vapi',
+       'gstreamer-check-0.10.deps',
+       'gstreamer-check-0.10.vapi',
+       'gstreamer-controller-0.10.deps',
+       'gstreamer-controller-0.10.vapi',
+       'gstreamer-dataprotocol-0.10.deps',
+       'gstreamer-dataprotocol-0.10.vapi',
+       'gstreamer-fft-0.10.deps',
+       'gstreamer-fft-0.10.vapi',
+       'gstreamer-interfaces-0.10.deps',
+       'gstreamer-interfaces-0.10.vapi',
+       'gstreamer-net-0.10.deps',
+       'gstreamer-net-0.10.vapi',
+       'gstreamer-netbuffer-0.10.deps',
+       'gstreamer-netbuffer-0.10.vapi',
+       'gstreamer-pbutils-0.10.deps',
+       'gstreamer-pbutils-0.10.vapi',
+       'gstreamer-riff-0.10.deps',
+       'gstreamer-riff-0.10.vapi',
+       'gstreamer-rtp-0.10.deps',
+       'gstreamer-rtp-0.10.vapi',
+       'gstreamer-rtsp-0.10.deps',
+       'gstreamer-rtsp-0.10.vapi',
+       'gstreamer-sdp-0.10.deps',
+       'gstreamer-sdp-0.10.vapi',
+       'gstreamer-tag-0.10.deps',
+       'gstreamer-tag-0.10.vapi',
+       'gstreamer-video-0.10.deps',
+       'gstreamer-video-0.10.vapi',
+       'gstreamer-1.0.vapi',
+       'gstreamer-allocators-1.0.vapi',
+       'gstreamer-allocators-1.0.deps',
+       'gstreamer-app-1.0.vapi',
+       'gstreamer-app-1.0.deps',
+       'gstreamer-audio-1.0.vapi',
+       'gstreamer-audio-1.0.deps',
+       'gstreamer-bad-allocators-1.0.deps',
+       'gstreamer-bad-allocators-1.0.vapi',
+       'gstreamer-base-1.0.vapi',
+       'gstreamer-base-1.0.deps',
+       'gstreamer-check-1.0.vapi',
+       'gstreamer-check-1.0.deps',
+       'gstreamer-controller-1.0.vapi',
+       'gstreamer-controller-1.0.deps',
+       'gstreamer-fft-1.0.vapi',
+       'gstreamer-fft-1.0.deps',
+       'gstreamer-net-1.0.vapi',
+       'gstreamer-net-1.0.deps',
+       'gstreamer-pbutils-1.0.vapi',
+       'gstreamer-pbutils-1.0.deps',
+       'gstreamer-player-1.0.vapi',
+       'gstreamer-player-1.0.deps',
+       'gstreamer-riff-1.0.deps',
+       'gstreamer-riff-1.0.vapi',
+       'gstreamer-rtp-1.0.vapi',
+       'gstreamer-rtp-1.0.deps',
+       'gstreamer-rtsp-1.0.vapi',
+       'gstreamer-rtsp-1.0.deps',
+       'gstreamer-rtsp-server-1.0.vapi',
+       'gstreamer-rtsp-server-1.0.deps',
+       'gstreamer-sdp-1.0.vapi',
+       'gstreamer-sdp-1.0.deps',
+       'gstreamer-tag-1.0.vapi',
+       'gstreamer-tag-1.0.deps',
+       'gstreamer-video-1.0.vapi',
+       'gstreamer-video-1.0.deps',
+       'gtk+-2.0.deps',
+       'gtk+-2.0.vapi',
+       'gtk+-3.0.deps',
+       'gtk+-3.0.vapi',
+       'gtk+-4.0.deps',
+       'gtk+-4.0.vapi',
+       'gtk+-unix-print-2.0.deps',
+       'gtk+-unix-print-2.0.vapi',
+       'gtk+-unix-print-3.0.deps',
+       'gtk+-unix-print-3.0.vapi',
+       'gtk+-unix-print-4.0.deps',
+       'gtk+-unix-print-4.0.vapi',
+       'gtkmozembed.deps',
+       'gtkmozembed.vapi',
+       'gtksourceview-2.0.deps',
+       'gtksourceview-2.0.vapi',
+       'gudev-1.0.deps',
+       'gudev-1.0.vapi',
+       'hal.deps',
+       'hal.vapi',
+       'hildon-1.deps',
+       'hildon-1.vapi',
+       'hildon-fm-2.deps',
+       'hildon-fm-2.vapi',
+       'json-glib-1.0.deps',
+       'json-glib-1.0.vapi',
+       'libarchive.deps',
+       'libarchive.vapi',
+       'libbonoboui-2.0.vapi',
+       'libdaemon.vapi',
+       'libepc-1.0.vapi',
+       'libesmtp.vapi',
+       'libftdi.deps',
+       'libftdi.vapi',
+       'libgda-report-4.0.deps',
+       'libgda-report-4.0.vapi',
+       'libgda-4.0.deps',
+       'libgda-4.0.vapi',
+       'libglade-2.0.deps',
+       'libglade-2.0.vapi',
+       'libgnome-2.0.vapi',
+       'libgnome-menu.vapi',
+       'libgnome-menu-3.0.vapi',
+       'libgnomeui-2.0.deps',
+       'libgnomeui-2.0.vapi',
+       'libgrss.deps',
+       'libgrss.vapi',
+       'libgsf-1.deps',
+       'libgsf-1.vapi',
+       'libgvc.vapi',
+       'libmagic.vapi',
+       'libnl-1.vapi',
+       'libnl-2.0.deps',
+       'libnl-2.0.vapi',
+       'libnl-3.0.deps',
+       'libnl-3.0.vapi',
+       'libnotify.deps',
+       'libnotify.vapi',
+       'liboobs-1.vapi',
+       'libosso.vapi',
+       'libpanelapplet-2.0.deps',
+       'libpanelapplet-2.0.vapi',
+       'libpeas-1.0.deps',
+       'libpeas-1.0.vapi',
+       'libpeas-gtk-1.0.deps',
+       'libpeas-gtk-1.0.vapi',
+       'libpq.vapi',
+       'libsexy.deps',
+       'libsexy.vapi',
+       'libsoup-2.2.vapi',
+       'libsoup-2.4.deps',
+       'libsoup-2.4.vapi',
+       'libusb.vapi',
+       'libusb-1.0.deps',
+       'libusb-1.0.vapi',
+       'libwnck-1.0.deps',
+       'libwnck-1.0.vapi',
+       'libwnck-3.0.deps',
+       'libwnck-3.0.vapi',
+       'libxml-2.0.vapi',
+       'linux.deps',
+       'linux.vapi',
+       'loudmouth-1.0.vapi',
+       'lua.vapi',
+       'mx-1.0.deps',
+       'mx-1.0.vapi',
+       'mysql.vapi',
+       'orc-0.4.vapi',
+       'packagekit-glib2.deps',
+       'packagekit-glib2.vapi',
+       'pango.deps',
+       'pango.vapi',
+       'pangocairo.deps',
+       'pangocairo.vapi',
+       'pixman-1.vapi',
+       'polkit-agent-1.deps',
+       'polkit-agent-1.vapi',
+       'polkit-gobject-1.deps',
+       'polkit-gobject-1.vapi',
+       'poppler-glib.deps',
+       'poppler-glib.vapi',
+       'posix.vapi',
+       'purple.deps',
+       'purple.vapi',
+       'raptor.vapi',
+       'rasqal.vapi',
+       'rasqal.deps',
+       'readline.vapi',
+       'rest-0.6.deps',
+       'rest-0.6.vapi',
+       'rest-extras-0.6.deps',
+       'rest-extras-0.6.vapi',
+       'rest-0.7.deps',
+       'rest-0.7.vapi',
+       'rest-extras-0.7.deps',
+       'rest-extras-0.7.vapi',
+       'sdl.vapi',
+       'sdl-gfx.vapi',
+       'sdl-gfx.deps',
+       'sdl-image.vapi',
+       'sdl-image.deps',
+       'sdl-mixer.vapi',
+       'sdl-mixer.deps',
+       'sdl-net.vapi',
+       'sdl-net.deps',
+       'sdl-ttf.vapi',
+       'sdl-ttf.deps',
+       'sqlite3.vapi',
+       'taglib_c.vapi',
+       'tiff.vapi',
+       'tokyocabinet.vapi',
+       'tracker-indexer-module-1.0.vapi',
+       'twitter-glib-1.0.deps',
+       'twitter-glib-1.0.vapi',
+       'udisks2.deps',
+       'udisks2.vapi',
+       'unique-1.0.deps',
+       'unique-1.0.vapi',
+       'v4l2.vapi',
+       'vte.deps',
+       'vte.vapi',
+       'vte-2.90.deps',
+       'vte-2.90.vapi',
+       'webkit-1.0.deps',
+       'webkit-1.0.vapi',
+       'webkit2gtk-4.0.vapi',
+       'webkit2gtk-4.0.deps',
+       'webkit2gtk-web-extension-4.0.vapi',
+       'webkit2gtk-web-extension-4.0.deps',
+       'x11.vapi',
+       'xcb.vapi',
+       'xcb-icccm.vapi',
+       'xtst.vapi',
+       'xtst.deps',
+       'zlib.vapi',
+]
+
+install_data(vapis, install_dir: join_paths('share', 'vala@0@'.format(vala_version_suffix), 'vapi'))
diff --git a/vapigen/meson.build b/vapigen/meson.build
new file mode 100644
index 0000000..44dd501
--- /dev/null
+++ b/vapigen/meson.build
@@ -0,0 +1,46 @@
+vapigen_sources = [
+       'valagidlparser.vala',
+       'valavapigen.vala',
+]
+
+vapigen_name = 'vapigen@0@'.format(vala_version_suffix)
+
+vapigen_exe = executable(
+       vapigen_name,
+       vapigen_sources,
+       dependencies: [glib_dep, valagee_dep, valacore_dep, gidl_dep],
+       install: true,
+       vala_args: ['--pkg', 'gidl', '--vapidir', join_paths(meson.source_root(), 'gobject-introspection')],
+)
+
+# https://github.com/mesonbuild/meson/issues/1602
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ 
vapigen'.format(join_paths(get_option('prefix'), get_option('bindir')), vapigen_name))
+
+vapicheck_sources = [
+       'valavapicheck.vala',
+]
+
+vapicheck_name = 'vapicheck@0@'.format(vala_version_suffix)
+
+executable(
+       vapicheck_name,
+       vapicheck_sources,
+       dependencies: [glib_dep, valagee_dep, valacore_dep, gidl_dep],
+       install: true,
+       vala_args: ['--pkg', 'gidl', '--vapidir', join_paths(meson.source_root(), 'gobject-introspection')],
+)
+
+# https://github.com/mesonbuild/meson/issues/1602
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ 
vapicheck'.format(join_paths(get_option('prefix'), get_option('bindir')), vapicheck_name))
+
+configure_file(
+       input: 'vapigen.pc.in',
+       output: 'vapigen@0@.pc'.format(vala_version_suffix),
+       configuration: pkgconf,
+       install_dir: pkg_install_dir,
+)
+
+install_data('vapigen.m4', install_dir: join_paths('share', 'aclocal'))
+install_data('Makefile.vapigen', install_dir: join_paths('share', 'vala'))
+
+subdir('vala-gen-introspect')
diff --git a/vapigen/vala-gen-introspect/meson.build b/vapigen/vala-gen-introspect/meson.build
new file mode 100644
index 0000000..89af89b
--- /dev/null
+++ b/vapigen/vala-gen-introspect/meson.build
@@ -0,0 +1,9 @@
+configure_file(
+       input: 'vala-gen-introspect.in',
+       output: 'vala-gen-introspect@0@'.format(vala_version_suffix),
+       configuration: pkgconf,
+       install_dir: join_paths(get_option('prefix'), get_option('bindir')),
+)
+
+# https://github.com/mesonbuild/meson/issues/1602
+meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs @1@ 
vala-gen-introspect'.format(join_paths(get_option('prefix'), get_option('bindir')), 
'vala-gen-introspect@0@'.format(vala_version_suffix)))
diff --git a/version.h.meson b/version.h.meson
new file mode 100644
index 0000000..1f0cf79
--- /dev/null
+++ b/version.h.meson
@@ -0,0 +1,2 @@
+/* Define to the build version of this package. */
+#define BUILD_VERSION "@VCS_TAG@"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]