From c9d9b35d570644fb50e4b6a9c48b58fc5e622252 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 8 Jul 2024 20:23:49 -0400 Subject: [PATCH 1/2] feat(c): Add pkgconfig support to Meson build system --- c/driver/flightsql/meson.build | 7 +++++++ c/driver/postgresql/meson.build | 6 ++++++ c/driver/snowflake/meson.build | 7 +++++++ c/driver/sqlite/meson.build | 6 ++++++ c/driver_manager/meson.build | 6 ++++++ c/meson.build | 2 ++ 6 files changed, 34 insertions(+) diff --git a/c/driver/flightsql/meson.build b/c/driver/flightsql/meson.build index 9905f250b6..7a590a93b5 100644 --- a/c/driver/flightsql/meson.build +++ b/c/driver/flightsql/meson.build @@ -47,6 +47,13 @@ adbc_driver_flightsql_lib = custom_target( install_dir : '.', ) +pkg.generate( + name: 'adbc_driver_flightsql', + description: 'ADBC Driver for FlightSQL', + libraries: [adbc_driver_flightsql_lib], + filebase: 'adbc-driver-flightsql', +) + if get_option('tests') exc = executable( 'adbc-driver-flightsql-test', diff --git a/c/driver/postgresql/meson.build b/c/driver/postgresql/meson.build index c263c9937d..c6054c00c9 100644 --- a/c/driver/postgresql/meson.build +++ b/c/driver/postgresql/meson.build @@ -32,6 +32,12 @@ adbc_postgres_driver_lib = library( dependencies: [nanoarrow_dep, fmt_dep, libpq_dep], ) +pkg.generate( + adbc_postgres_driver_lib, + description: 'ADBC Driver for PostgreSQL', + filebase: 'adbc-driver-postgresql', +) + if get_option('tests') postgres_tests = { 'driver-postgresql': { diff --git a/c/driver/snowflake/meson.build b/c/driver/snowflake/meson.build index 86fa6e1f29..da5f7fb9f2 100644 --- a/c/driver/snowflake/meson.build +++ b/c/driver/snowflake/meson.build @@ -47,6 +47,13 @@ adbc_driver_snowflake_lib = custom_target( install_dir : '.', ) +pkg.generate( + name: 'adbc_driver_snowflake', + description: 'ADBC Driver for Snowflake', + libraries: [adbc_driver_snowflake_lib], + filebase: 'adbc-driver-snowflake', +) + if get_option('tests') exc = executable( 'adbc-driver-snowflake-test', diff --git a/c/driver/sqlite/meson.build b/c/driver/sqlite/meson.build index ee28a73e9e..f57803f4b9 100644 --- a/c/driver/sqlite/meson.build +++ b/c/driver/sqlite/meson.build @@ -34,6 +34,12 @@ adbc_sqlite3_driver_lib = library( c_args: ['-DSIZEOF_TIME_T=' + time_t_size.to_string()], ) +pkg.generate( + adbc_sqlite3_driver_lib, + description: 'ADBC Driver for SQLite', + filebase: 'adbc-driver-sqlite', +) + if get_option('tests') exc = executable( 'adbc-driver-sqlite-test', diff --git a/c/driver_manager/meson.build b/c/driver_manager/meson.build index 43a708c802..83f61e866b 100644 --- a/c/driver_manager/meson.build +++ b/c/driver_manager/meson.build @@ -22,3 +22,9 @@ adbc_driver_manager_lib = library( include_directories: [root_dir], install: true, ) + +pkg.generate( + adbc_driver_manager_lib, + description: 'ADBC Driver Manager', + filebase: 'adbc-driver-manager', +) diff --git a/c/meson.build b/c/meson.build index 5003fd9494..e6976a3961 100644 --- a/c/meson.build +++ b/c/meson.build @@ -48,6 +48,8 @@ endif needs_driver_manager = get_option('driver_manager') \ or get_option('tests') +pkg = import('pkgconfig') + if needs_driver_manager subdir('driver_manager') endif From a2bee242f72bc48e3db9f021ac342031c957f15c Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Jul 2024 09:25:18 -0400 Subject: [PATCH 2/2] kou feedback --- c/driver/flightsql/meson.build | 5 +++-- c/driver/postgresql/meson.build | 6 ++++-- c/driver/snowflake/meson.build | 5 +++-- c/driver/sqlite/adbc-driver-sqlite.pc.in | 1 + c/driver/sqlite/meson.build | 6 ++++-- c/driver_manager/adbc-driver-manager.pc.in | 1 + c/driver_manager/meson.build | 6 ++++-- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/c/driver/flightsql/meson.build b/c/driver/flightsql/meson.build index 7a590a93b5..f9d781cd31 100644 --- a/c/driver/flightsql/meson.build +++ b/c/driver/flightsql/meson.build @@ -48,8 +48,9 @@ adbc_driver_flightsql_lib = custom_target( ) pkg.generate( - name: 'adbc_driver_flightsql', - description: 'ADBC Driver for FlightSQL', + name: 'Apache Arrow Database Connectivity (ADBC) Flight SQL driver', + description: 'The ADBC Flight SQL driver provides an ADBC driver for Flight SQL.', + url: 'https://github.com/apache/arrow-adbc', libraries: [adbc_driver_flightsql_lib], filebase: 'adbc-driver-flightsql', ) diff --git a/c/driver/postgresql/meson.build b/c/driver/postgresql/meson.build index c6054c00c9..4f24ec880c 100644 --- a/c/driver/postgresql/meson.build +++ b/c/driver/postgresql/meson.build @@ -33,8 +33,10 @@ adbc_postgres_driver_lib = library( ) pkg.generate( - adbc_postgres_driver_lib, - description: 'ADBC Driver for PostgreSQL', + name: 'Apache Arrow Database Connectivity (ADBC) PostgreSQL driver', + description: 'The ADBC PostgreSQL driver provides an ADBC driver for PostgreSQL.', + url: 'https://github.com/apache/arrow-adbc', + libraries: [adbc_postgres_driver_lib], filebase: 'adbc-driver-postgresql', ) diff --git a/c/driver/snowflake/meson.build b/c/driver/snowflake/meson.build index da5f7fb9f2..d7ad565ec8 100644 --- a/c/driver/snowflake/meson.build +++ b/c/driver/snowflake/meson.build @@ -48,8 +48,9 @@ adbc_driver_snowflake_lib = custom_target( ) pkg.generate( - name: 'adbc_driver_snowflake', - description: 'ADBC Driver for Snowflake', + name: 'Apache Arrow Database Connectivity (ADBC) Snowflake driver', + description: 'The ADBC Snowflake driver provides an ADBC driver for Snowflake.', + url: 'https://github.com/apache/arrow-adbc', libraries: [adbc_driver_snowflake_lib], filebase: 'adbc-driver-snowflake', ) diff --git a/c/driver/sqlite/adbc-driver-sqlite.pc.in b/c/driver/sqlite/adbc-driver-sqlite.pc.in index 359e37b50c..157344e8fe 100644 --- a/c/driver/sqlite/adbc-driver-sqlite.pc.in +++ b/c/driver/sqlite/adbc-driver-sqlite.pc.in @@ -21,6 +21,7 @@ libdir=@ADBC_PKG_CONFIG_LIBDIR@ Name: Apache Arrow Database Connectivity (ADBC) SQLite driver Description: The ADBC SQLite driver provides an ADBC driver for SQLite. +URL: https://github.com/apache/arrow-adbc Version: @ADBC_VERSION@ Libs: -L${libdir} -ladbc_driver_sqlite Cflags: -I${includedir} diff --git a/c/driver/sqlite/meson.build b/c/driver/sqlite/meson.build index f57803f4b9..62c3900dfe 100644 --- a/c/driver/sqlite/meson.build +++ b/c/driver/sqlite/meson.build @@ -35,8 +35,10 @@ adbc_sqlite3_driver_lib = library( ) pkg.generate( - adbc_sqlite3_driver_lib, - description: 'ADBC Driver for SQLite', + name: 'Apache Arrow Database Connectivity (ADBC) SQLite driver', + description: 'The ADBC SQLite driver provides an ADBC driver for SQLite.', + url: 'https://github.com/apache/arrow-adbc', + libraries: [adbc_sqlite3_driver_lib], filebase: 'adbc-driver-sqlite', ) diff --git a/c/driver_manager/adbc-driver-manager.pc.in b/c/driver_manager/adbc-driver-manager.pc.in index 17b290e666..c20430566d 100644 --- a/c/driver_manager/adbc-driver-manager.pc.in +++ b/c/driver_manager/adbc-driver-manager.pc.in @@ -21,6 +21,7 @@ libdir=@ADBC_PKG_CONFIG_LIBDIR@ Name: Apache Arrow Database Connectivity (ADBC) driver manager Description: ADBC driver manager provides API to use ADBC driver. +URL: https://github.com/apache/arrow-adbc Version: @ADBC_VERSION@ Libs: -L${libdir} -ladbc_driver_manager Cflags: -I${includedir} diff --git a/c/driver_manager/meson.build b/c/driver_manager/meson.build index 83f61e866b..e7fc4113d6 100644 --- a/c/driver_manager/meson.build +++ b/c/driver_manager/meson.build @@ -24,7 +24,9 @@ adbc_driver_manager_lib = library( ) pkg.generate( - adbc_driver_manager_lib, - description: 'ADBC Driver Manager', + name: 'Apache Arrow Database Connectivity (ADBC) driver manager', + description: 'ADBC driver manager provides API to use ADBC driver.', + url: 'https://github.com/apache/arrow-adbc', + libraries: [adbc_driver_manager_lib], filebase: 'adbc-driver-manager', )