[vala/wip/meson] WIP Add Meson build system



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

    WIP Add Meson build system

 ccode/meson.build                 |   66 +++++++++++++++
 codegen/meson.build               |   40 +++++++++
 compiler/meson.build              |   12 +++
 config.h.meson                    |   28 +++++++
 gee/meson.build                   |   21 +++++
 gobject-introspection/meson.build |   42 ++++++++++
 meson.build                       |   65 +++++++++++++++
 vala/meson.build                  |  163 +++++++++++++++++++++++++++++++++++++
 vapigen/meson.build               |   26 ++++++
 version.h.meson                   |    2 +
 10 files changed, 465 insertions(+), 0 deletions(-)
---
diff --git a/ccode/meson.build b/ccode/meson.build
new file mode 100644
index 0000000..4f16f59
--- /dev/null
+++ b/ccode/meson.build
@@ -0,0 +1,66 @@
+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 = shared_library('valaccode',
+       valaccode_sources,
+       dependencies: [glib, gobject, valagee, valacore],
+       install: false,
+       include_directories: include_directories('.', meson.build_root()),
+       vala_args: ['--pkg=config', '--vapidir=' + join_paths(meson.source_root(), 'vapi')])
+
+valaccode = declare_dependency(link_with: [valaccode_lib], include_directories: include_directories('.'))
+
+#install_headers(join_paths(meson.current_build_dir(), 'valaccode.h'), subdir: 
'vala@0@'.format(vala_version_suffix))
diff --git a/codegen/meson.build b/codegen/meson.build
new file mode 100644
index 0000000..4d3a36e
--- /dev/null
+++ b/codegen/meson.build
@@ -0,0 +1,40 @@
+valacodegen_sources = [
+       '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('vala@0@'.format(vala_version_suffix),
+       valacodegen_sources,
+       dependencies: [glib, gobject, valagee, valaccode, valacore],
+       soversion: '0.0.0',
+       install: true)
+
+valacodegen = declare_dependency(link_with: [valacodegen_lib], include_directories: include_directories('.'))
+
+#install_headers(join_paths(meson.current_build_dir(), 'valacodegen.h'), subdir: 
'vala@0@'.format(vala_version_suffix))
diff --git a/compiler/meson.build b/compiler/meson.build
new file mode 100644
index 0000000..6c1afeb
--- /dev/null
+++ b/compiler/meson.build
@@ -0,0 +1,12 @@
+valac_sources = [
+       'valacompiler.vala'
+]
+
+valac_name = 'valac@0@'.format(vala_version_suffix)
+
+executable(valac_name,
+       valac_sources,
+       dependencies: [glib, gobject, valacore, valagee, valaccode, valacodegen],
+       install: true,
+       include_directories: include_directories('.', meson.build_root()),
+       vala_args: ['--pkg=config', '--vapidir=' + join_paths(meson.source_root(), 'vapi')])
diff --git a/config.h.meson b/config.h.meson
new file mode 100644
index 0000000..f98435e
--- /dev/null
+++ b/config.h.meson
@@ -0,0 +1,28 @@
+/* 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
diff --git a/gee/meson.build b/gee/meson.build
new file mode 100644
index 0000000..4567ab9
--- /dev/null
+++ b/gee/meson.build
@@ -0,0 +1,21 @@
+valagee_sources = [
+       'arraylist.vala',
+       'collection.vala',
+       'hashmap.vala',
+       'hashset.vala',
+       'iterable.vala',
+       'iterator.vala',
+       'list.vala',
+       'mapiterator.vala',
+       'map.vala',
+       'set.vala'
+]
+
+valagee_lib = static_library('valagee',
+       valagee_sources,
+       dependencies: [glib, gobject],
+       install: false)
+
+valagee = declare_dependency(link_with: [valagee_lib], include_directories: include_directories('.'))
+
+#install_headers(join_paths(meson.current_build_dir(), 'valagee.h'), subdir: 
'vala@0@'.format(vala_version_suffix))
diff --git a/gobject-introspection/meson.build b/gobject-introspection/meson.build
new file mode 100644
index 0000000..b25becb
--- /dev/null
+++ b/gobject-introspection/meson.build
@@ -0,0 +1,42 @@
+gidl_sources = [
+       'gidlmodule.c',
+       'gidlnode.c',
+       'gidlparser.c',
+       'gmetadata.c'
+]
+
+gidl_lib = static_library('gidl',
+       gidl_sources,
+       dependencies: [glib, gobject, gmodule])
+
+gidl = 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: join_paths(get_option('libdir'), 'vala@0@'.format(vala_version_suffix)),
+       dependencies: [glib, gobject, gmodule, gidl])
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..4bfbcdf
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,65 @@
+project('Vala', 'c', 'vala', version: '0.35.2', meson_version : '>= 0.36.0')
+
+vala_version = meson.project_version()
+vala_version_suffix = '-0.36'
+
+
+conf = configuration_data()
+conf.set('PACKAGE', '"vala"')
+conf.set('PACKAGE_BUGREPORT', '"https://bugzilla.gnome.org/browse.cgi?product=vala";')
+conf.set_quoted('PACKAGE_DATADIR', join_paths(get_option('prefix'), get_option('datadir'), 
'vala@0@'.format(vala_version_suffix)))
+conf.set('PACKAGE_NAME', '"vala"')
+conf.set('PACKAGE_STRING', '"vala @0@"'.format(vala_version))
+conf.set('PACKAGE_SUFFIX', '"@0@"'.format(vala_version_suffix))
+conf.set('PACKAGE_TARNAME', '"vala"')
+conf.set('PACKAGE_URL', '"https://wiki.gnome.org/Projects/Vala";')
+conf.set_quoted('PACKAGE_VERSION', vala_version)
+conf.set_quoted('VERSION', vala_version)
+conf.set_quoted('BUILD_VERSION', vala_version)
+configure_file(input: 'config.h.meson', output: 'config.h', configuration: conf)
+configure_file(input: 'version.h.meson', output: 'version.h', configuration: conf)
+
+
+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('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)
+configure_file(input: 'vapigen/vala-gen-introspect/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')))
+
+
+add_global_arguments(['-Wno-deprecated-declarations',
+                      '-Wno-discarded-qualifiers',
+                      '-Wno-incompatible-pointer-types',
+                      '-Wno-unused'], language: 'c')
+add_global_arguments(['--disable-version-header',
+                      '--hide-internal'], language: 'vala')
+
+
+glib_version_required = '2.32.0'
+
+glib = dependency('glib-2.0', version: '>= @0@'.format(glib_version_required))
+gobject = dependency('gobject-2.0', version: '>= @0@'.format(glib_version_required))
+gmodule = dependency('gmodule-2.0', version: '>= @0@'.format(glib_version_required))
+
+
+subdir('gobject-introspection')
+subdir('gee')
+subdir('vala')
+subdir('ccode')
+subdir('codegen')
+subdir('compiler')
+subdir('vapigen')
diff --git a/vala/meson.build b/vala/meson.build
new file mode 100644
index 0000000..cc90c50
--- /dev/null
+++ b/vala/meson.build
@@ -0,0 +1,163 @@
+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',
+       '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',
+       valacore_sources,
+       dependencies: [glib, gobject, gmodule, valagee],
+       install: false,
+       include_directories: include_directories('.', meson.build_root()),
+       vala_args: ['--pkg=config', '--vapidir=' + join_paths(meson.source_root(), 'vapi')])
+
+valacore = declare_dependency(link_with: [valacore_lib],
+       include_directories: include_directories('.', meson.build_root()))
+
+#install_headers(join_paths(meson.current_build_dir(), 'vala.h'), subdir: 
'vala-@0@'.format(vala_version_suffix))
diff --git a/vapigen/meson.build b/vapigen/meson.build
new file mode 100644
index 0000000..0cfc858
--- /dev/null
+++ b/vapigen/meson.build
@@ -0,0 +1,26 @@
+vapigen_sources = [
+       'valagidlparser.vala',
+       'valavapigen.vala'
+]
+
+vapigen_name = 'vapigen@0@'.format(vala_version_suffix)
+
+executable(vapigen_name,
+       vapigen_sources,
+       dependencies: [glib, gobject, valagee, valacore, gidl],
+       install: true,
+       include_directories: include_directories(meson.build_root()),
+       vala_args: ['--pkg=config', '--vapidir=' + join_paths(meson.source_root(), 'vapi'),
+               '--pkg=gidl', '--vapidir=' + join_paths(meson.source_root(), 'gobject-introspection')])
+
+vapicheck_sources = [
+       'valavapicheck.vala'
+]
+
+vapicheck_name = 'vapicheck@0@'.format(vala_version_suffix)
+
+executable(vapicheck_name,
+       vapicheck_sources,
+       dependencies: [glib, gobject, valagee, valacore, gidl],
+       install: true,
+       vala_args: ['--pkg=gidl', '--vapidir=' + join_paths(meson.source_root(), 'gobject-introspection')])
diff --git a/version.h.meson b/version.h.meson
new file mode 100644
index 0000000..d9b1c12
--- /dev/null
+++ b/version.h.meson
@@ -0,0 +1,2 @@
+/* Define to the build version of this package. */
+#mesondefine BUILD_VERSION


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