[vala/wip/meson: 117/117] WIP Add Meson build system
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/meson: 117/117] WIP Add Meson build system
- Date: Fri, 24 Mar 2017 07:40:01 +0000 (UTC)
commit 7d91bb3702765288dc6159058c84e5adad2e8fb2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Jan 9 14:47:55 2017 +0100
WIP Add Meson build system
ccode/meson.build | 70 +++++++++++++
codegen/meson.build | 44 ++++++++
compiler/meson.build | 14 +++
config.h.meson | 28 +++++
doc/meson.build | 1 +
gee/meson.build | 25 +++++
gobject-introspection/meson.build | 42 ++++++++
meson.build | 68 +++++++++++++
unversioned-install.sh | 13 +++
vala/meson.build | 167 +++++++++++++++++++++++++++++++
vapigen/meson.build | 44 ++++++++
vapigen/vala-gen-introspect/meson.build | 6 +
version.h.meson | 2 +
13 files changed, 524 insertions(+), 0 deletions(-)
---
diff --git a/ccode/meson.build b/ccode/meson.build
new file mode 100644
index 0000000..1eec4dd
--- /dev/null
+++ b/ccode/meson.build
@@ -0,0 +1,70 @@
+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('.', '..'),
+ vala_args: ['--pkg=config', '--vapidir=' + join_paths(meson.source_root(), 'vapi')],
+ vala_vapi: 'valaccode.vapi',
+ vala_header: 'valaccode.h'
+)
+
+valaccode = declare_dependency(link_with: [valaccode_lib], include_directories: include_directories('.'))
+
+install_headers('valaccode.h', subdir: 'vala@0@'.format(vala_version_suffix), from_build: true)
diff --git a/codegen/meson.build b/codegen/meson.build
new file mode 100644
index 0000000..b51c993
--- /dev/null
+++ b/codegen/meson.build
@@ -0,0 +1,44 @@
+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,
+ #vala_vapi: 'valacodegen.vapi',
+ vala_header: 'valacodegen.h'
+)
+
+valacodegen = declare_dependency(link_with: [valacodegen_lib], include_directories: include_directories('.'))
+
+install_headers('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..84f51b0
--- /dev/null
+++ b/compiler/meson.build
@@ -0,0 +1,14 @@
+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('.', '..'),
+ 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/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..14e9e6a
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1 @@
+install_man(['vala-gen-introspect.1', 'valac.1', 'vapigen.1'])
diff --git a/gee/meson.build b/gee/meson.build
new file mode 100644
index 0000000..d034532
--- /dev/null
+++ b/gee/meson.build
@@ -0,0 +1,25 @@
+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,
+ vala_vapi: 'valagee.vapi',
+ vala_header: 'valagee.h'
+)
+
+valagee = declare_dependency(link_with: [valagee_lib], include_directories: include_directories('.'))
+
+install_headers('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..abc9a6a
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,68 @@
+project('Vala', 'c', 'vala', version: '0.35.3')
+
+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
+)
+
+
+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')
+subdir('doc')
+
+install_data('vala.m4', install_dir: 'share/aclocal')
+#add_install_script('unversioned-install.sh')
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..1c4069b
--- /dev/null
+++ b/vala/meson.build
@@ -0,0 +1,167 @@
+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('.', '..'),
+ vala_args: ['--pkg=config', '--vapidir=' + join_paths(meson.source_root(), 'vapi')],
+ vala_vapi: 'vala.vapi',
+ vala_header: 'vala.h'
+)
+
+valacore = declare_dependency(link_with: [valacore_lib],
+ include_directories: include_directories('.', '..'))
+
+install_headers('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..66b8365
--- /dev/null
+++ b/vapigen/meson.build
@@ -0,0 +1,44 @@
+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('..'),
+ 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')]
+)
+
+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: 'share/aclocal')
+install_data('Makefile.vapigen', install_dir: '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..6cb1582
--- /dev/null
+++ b/vapigen/vala-gen-introspect/meson.build
@@ -0,0 +1,6 @@
+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'))
+)
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]