[libgda/wip/meson] Meson: Added postgresql provider
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/wip/meson] Meson: Added postgresql provider
- Date: Fri, 15 Jun 2018 23:30:05 +0000 (UTC)
commit 540516433d5fa0e83d487d1e3421f0dc580da5f9
Author: Daniel Espinosa <esodan gmail com>
Date: Fri Jun 15 18:26:02 2018 -0500
Meson: Added postgresql provider
meson.build | 1 +
providers/meson.build | 6 +-
providers/postgres/meson.build | 112 +++++++++++++++++++++++++++++++
providers/reuseable/postgres/meson.build | 17 ++++-
providers/sqlite/meson.build | 2 +-
5 files changed, 134 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index fdab15535..ca03ddbae 100644
--- a/meson.build
+++ b/meson.build
@@ -68,6 +68,7 @@ libxslt_dep = dependency('libxslt')
jsonglib_dep = dependency('json-glib-1.0',required : false)
soup_dep = dependency('libsoup-2.4', required : false)
sqlite_dep = dependency ('sqlite3', version: '>= 3.6.11')
+postgres_dep = dependency ('libpq', required: false)
c_args = ['-Wall',
'-Wextra',
diff --git a/providers/meson.build b/providers/meson.build
index bc374e51b..5da5f9bbc 100644
--- a/providers/meson.build
+++ b/providers/meson.build
@@ -1,3 +1,7 @@
subdir('reuseable')
subdir('sqlite')
-subdir('skel-implementation')
\ No newline at end of file
+subdir('skel-implementation')
+
+if postgres_dep.found()
+subdir('postgres')
+endif
\ No newline at end of file
diff --git a/providers/postgres/meson.build b/providers/postgres/meson.build
new file mode 100644
index 000000000..f0122073a
--- /dev/null
+++ b/providers/postgres/meson.build
@@ -0,0 +1,112 @@
+
+inc_libgda_postgresh = include_directories ('.')
+inc_libgda_postgresh_dep = declare_dependency (include_directories : inc_libgda_postgresh)
+
+postgres_xml_fnames = [
+ 'postgres_specs_add_column',
+ 'postgres_specs_create_db',
+ 'postgres_specs_create_index',
+ 'postgres_specs_create_role',
+ 'postgres_specs_create_table',
+ 'postgres_specs_create_user',
+ 'postgres_specs_create_view',
+ 'postgres_specs_drop_column',
+ 'postgres_specs_drop_db',
+ 'postgres_specs_drop_index',
+ 'postgres_specs_drop_role',
+ 'postgres_specs_drop_table',
+ 'postgres_specs_drop_user',
+ 'postgres_specs_drop_view',
+ 'postgres_specs_dsn',
+ 'postgres_specs_rename_table'
+ ]
+postgres_xml_fnamesext = []
+foreach fn : postgres_xml_fnames
+ postgres_xml_fnamesext += [fn+'.xml.in']
+endforeach
+
+postgres_xml_inf = files(postgres_xml_fnamesext)
+
+foreach xf : postgres_xml_fnames
+ install_data(xf+'.xml.in',
+ rename: [
+ xf+'.xml'
+ ],
+ install_dir: join_paths(get_option('datadir'), project_package)
+ )
+endforeach
+
+foreach xt : postgres_xml_fnames
+ i18n.merge_file(
+ input: xt+'.xml.in',
+ output: xt+'.xml.in.h',
+ type: 'xml',
+ po_dir: join_paths(meson.build_root(),'po')
+ )
+endforeach
+
+foreach xr : postgres_xml_fnames
+ tc = configuration_data()
+ configure_file(
+ copy: true,
+ input: xr+'.xml.in',
+ output: xr+'.raw.xml',
+ configuration: tc
+ )
+endforeach
+
+postgres_resources = gnome_module.compile_resources('postgres_resources', 'postgres.gresource.xml',
+ source_dir: meson.current_build_dir()
+ )
+
+libgda_postgres_sources = files([
+ 'gda-postgres-blob-op.c',
+ 'gda-postgres-blob-op.h',
+ 'gda-postgres-ddl.c',
+ 'gda-postgres-ddl.h',
+ 'gda-postgres-handler-bin.c',
+ 'gda-postgres-handler-bin.h',
+ 'gda-postgres-provider.c',
+ 'gda-postgres-provider.h',
+ 'gda-postgres-pstmt.c',
+ 'gda-postgres-pstmt.h',
+ 'gda-postgres-recordset.c',
+ 'gda-postgres-recordset.h',
+ 'gda-postgres-util.c',
+ 'gda-postgres-util.h',
+ 'gda-postgres.h',
+ 'libmain.c'
+ ])
+
+conf = configuration_data()
+conf.set_quoted('GDA_ABI_MAJOR_VERSION', MAJOR_VERSION)
+conf.set_quoted('GDA_ABI_MINOR_VERSION', MINOR_VERSION)
+conf.set_quoted('VERSION', project_version)
+
+libgda_sqlite_providerpc = configure_file(
+ input: 'libgda-postgres-'+project_api_version+'.pc.in',
+ output: 'libgda-postgres-'+project_api_version+'.pc',
+ configuration : conf,
+ install_dir: join_paths(get_option('libdir'),'pkgconfig')
+ )
+
+libgda_postgres_sources += libgda_pg_sources
+
+libgda_postgres_provider = library ('gda-postgres-'+project_api_version,
+ libgda_postgres_sources,
+ dependencies: [
+ libgda_dep,
+ postgres_dep,
+ pg_reusable_dep,
+ inc_postgresh_dep
+ ],
+ c_args: [
+ '-include',
+ meson.build_root() + '/config.h',
+ ],
+ link_args: [
+ '-export-dynamic',
+ ],
+ link_with: libgda,
+ install: false,
+ )
diff --git a/providers/reuseable/postgres/meson.build b/providers/reuseable/postgres/meson.build
index 40e9cd98b..b04625382 100644
--- a/providers/reuseable/postgres/meson.build
+++ b/providers/reuseable/postgres/meson.build
@@ -1,3 +1,6 @@
+inc_postgresh = include_directories ('.')
+inc_postgresh_dep = declare_dependency (include_directories : inc_postgresh)
+
pg_keywordshash_82 = custom_target('keywords_hash_82',
command: [
@@ -59,11 +62,21 @@ pg_token_types = custom_target('pg_token_types',
install: false
)
-libgda_postgres_sources = files([
+libgda_pg_sources = files([
'gda-postgres-reuseable.c',
'gda-postgres-reuseable.h',
'gda-postgres-parser.c',
'gda-postgres-parser.h',
'gda-postgres-meta.c',
'gda-postgres-meta.h',
- ])
\ No newline at end of file
+ ])
+
+libgda_pg_sources += pg_token_types
+libgda_pg_sources += pg_token_types
+libgda_pg_sources += pg_lemon_parserc
+libgda_pg_sources += pg_lemon_parserh
+
+pg_reusable_dep = []
+pg_reusable_dep += pg_keywordshash_82_dep
+pg_reusable_dep += pg_keywordshash_83_dep
+pg_reusable_dep += pg_keywordshash_84_dep
\ No newline at end of file
diff --git a/providers/sqlite/meson.build b/providers/sqlite/meson.build
index 183e492e3..e3b7117d8 100644
--- a/providers/sqlite/meson.build
+++ b/providers/sqlite/meson.build
@@ -73,7 +73,7 @@ libgda_sqlite_providerpc = configure_file(output : 'libgda-sqlite-'+project_api_
configuration : conf,
install_dir: join_paths(get_option('libdir'),'pkgconfig')
)
-libgda_sqlite_provider = library ('gda-sqlite',
+libgda_sqlite_provider = library ('gda-sqlite-'+project_api_version,
libgda_sqlite_sources,
dependencies: [
libgda_dep,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]