[swell-foop/wip/inigomartinez/meson: 3/5] build: Move config.vapi to vapi directory



commit e2b832467355d9c4ad3b81651b40a6425c77d995
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Sat Feb 10 15:36:41 2018 +0100

    build: Move config.vapi to vapi directory
    
    The standard place following Vala recommendations[0] for the
    `config.vapi` file is the `vapi` directory.
    
    The `config.vapi` file has been moved to the `vapi` directory, and
    both meson and autotools have been modified to handle it properly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793340
    
    [0] https://wiki.gnome.org/Projects/Vala/GameDevelopmentSeries/Setup

 configure.ac              |    1 +
 meson.build               |    5 ++++-
 src/Makefile.am           |    3 ++-
 src/meson.build           |    2 +-
 {src => vapi}/config.vapi |    0
 5 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9b7ccda..d863af3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,6 +2,7 @@ AC_PREREQ([2.63])
 AC_INIT([Swell Foop], [3.28.0], [https://bugzilla.gnome.org/],
         [swell-foop], [https://wiki.gnome.org/Apps/Swell%20Foop])
 AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADER(config.h)
 
 AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz foreign])
 AM_SILENT_RULES([yes])
diff --git a/meson.build b/meson.build
index 4c93d23..901f572 100644
--- a/meson.build
+++ b/meson.build
@@ -8,10 +8,12 @@ gnome = import('gnome')
 i18n = import('i18n')
 
 localedir = join_paths(get_option('prefix'), get_option('localedir'))
-podir = join_paths(meson.source_root(), 'po')
 datadir = join_paths (get_option ('prefix'), get_option ('datadir'))
 pkgdatadir = join_paths (datadir, 'swell-foop')
 
+podir = join_paths(meson.source_root(), 'po')
+vapidir = join_paths(meson.source_root(), 'vapi')
+
 # Dependencies
 
 glib_min_version = '2.36'
@@ -29,6 +31,7 @@ cc = meson.get_compiler('c')
 
 # Libraries
 libmath_dep = cc.find_library('m')
+config_dep = valac.find_library('config', dirs: vapidir)
 posix_dep = valac.find_library('posix')
 
 # Configuration
diff --git a/src/Makefile.am b/src/Makefile.am
index 7f6f29c..9cb46bf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,11 +4,12 @@ swell_foop_SOURCES = \
        game-view.vala \
        game.vala \
        history.vala \
-       config.vapi \
        score-dialog.vala \
        swell-foop.vala
 
 swell_foop_VALAFLAGS = \
+       --vapidir $(top_srcdir)/vapi \
+       --pkg config \
        --pkg posix \
        --pkg gmodule-2.0 \
        --pkg clutter-gtk-1.0 \
diff --git a/src/meson.build b/src/meson.build
index 2547bb1..35865e7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,5 +1,4 @@
 sources = [
-  'config.vapi',
   'history.vala',
   'game.vala',
   'game-view.vala',
@@ -8,6 +7,7 @@ sources = [
 ]
 
 deps = [
+  config_dep,
   posix_dep,
   libmath_dep,
   gmodule_dep,
diff --git a/src/config.vapi b/vapi/config.vapi
similarity index 100%
rename from src/config.vapi
rename to vapi/config.vapi


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