[gitg/wip/valadoc: 8/12] meson: Improve libraries variable naming
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/valadoc: 8/12] meson: Improve libraries variable naming
- Date: Fri, 12 Oct 2018 10:13:01 +0000 (UTC)
commit 8e7da995f990ca56bc7d78e83b9be35ec154dd25
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Fri Oct 5 09:19:46 2018 +0200
meson: Improve libraries variable naming
Although most of the parameters used for file naming when building
libraries and introspection data can be replaced by variables, the
actual naming can create a lot of confusion.
This naming scheme has been improved by using clearer names and by
also using a prefix in them.
libgitg-ext/meson.build | 40 ++++++++++++++++++----------------------
libgitg/meson.build | 40 ++++++++++++++++++----------------------
meson.build | 3 +--
3 files changed, 37 insertions(+), 46 deletions(-)
---
diff --git a/libgitg-ext/meson.build b/libgitg-ext/meson.build
index 4963e534..f028965b 100644
--- a/libgitg-ext/meson.build
+++ b/libgitg-ext/meson.build
@@ -1,13 +1,9 @@
-name = gitg_name + '-ext'
-api_name = '@0@-@1@'.format(name, gitg_api_version)
+libgitg_ext_api_name = 'libgitg-ext-' + gitg_api_version
+libgitg_ext_gir_api_name = 'GitgExt-' + gitg_api_version
-lib_name = 'lib' + name
-lib_api_name = 'lib' + api_name
-
-gir_ns = 'GitgExt'
-gir_api_name = '@0@-@1@'.format(gir_ns, gitg_gir_version)
-gir_name = gir_api_name + '.gir'
-gir_typelib = gir_api_name + '.typelib'
+libgitg_ext_vapi_name = libgitg_ext_api_name + '.vapi'
+libgitg_ext_gir_name = libgitg_ext_gir_api_name + '.gir'
+libgitg_ext_typelib_name = libgitg_ext_gir_api_name + '.typelib'
sources = files(
'gitg-ext-action.vala',
@@ -41,22 +37,22 @@ cflags = warn_flags + [
]
libgitg_ext = shared_library(
- api_name,
+ 'gitg-ext-' + gitg_api_version,
sources: sources,
version: libversion,
soversion: soversion,
include_directories: top_inc,
dependencies: libgitg_dep,
c_args: cflags,
- vala_header: lib_name + '.h',
- vala_vapi: lib_api_name + '.vapi',
- vala_gir: gir_name,
+ vala_header: 'libgitg-ext.h',
+ vala_vapi: libgitg_ext_vapi_name,
+ vala_gir: libgitg_ext_gir_name,
link_args: common_ldflags,
link_depends: symbol_map,
install: true,
install_dir: [
get_option('libdir'),
- join_paths(gitg_includedir, lib_api_name, lib_name),
+ join_paths(gitg_includedir, libgitg_ext_api_name, 'libgitg-ext'),
true,
true,
],
@@ -79,11 +75,11 @@ libgitg_ext_dep = declare_dependency(
pkg.generate(
libraries: libgitg_ext,
version: gitg_version,
- name: lib_name,
- description: gitg_name + ' extensions library',
- filebase: lib_api_name,
- subdirs: lib_api_name,
- requires: deps + ['libgitg-1.0'],
+ name: 'libgitg-ext',
+ description: 'gitg extensions library',
+ filebase: libgitg_ext_api_name,
+ subdirs: libgitg_ext_api_name,
+ requires: deps + [libgitg_api_name],
variables: 'exec_prefix=' + gitg_prefix,
)
@@ -114,9 +110,9 @@ if enable_docs
endif
custom_target(
- gir_typelib,
- output: gir_typelib,
- command: [g_ir_compiler, '--shared-library', libgitg_ext.full_path(), '--includedir', libgitg_dir,
'--output', '@OUTPUT@', join_paths(meson.current_build_dir(), gir_name)],
+ libgitg_ext_typelib_name,
+ output: libgitg_ext_typelib_name,
+ command: [g_ir_compiler, '--shared-library', libgitg_ext.full_path(), '--includedir', libgitg_build_dir,
'--output', '@OUTPUT@', join_paths(meson.current_build_dir(), libgitg_ext_gir_name)],
depends: [
libgitg,
libgitg_ext,
diff --git a/libgitg/meson.build b/libgitg/meson.build
index 473ff03d..f7424960 100644
--- a/libgitg/meson.build
+++ b/libgitg/meson.build
@@ -1,13 +1,11 @@
-name = gitg_name
-api_name = '@0@-@1@'.format(name, gitg_api_version)
+libgitg_build_dir = meson.current_build_dir()
-lib_name = 'lib' + name
-lib_api_name = 'lib' + api_name
+libgitg_api_name = 'libgitg-' + gitg_api_version
+libgitg_gir_api_name = 'Gitg-' + gitg_api_version
-gir_ns = 'Gitg'
-gir_api_name = '@0@-@1@'.format(gir_ns, gitg_gir_version)
-gir_name = gir_api_name + '.gir'
-gir_typelib = gir_api_name + '.typelib'
+libgitg_vapi_name = libgitg_api_name + '.vapi'
+libgitg_gir_name = libgitg_gir_api_name + '.gir'
+libgitg_typelib_name = libgitg_gir_api_name + '.typelib'
common_deps = [
gee_dep,
@@ -131,22 +129,22 @@ else
endif
libgitg = shared_library(
- api_name,
+ 'gitg-' + gitg_api_version,
sources: sources,
version: libversion,
soversion: soversion,
include_directories: top_inc,
dependencies: deps,
c_args: cflags,
- vala_header: lib_name + '.h',
- vala_vapi: lib_api_name + '.vapi',
- vala_gir: gir_name,
+ vala_header: 'libgitg.h',
+ vala_vapi: libgitg_vapi_name,
+ vala_gir: libgitg_gir_name,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: [
get_option('libdir'),
- join_paths(gitg_includedir, lib_api_name, lib_name),
+ join_paths(gitg_includedir, libgitg_api_name, 'libgitg'),
true,
true,
],
@@ -163,20 +161,18 @@ libgitg_dep = declare_dependency(
pkg.generate(
libraries: libgitg,
version: gitg_version,
- name: gitg_name,
- description: gitg_name + ' library',
- filebase: lib_api_name,
- subdirs: lib_api_name,
+ name: 'gitg',
+ description: 'gitg library',
+ filebase: libgitg_api_name,
+ subdirs: libgitg_api_name,
requires: common_deps,
variables: 'exec_prefix=' + gitg_prefix,
)
-libgitg_dir = meson.current_build_dir()
-
custom_target(
- gir_typelib,
- output: gir_typelib,
- command: [g_ir_compiler, '--shared-library', libgitg.full_path(), '--output', '@OUTPUT@',
join_paths(libgitg_dir, gir_name)],
+ libgitg_typelib_name,
+ output: libgitg_typelib_name,
+ command: [g_ir_compiler, '--shared-library', libgitg.full_path(), '--output', '@OUTPUT@',
join_paths(libgitg_build_dir, libgitg_gir_name)],
depends: libgitg,
install: true,
install_dir: gitg_girepositorydir,
diff --git a/meson.build b/meson.build
index fc0d0ad0..cc206740 100644
--- a/meson.build
+++ b/meson.build
@@ -15,7 +15,6 @@ gitg_minor_version = version_array[1].to_int()
gitg_micro_version = version_array[2].to_int()
gitg_api_version = '1.0'
-gitg_gir_version = '1.0'
gitg_gettext = gitg_name
@@ -29,7 +28,7 @@ gitg_localedir = join_paths(gitg_prefix, get_option('localedir'))
gitg_pkgdatadir = join_paths(gitg_datadir, gitg_name)
gitg_pkglibdir = join_paths(gitg_libdir, gitg_name)
-gitg_girepositorydir = join_paths(gitg_libdir, 'girepository-' + gitg_gir_version)
+gitg_girepositorydir = join_paths(gitg_libdir, 'girepository-1.0')
soversion = 0
current = 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]