[libsecret/wip/nielsdg/meson] Add build support for Meson.
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsecret/wip/nielsdg/meson] Add build support for Meson.
- Date: Sun, 4 Nov 2018 13:21:09 +0000 (UTC)
commit de32df56f8ce7e463bfff95fc8b6324becab67a9
Author: Niels De Graef <nielsdegraef gmail com>
Date: Tue Mar 20 22:03:56 2018 +0100
Add build support for Meson.
egg/egg-secure-memory.h | 1 +
egg/meson.build | 24 ++++++++++++++++
libsecret/meson.build | 68 +++++++++++++++++++++++++++++++++++++++++++++
meson.build | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
meson_options.txt | 4 +++
po/meson.build | 3 ++
tool/meson.build | 11 ++++++++
7 files changed, 185 insertions(+)
---
diff --git a/egg/egg-secure-memory.h b/egg/egg-secure-memory.h
index 008c82d..660bc6f 100644
--- a/egg/egg-secure-memory.h
+++ b/egg/egg-secure-memory.h
@@ -23,6 +23,7 @@
#ifndef EGG_SECURE_MEMORY_H
#define EGG_SECURE_MEMORY_H
+#include <glib.h>
#include <stdlib.h>
/* -------------------------------------------------------------------
diff --git a/egg/meson.build b/egg/meson.build
new file mode 100644
index 0000000..11eeb75
--- /dev/null
+++ b/egg/meson.build
@@ -0,0 +1,24 @@
+libegg_sources = [
+ 'egg-hex.c',
+ 'egg-secure-memory.c',
+ 'egg-testing.c',
+]
+
+if with_gcrypt
+ libegg_sources += [
+ 'egg-dh.c',
+ 'egg-hkdf.c',
+ 'egg-libgcrypt.c',
+ ]
+endif
+
+libegg_deps = [
+ glib_deps,
+ gcrypt_dep,
+]
+
+libegg = static_library('egg',
+ libegg_sources,
+ dependencies: libegg_deps,
+ include_directories: config_h_dir,
+)
diff --git a/libsecret/meson.build b/libsecret/meson.build
new file mode 100644
index 0000000..2a78bed
--- /dev/null
+++ b/libsecret/meson.build
@@ -0,0 +1,68 @@
+libsecret_sources = [
+ 'secret-attributes.c',
+ 'secret-collection.c',
+ 'secret-item.c',
+ 'secret-methods.c',
+ 'secret-password.c',
+ 'secret-prompt.c',
+ 'secret-schema.c',
+ 'secret-schemas.c',
+ 'secret-service.c',
+ 'secret-value.c',
+ 'secret-paths.c',
+ 'secret-session.c',
+ 'secret-util.c',
+]
+
+libsecret_headers = [
+ 'secret.h',
+ 'secret-attributes.h',
+ 'secret-collection.h',
+ 'secret-item.h',
+ 'secret-password.h',
+ 'secret-paths.h',
+ 'secret-prompt.h',
+ 'secret-schema.h',
+ 'secret-schemas.h',
+ 'secret-service.h',
+ 'secret-types.h',
+ 'secret-value.h',
+]
+
+_dbus_generated = gnome.gdbus_codegen('secret-dbus-generated',
+ sources: 'org.freedesktop.Secrets.xml',
+ interface_prefix: 'org.freedesktop.Secret.',
+ namespace: '_SecretGen',
+)
+
+_enums_generated = gnome.mkenums('secret-enum-types',
+ sources: libsecret_headers,
+ c_template: 'secret-enum-types.c.template',
+ h_template: 'secret-enum-types.h.template',
+)
+
+libsecret_dependencies = [
+ glib_deps,
+]
+
+if with_gcrypt
+ libsecret_dependencies += gcrypt_dep
+endif
+
+libsecret_cflags = [
+ '-DSECRET_COMPILATION',
+]
+
+libsecret = library('secret',
+ [ libsecret_sources, _dbus_generated, _enums_generated ],
+ dependencies: libsecret_dependencies,
+ link_with: libegg,
+ c_args: libsecret_cflags,
+ include_directories: config_h_dir,
+ install: true,
+)
+
+libsecret_dep = declare_dependency(
+ link_with: libsecret,
+ dependencies: libsecret_dependencies,
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..915daac
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,74 @@
+project('libsecret', 'c',
+ version: '0.18.5',
+ license: 'GPL2+',
+ meson_version: '>= 0.41',
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+
+# Options
+with_manpage = get_option('manpage')
+with_gcrypt = get_option('gcrypt')
+enable_debug = get_option('debugging')
+with_vapi = get_option('vapi')
+
+# Some variables
+config_h_dir = include_directories('.')
+contacts_prefix = get_option('prefix')
+datadir = join_paths(contacts_prefix, get_option('datadir'))
+bindir = join_paths(contacts_prefix, get_option('bindir'))
+libdir = join_paths(contacts_prefix, get_option('libdir'))
+libexecdir = join_paths(contacts_prefix, get_option('libexecdir'))
+locale_dir = join_paths(contacts_prefix, get_option('localedir'))
+pkgdatadir = join_paths(datadir, meson.project_name())
+pkglibdir = join_paths(libdir, meson.project_name())
+po_dir = join_paths(meson.source_root(), 'po')
+
+# Dependencies
+min_glib_version = '2.44'
+glib_deps = [
+ dependency('glib-2.0', version: '>=' + min_glib_version),
+ dependency('gio-2.0', version: '>=' + min_glib_version),
+ dependency('gio-unix-2.0', version: '>=' + min_glib_version),
+]
+if with_gcrypt
+ min_libgcrypt_version = '1.2.2'
+ libgcrypt_config = find_program('libgcrypt-config')
+ libgcrypt_version = run_command(libgcrypt_config, '--version').stdout().strip()
+ if (libgcrypt_version.version_compare('>' + libgcrypt_version))
+ error('@0@ requires at least gcrypt version @1@, but version found is @2@'
+ .format(meson.project_name(), min_libgcrypt_version, libgcrypt_version))
+ endif
+ message('gcrypt version: @0@'.format(libgcrypt_version))
+ gcrypt_dep = declare_dependency(
+ link_args: run_command(libgcrypt_config, '--libs').stdout().strip().split(),
+ compile_args: run_command(libgcrypt_config, '--cflags').stdout().strip().split(),
+ )
+endif
+
+# Libraries
+math = meson.get_compiler('c').find_library('m')
+
+# Configuration
+conf = configuration_data()
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
+conf.set_quoted('LOCALEDIR', locale_dir)
+conf.set_quoted('PACKAGE_NAME', meson.project_name())
+conf.set_quoted('PACKAGE_STRING', meson.project_name())
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+conf.set('WITH_GCRYPT', with_gcrypt)
+if with_gcrypt
+ conf.set_quoted('LIBGCRYPT_VERSION', min_libgcrypt_version)
+endif
+conf.set('WITH_DEBUG', enable_debug)
+conf.set('_DEBUG', enable_debug)
+configure_file(output: 'config.h', configuration: conf)
+
+# Subfolders
+# subdir('docs')
+subdir('po')
+subdir('egg')
+subdir('libsecret')
+subdir('tool')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..1b9cd94
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,4 @@
+option('manpage', type: 'boolean', value: true, description: 'Build man pages')
+option('gcrypt', type: 'boolean', value: true, description: 'With gcrypt and transport encryption')
+option('debugging', type: 'boolean', value: false, description: 'Turn debugging on/off')
+option('vapi', type: 'boolean', value: true, description: 'Create VAPI file.')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..f904cde
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext(meson.project_name(),
+ preset: 'glib'
+)
diff --git a/tool/meson.build b/tool/meson.build
new file mode 100644
index 0000000..686cf24
--- /dev/null
+++ b/tool/meson.build
@@ -0,0 +1,11 @@
+secret_tool_sources = [
+ 'secret-tool.c',
+]
+
+secret_tool = executable('secret-tool',
+ secret_tool_sources,
+ dependencies: libsecret_dep,
+ include_directories: config_h_dir,
+ c_args: libsecret_cflags,
+ install: true,
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]