From 12383deb1964850973baca876d9dcdc313aab44d Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Fri, 13 Oct 2017 00:51:23 +0900 Subject: [PATCH 01/17] [GLib] Support Meson --- c_glib/.gitignore | 3 + c_glib/Makefile.am | 5 +- c_glib/arrow-glib/Makefile.am | 3 +- c_glib/arrow-glib/meson.build | 204 ++++++++++++++++++ c_glib/configure.ac | 2 + c_glib/doc/reference/Makefile.am | 9 +- c_glib/doc/reference/meson.build | 58 +++++ .../doc/reference/xml/gtkdocentities.ent.in | 6 + c_glib/doc/reference/xml/meson.build | 31 +++ c_glib/meson.build | 61 ++++++ c_glib/meson_options.txt | 23 ++ c_glib/tool/Makefile.am | 19 ++ c_glib/tool/get-version.py | 29 +++ 13 files changed, 449 insertions(+), 4 deletions(-) create mode 100644 c_glib/arrow-glib/meson.build create mode 100644 c_glib/doc/reference/meson.build create mode 100644 c_glib/doc/reference/xml/gtkdocentities.ent.in create mode 100644 c_glib/doc/reference/xml/meson.build create mode 100644 c_glib/meson.build create mode 100644 c_glib/meson_options.txt create mode 100644 c_glib/tool/Makefile.am create mode 100755 c_glib/tool/get-version.py diff --git a/c_glib/.gitignore b/c_glib/.gitignore index 373ae73d5d2d..6922691a8d4f 100644 --- a/c_glib/.gitignore +++ b/c_glib/.gitignore @@ -30,6 +30,9 @@ Makefile.in /doc/reference/*.stamp /doc/reference/html/ /doc/reference/xml/ +/doc/reference/xml/* +!/doc/reference/xml/meson.build +!/doc/reference/xml/gtkdocentities.ent.in /doc/reference/tmpl/ /libtool /m4/ diff --git a/c_glib/Makefile.am b/c_glib/Makefile.am index d059d122ba41..577b749fb38b 100644 --- a/c_glib/Makefile.am +++ b/c_glib/Makefile.am @@ -20,10 +20,13 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} SUBDIRS = \ arrow-glib \ doc \ - example + example \ + tool EXTRA_DIST = \ README.md \ + meson.build \ + meson_options.txt \ test arrow_glib_docdir = ${datarootdir}/doc/arrow-glib diff --git a/c_glib/arrow-glib/Makefile.am b/c_glib/arrow-glib/Makefile.am index 4c22d11c76ca..2066fa77cef8 100644 --- a/c_glib/arrow-glib/Makefile.am +++ b/c_glib/arrow-glib/Makefile.am @@ -17,7 +17,8 @@ CLEANFILES = -EXTRA_DIST = +EXTRA_DIST = \ + meson.build AM_CPPFLAGS = \ -I$(top_builddir) \ diff --git a/c_glib/arrow-glib/meson.build b/c_glib/arrow-glib/meson.build new file mode 100644 index 000000000000..7a1e06933556 --- /dev/null +++ b/c_glib/arrow-glib/meson.build @@ -0,0 +1,204 @@ +# -*- indent-tabs-mode: nil -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +pkg_conf = configuration_data() +pkg_conf.set('prefix', prefix) +pkg_conf.set('exec_prefix', prefix) +pkg_conf.set('libdir', libdir) +pkg_conf.set('includedir', includedir) +pkg_conf.set('VERSION', version) + +pc = meson.project_name() + '.pc' +configure_file(input: pc + '.in', + output: pc, + configuration: pkg_conf, + install: true, + install_dir: join_paths(libdir, 'pkgconfig')) + +sources = files( + 'array.cpp', + 'array-builder.cpp', + 'basic-data-type.cpp', + 'buffer.cpp', + 'chunked-array.cpp', + 'column.cpp', + 'composite-data-type.cpp', + 'error.cpp', + 'field.cpp', + 'record-batch.cpp', + 'schema.cpp', + 'table.cpp', + 'tensor.cpp', + 'type.cpp', +) + +sources += files( + 'file.cpp', + 'file-mode.cpp', + 'input-stream.cpp', + 'output-stream.cpp', + 'readable.cpp', + 'writeable.cpp', + 'writeable-file.cpp', +) + +sources += files( + 'metadata-version.cpp', + 'reader.cpp', + 'writer.cpp', +) + +sources += files( + 'compute.cpp', +) + +c_headers = files( + 'array.h', + 'array-builder.h', + 'arrow-glib.h', + 'basic-data-type.h', + 'buffer.h', + 'chunked-array.h', + 'column.h', + 'composite-data-type.h', + 'data-type.h', + 'error.h', + 'field.h', + 'gobject-type.h', + 'record-batch.h', + 'schema.h', + 'table.h', + 'tensor.h', + 'type.h', +) + + +c_headers += files( + 'file.h', + 'file-mode.h', + 'input-stream.h', + 'output-stream.h', + 'readable.h', + 'writeable.h', + 'writeable-file.h', +) + +c_headers += files( + 'metadata-version.h', + 'reader.h', + 'writer.h', +) + +c_headers += files( + 'compute.h', +) + + +cpp_headers = files( + 'array.hpp', + 'array-builder.hpp', + 'arrow-glib.hpp', + 'basic-data-type.hpp', + 'buffer.hpp', + 'chunked-array.hpp', + 'column.hpp', + 'data-type.hpp', + 'error.hpp', + 'field.hpp', + 'record-batch.hpp', + 'schema.hpp', + 'table.hpp', + 'tensor.hpp', + 'type.hpp', +) + +cpp_headers += files( + 'file.hpp', + 'file-mode.hpp', + 'input-stream.hpp', + 'output-stream.hpp', + 'readable.hpp', + 'writeable.hpp', + 'writeable-file.hpp', +) + +cpp_headers += files( + 'metadata-version.hpp', + 'reader.hpp', + 'writer.hpp', +) + +cpp_headers += files( + 'compute.hpp', +) + + +gnome.mkenums('enums', + sources: c_headers, + identifier_prefix: 'GArrow', + symbol_prefix: 'garrow', + c_template: 'enums.c.template', + h_template: 'enums.h.template', + install_dir: includedir, + install_header: true) +generated_sources = files('enums.c') +generated_headers = files('enums.h') + + +headers = c_headers + cpp_headers + generated_headers +install_headers(headers, subdir: meson.project_name()) + + +dependencies = [ + dependency('arrow'), + dependency('gobject-2.0'), + dependency('gio-2.0'), +] +libarrow_glib = library('arrow-glib', + sources: sources + generated_sources, + install: true, + dependencies: dependencies, + include_directories: [ + root_inc, + include_directories('.'), + ], + soversion: so_version, + version: library_version) +libarrow_glib_dependency = declare_dependency(link_with: libarrow_glib, + include_directories: [ + include_directories('.'), + ], + dependencies: dependencies, + sources: generated_headers) + +gnome.generate_gir(libarrow_glib, + sources: sources + c_headers + generated_headers, + namespace: 'Arrow', + nsversion: api_version, + identifier_prefix: 'GArrow', + symbol_prefix: 'garrow', + export_packages: 'arrow-glib', + includes: [ + 'GObject-2.0', + 'Gio-2.0', + ], + install: true, + extra_args: [ + '--warn-all', + ]) diff --git a/c_glib/configure.ac b/c_glib/configure.ac index 938064c16a7d..5db435275a30 100644 --- a/c_glib/configure.ac +++ b/c_glib/configure.ac @@ -100,8 +100,10 @@ AC_CONFIG_FILES([ arrow-glib/arrow-glib.pc doc/Makefile doc/reference/Makefile + doc/reference/xml/Makefile example/Makefile example/lua/Makefile + tool/Makefile ]) AC_OUTPUT diff --git a/c_glib/doc/reference/Makefile.am b/c_glib/doc/reference/Makefile.am index d3389dc2ae81..45b11f035183 100644 --- a/c_glib/doc/reference/Makefile.am +++ b/c_glib/doc/reference/Makefile.am @@ -15,6 +15,9 @@ # specific language governing permissions and limitations # under the License. +SUBDIRS = \ + xml + DOC_MODULE = arrow-glib DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml @@ -32,8 +35,7 @@ MKDB_OPTIONS = \ HFILE_GLOB = \ $(top_srcdir)/arrow-glib/*.h -IGNORE_HFILES = \ - enums.h +IGNORE_HFILES = CFILE_GLOB = \ $(top_srcdir)/arrow-glib/*.cpp @@ -57,3 +59,6 @@ CLEANFILES += \ $(DOC_MODULE)-overrides.txt \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE).types + +EXTRA_DIST += \ + meson.build diff --git a/c_glib/doc/reference/meson.build b/c_glib/doc/reference/meson.build new file mode 100644 index 000000000000..4eba0aa33317 --- /dev/null +++ b/c_glib/doc/reference/meson.build @@ -0,0 +1,58 @@ +# -*- indent-tabs-mode: nil -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +subdir('xml') + +private_headers = [ +] + +content_files = [ +] + +html_images = [ +] + +glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') +glib_doc_path = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') +doc_path = join_paths(datadir, meson.project_name(), 'gtk-doc', 'html') + +gnome.gtkdoc(meson.project_name(), + main_xml: meson.project_name() + '-docs.sgml', + src_dir: [ + join_paths(meson.source_root(), 'arrow-glib'), + join_paths(meson.build_root(), 'arrow-glib'), + ], + dependencies: libarrow_glib_dependency, + gobject_typesfile: meson.project_name() + '.types', + scan_args: [ + '--rebuild-types', + '--deprecated-guards=GARROW_DISABLE_DEPRECATED', + ], + mkdb_args: [ + '--output-format=xml', + '--name-space=garrow', + '--source-suffixes=c,cpp,h', + ], + fixxref_args: [ + '--html-dir=' + doc_path, + '--extra-dir=' + join_paths(glib_doc_path, 'glib'), + '--extra-dir=' + join_paths(glib_doc_path, 'gobject'), + ], + html_assets: html_images, + install: true) diff --git a/c_glib/doc/reference/xml/gtkdocentities.ent.in b/c_glib/doc/reference/xml/gtkdocentities.ent.in new file mode 100644 index 000000000000..b5aefa8fc843 --- /dev/null +++ b/c_glib/doc/reference/xml/gtkdocentities.ent.in @@ -0,0 +1,6 @@ + + + + + + diff --git a/c_glib/doc/reference/xml/meson.build b/c_glib/doc/reference/xml/meson.build new file mode 100644 index 000000000000..5b65042764fe --- /dev/null +++ b/c_glib/doc/reference/xml/meson.build @@ -0,0 +1,31 @@ +# -*- indent-tabs-mode: nil -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +entities_conf = configuration_data() +entities_conf.set('package', meson.project_name()) +entities_conf.set('package_bugreport', + 'https://issues.apache.org/jira/browse/ARROW') +entities_conf.set('package_name', meson.project_name()) +entities_conf.set('package_string', + ' '.join([meson.project_name(), version])) +entities_conf.set('package_url', 'https://arrow.apache.org/') +entities_conf.set('package_version', version) +configure_file(input: 'gtkdocentities.ent.in', + output: 'gtkdocentities.ent', + configuration: entities_conf) diff --git a/c_glib/meson.build b/c_glib/meson.build new file mode 100644 index 000000000000..e7e585bf280a --- /dev/null +++ b/c_glib/meson.build @@ -0,0 +1,61 @@ +# -*- indent-tabs-mode: nil -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +project('arrow-glib', 'c', 'cpp', + license: 'Apache-2.0', + default_options: [ + 'cpp_std=c++11', + ]) + +version = run_command('python', 'tool/get-version.py').stdout().strip() +if version.endswith('-SNAPSHOT') + version_numbers = version.split('-')[0].split('.') + version_tag = version.split('-')[1] +else + version_numbers = version.split('.') + version_tag = '' +endif +version_major = version_numbers[0].to_int() +version_minor = version_numbers[1].to_int() +version_micro = version_numbers[2].to_int() + +api_version = '1.0' +so_version = 0 +library_version = '@0@.@1@.@2@'.format(so_version, 0, 0) + +prefix = get_option('prefix') +libdir = join_paths(prefix, get_option('libdir')) +sysconfdir = join_paths(prefix, get_option('sysconfdir')) +includedir = join_paths(prefix, get_option('includedir')) +datadir = join_paths(prefix, get_option('datadir')) +libexecdir = join_paths(prefix, get_option('libexecdir')) + +conf = configuration_data() +conf.set_quoted('VERSION', version) + +gnome = import('gnome') +configure_file(output: 'config.h', configuration: conf) + +root_inc = include_directories('.') + +subdir('arrow-glib') + +if get_option('enable_gtk_doc') + subdir('doc/reference') +endif diff --git a/c_glib/meson_options.txt b/c_glib/meson_options.txt new file mode 100644 index 000000000000..2988e1af0acc --- /dev/null +++ b/c_glib/meson_options.txt @@ -0,0 +1,23 @@ +# -*- indent-tabs-mode: nil -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +option('enable_gtk_doc', + type: 'boolean', + value: false, + description: 'Build document by GTK-Doc') diff --git a/c_glib/tool/Makefile.am b/c_glib/tool/Makefile.am new file mode 100644 index 000000000000..5d7498b95752 --- /dev/null +++ b/c_glib/tool/Makefile.am @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +EXTRA_DIST = \ + get-version.py diff --git a/c_glib/tool/get-version.py b/c_glib/tool/get-version.py new file mode 100755 index 000000000000..aacea6da3e86 --- /dev/null +++ b/c_glib/tool/get-version.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import os +import re + +root = os.environ.get("MESON_SOURCE_ROOT", ".") +pom_xml = os.path.join(root, "..", "java", "pom.xml") +with open(pom_xml) as pom: + version_tag = re.search('^ (.+)', + pom.read(), + re.MULTILINE) + print(version_tag.group(1)) From 6bc0f81bf0a9a88d7dcefaac0e95becd965ddc75 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Fri, 13 Oct 2017 23:20:53 +0900 Subject: [PATCH 02/17] [GLib] Add missing Makefile.am --- c_glib/.gitignore | 2 +- c_glib/doc/reference/xml/Makefile.am | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 c_glib/doc/reference/xml/Makefile.am diff --git a/c_glib/.gitignore b/c_glib/.gitignore index 6922691a8d4f..03bb0fe61892 100644 --- a/c_glib/.gitignore +++ b/c_glib/.gitignore @@ -29,8 +29,8 @@ Makefile.in /doc/reference/gtk-doc.make /doc/reference/*.stamp /doc/reference/html/ -/doc/reference/xml/ /doc/reference/xml/* +!/doc/reference/xml/Makefile.am !/doc/reference/xml/meson.build !/doc/reference/xml/gtkdocentities.ent.in /doc/reference/tmpl/ diff --git a/c_glib/doc/reference/xml/Makefile.am b/c_glib/doc/reference/xml/Makefile.am new file mode 100644 index 000000000000..833cfddc6907 --- /dev/null +++ b/c_glib/doc/reference/xml/Makefile.am @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +EXTRA_DIST = \ + gtkdocentities.ent.in \ + meson.build From 30c2e85e8d8dd265c23dda4fb8b835ade35cc807 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sat, 14 Oct 2017 00:39:24 +0900 Subject: [PATCH 03/17] [GLib] Support building examples --- c_glib/example/Makefile.am | 3 +++ c_glib/example/meson.build | 25 +++++++++++++++++++++++++ c_glib/meson.build | 1 + 3 files changed, 29 insertions(+) create mode 100644 c_glib/example/meson.build diff --git a/c_glib/example/Makefile.am b/c_glib/example/Makefile.am index 6c177954c6cb..3eaf808bc5aa 100644 --- a/c_glib/example/Makefile.am +++ b/c_glib/example/Makefile.am @@ -18,6 +18,9 @@ SUBDIRS = \ lua +EXTRA_DIST = \ + meson.build + AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir) \ diff --git a/c_glib/example/meson.build b/c_glib/example/meson.build new file mode 100644 index 000000000000..338ac360f025 --- /dev/null +++ b/c_glib/example/meson.build @@ -0,0 +1,25 @@ +# -*- indent-tabs-mode: nil -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +executable('build', 'build.c', + dependencies: [libarrow_glib_dependency]) +executable('read-batch', 'read-batch.c', + dependencies: [libarrow_glib_dependency]) +executable('read-stream', 'read-stream.c', + dependencies: [libarrow_glib_dependency]) diff --git a/c_glib/meson.build b/c_glib/meson.build index e7e585bf280a..153605708348 100644 --- a/c_glib/meson.build +++ b/c_glib/meson.build @@ -55,6 +55,7 @@ configure_file(output: 'config.h', configuration: conf) root_inc = include_directories('.') subdir('arrow-glib') +subdir('example') if get_option('enable_gtk_doc') subdir('doc/reference') From 2d422afc0b46ca80dde619cb1fae9b6d58f1c26f Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sat, 14 Oct 2017 18:03:59 +0900 Subject: [PATCH 04/17] [GLib] Fix include path --- c_glib/arrow-glib/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c_glib/arrow-glib/meson.build b/c_glib/arrow-glib/meson.build index 7a1e06933556..66e685d0baff 100644 --- a/c_glib/arrow-glib/meson.build +++ b/c_glib/arrow-glib/meson.build @@ -182,7 +182,7 @@ libarrow_glib = library('arrow-glib', version: library_version) libarrow_glib_dependency = declare_dependency(link_with: libarrow_glib, include_directories: [ - include_directories('.'), + include_directories('..'), ], dependencies: dependencies, sources: generated_headers) From 25876b446d4f4cdf969a59708f468a752520f14d Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sat, 14 Oct 2017 18:11:34 +0900 Subject: [PATCH 05/17] [GLib] Support "meson test" --- c_glib/meson.build | 3 +++ c_glib/test/run-test.sh | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/c_glib/meson.build b/c_glib/meson.build index 153605708348..3a6105bfb698 100644 --- a/c_glib/meson.build +++ b/c_glib/meson.build @@ -60,3 +60,6 @@ subdir('example') if get_option('enable_gtk_doc') subdir('doc/reference') endif + +run_test = find_program('test/run-test.sh') +test('unit test', run_test) diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh index efa2829d74a2..506f31bf32bb 100755 --- a/c_glib/test/run-test.sh +++ b/c_glib/test/run-test.sh @@ -17,13 +17,15 @@ # specific language governing permissions and limitations # under the License. -base_dir="$(cd .; pwd)" -lib_dir="${base_dir}/arrow-glib/.libs" +test_dir="$(cd $(dirname $0); pwd)" +libs_dir="${test_dir}/../arrow-glib/.libs" -LD_LIBRARY_PATH="${lib_dir}:${LD_LIBRARY_PATH}" +if [ -d "${libs_dir}" ]; then + LD_LIBRARY_PATH="${libs_dir}:${LD_LIBRARY_PATH}" +fi if [ -f "Makefile" -a "${NO_MAKE}" != "yes" ]; then make -j8 > /dev/null || exit $? fi -${GDB} ruby ${base_dir}/test/run-test.rb "$@" +${GDB} ruby ${test_dir}/run-test.rb "$@" From 9b76f76a44707da408a1525a5049aadca5654fe9 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sat, 14 Oct 2017 18:16:55 +0900 Subject: [PATCH 06/17] [GLib] Support running test in no libtool case --- c_glib/test/run-test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh index 506f31bf32bb..00cb6cefebda 100755 --- a/c_glib/test/run-test.sh +++ b/c_glib/test/run-test.sh @@ -18,10 +18,16 @@ # under the License. test_dir="$(cd $(dirname $0); pwd)" -libs_dir="${test_dir}/../arrow-glib/.libs" +base_dir="$(cd .; pwd)" +libs_dir="${base_dir}/arrow-glib/.libs" if [ -d "${libs_dir}" ]; then LD_LIBRARY_PATH="${libs_dir}:${LD_LIBRARY_PATH}" +else + build_dir="${base_dir}/arrow-glib" + if [ -d "${build_dir}" ]; then + LD_LIBRARY_PATH="${build_dir}:${LD_LIBRARY_PATH}" + fi fi if [ -f "Makefile" -a "${NO_MAKE}" != "yes" ]; then From 9db9fefe30610a0db85e5336d9bed242db5d2a0b Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sat, 14 Oct 2017 18:29:14 +0900 Subject: [PATCH 07/17] [GLib] Add Travis CI configuration for building Arrow GLib with Meson --- .travis.yml | 18 +++++++- ci/travis_before_script_c_glib.sh | 77 ++++++++++++++++++++----------- ci/travis_script_c_glib.sh | 4 ++ 3 files changed, 70 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index e722c27f7191..18db79c09639 100644 --- a/.travis.yml +++ b/.travis.yml @@ -120,7 +120,21 @@ matrix: - compiler: gcc language: cpp os: linux - group: deprecated + env: + BUILD_SYSTEM: autotools + before_script: + - export CC="gcc-4.9" + - export CXX="g++-4.9" + - $TRAVIS_BUILD_DIR/ci/travis_lint.sh + - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library + - $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh + script: + - $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh + - compiler: gcc + language: cpp + os: linux + env: + BUILD_SYSTEM: meson before_script: - export CC="gcc-4.9" - export CXX="g++-4.9" @@ -135,6 +149,8 @@ matrix: cache: addons: rvm: 2.2 + env: + BUILD_SYSTEM: autotools before_script: - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library - $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh diff --git a/ci/travis_before_script_c_glib.sh b/ci/travis_before_script_c_glib.sh index 14e4f9fa1139..09387570c702 100755 --- a/ci/travis_before_script_c_glib.sh +++ b/ci/travis_before_script_c_glib.sh @@ -27,11 +27,16 @@ if [ $TRAVIS_OS_NAME == "osx" ]; then export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig fi +if [ $BUILD_SYSTEM = "meson" ]; then + source $TRAVIS_BUILD_DIR/ci/travis_install_conda.sh + pip install meson ninja +fi + gem install test-unit gobject-introspection if [ $TRAVIS_OS_NAME == "osx" ]; then sudo env PKG_CONFIG_PATH=$PKG_CONFIG_PATH luarocks install lgi -else +elif [ $BUILD_SYSTEM = "autotools" ]; then git clone \ --quiet \ --depth 1 \ @@ -45,41 +50,57 @@ else luarocks install lgi fi -go get github.com/linuxdeepin/go-gir-generator || : -pushd $GOPATH/src/github.com/linuxdeepin/go-gir-generator -rm lib.in/gio-2.0/gdk_workaround.go -mv lib.in/gio-2.0/config.json{,.orig} -sed \ - -e 's/\("Settings",\)/\/\/ \1/g' \ - -e 's/\("SettingsBackend",\)/\/\/ \1/g' \ - lib.in/gio-2.0/config.json.orig > lib.in/gio-2.0/config.json -mv Makefile{,.orig} -sed -e 's/ gudev-1.0//' Makefile.orig > Makefile -mkdir -p out/src/gir/gudev-1.0 -make build copyfile -mkdir -p $GOPATH/bin/ -cp -a out/gir-generator $GOPATH/bin/ -cp -a out/src/gir/ $GOPATH/src/gir/ -popd +if [ $BUILD_SYSTEM = "autotools" ]; then + go get github.com/linuxdeepin/go-gir-generator || : + pushd $GOPATH/src/github.com/linuxdeepin/go-gir-generator + rm lib.in/gio-2.0/gdk_workaround.go + mv lib.in/gio-2.0/config.json{,.orig} + sed \ + -e 's/\("Settings",\)/\/\/ \1/g' \ + -e 's/\("SettingsBackend",\)/\/\/ \1/g' \ + lib.in/gio-2.0/config.json.orig > lib.in/gio-2.0/config.json + mv Makefile{,.orig} + sed -e 's/ gudev-1.0//' Makefile.orig > Makefile + mkdir -p out/src/gir/gudev-1.0 + make build copyfile + mkdir -p $GOPATH/bin/ + cp -a out/gir-generator $GOPATH/bin/ + cp -a out/src/gir/ $GOPATH/src/gir/ + popd +fi pushd $ARROW_C_GLIB_DIR -./autogen.sh - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_CPP_INSTALL/lib/pkgconfig export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_CPP_INSTALL/lib -CONFIGURE_OPTIONS="--prefix=$ARROW_C_GLIB_INSTALL" -if [ $TRAVIS_OS_NAME != "osx" ]; then - CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS --enable-gtk-doc" -fi +if [ $BUILD_SYSTEM = "autotools" ]; then + ./autogen.sh + + CONFIGURE_OPTIONS="--prefix=$ARROW_C_GLIB_INSTALL" + if [ $TRAVIS_OS_NAME != "osx" ]; then + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS --enable-gtk-doc" + fi -CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS CFLAGS=-DARROW_NO_DEPRECATED_API" -CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS CXXFLAGS=-DARROW_NO_DEPRECATED_API" + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS CFLAGS=-DARROW_NO_DEPRECATED_API" + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS CXXFLAGS=-DARROW_NO_DEPRECATED_API" -./configure $CONFIGURE_OPTIONS + ./configure $CONFIGURE_OPTIONS -make -j4 -make install + make -j4 + make install +else + MESON_OPTIONS="--prefix=$ARROW_C_GLIB_INSTALL" + MESON_OPTIONS="$MESON_OPTIONS -Denable_gtk_doc=true" + mkdir -p build + env \ + CFLAGS="-DARROW_NO_DEPRECATED_API" \ + CXXFLAGS="-DARROW_NO_DEPRECATED_API" \ + meson build $MESON_OPTIONS + pushd build + ninja + ninja install + popd +fi popd diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh index d392abdfbbc3..9402460ee3e3 100755 --- a/ci/travis_script_c_glib.sh +++ b/ci/travis_script_c_glib.sh @@ -26,6 +26,10 @@ pushd $ARROW_C_GLIB_DIR export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_CPP_INSTALL/lib NO_MAKE=yes test/run-test.sh +if [ $BUILD_SYSTEM = "meson" ]; then + exit +fi + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_C_GLIB_INSTALL/lib export GI_TYPELIB_PATH=$ARROW_C_GLIB_INSTALL/lib/girepository-1.0 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_CPP_INSTALL/lib/pkgconfig From 06777d3c94222659c2c69f1508f7cb4d0fcd2c46 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 11:50:16 +0900 Subject: [PATCH 08/17] [GLib] Fix generated files dependency --- c_glib/arrow-glib/meson.build | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/c_glib/arrow-glib/meson.build b/c_glib/arrow-glib/meson.build index 66e685d0baff..236d3d9e0e62 100644 --- a/c_glib/arrow-glib/meson.build +++ b/c_glib/arrow-glib/meson.build @@ -149,19 +149,19 @@ cpp_headers += files( ) -gnome.mkenums('enums', - sources: c_headers, - identifier_prefix: 'GArrow', - symbol_prefix: 'garrow', - c_template: 'enums.c.template', - h_template: 'enums.h.template', - install_dir: includedir, - install_header: true) -generated_sources = files('enums.c') -generated_headers = files('enums.h') - - -headers = c_headers + cpp_headers + generated_headers +enums = gnome.mkenums('enums', + sources: c_headers, + identifier_prefix: 'GArrow', + symbol_prefix: 'garrow', + c_template: 'enums.c.template', + h_template: 'enums.h.template', + install_dir: includedir, + install_header: true) +enums_source = enums[0] +enums_header = enums[1] + + +headers = c_headers + cpp_headers + [enums_header.full_path()] install_headers(headers, subdir: meson.project_name()) @@ -171,7 +171,7 @@ dependencies = [ dependency('gio-2.0'), ] libarrow_glib = library('arrow-glib', - sources: sources + generated_sources, + sources: sources + [enums_source], install: true, dependencies: dependencies, include_directories: [ @@ -185,10 +185,10 @@ libarrow_glib_dependency = declare_dependency(link_with: libarrow_glib, include_directories('..'), ], dependencies: dependencies, - sources: generated_headers) + sources: enums_header) gnome.generate_gir(libarrow_glib, - sources: sources + c_headers + generated_headers, + sources: sources + c_headers + enums, namespace: 'Arrow', nsversion: api_version, identifier_prefix: 'GArrow', From cd5e9d381db78efad7cb573d33937a6d519e9135 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 11:50:39 +0900 Subject: [PATCH 09/17] [GLib] Use correct file in test --- c_glib/meson.build | 4 +++- c_glib/test/run-test.rb | 6 ++++-- c_glib/test/run-test.sh | 14 +++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/c_glib/meson.build b/c_glib/meson.build index 3a6105bfb698..1a152858f5ab 100644 --- a/c_glib/meson.build +++ b/c_glib/meson.build @@ -62,4 +62,6 @@ if get_option('enable_gtk_doc') endif run_test = find_program('test/run-test.sh') -test('unit test', run_test) +test('unit test', + run_test, + env: ['GARROW_TYPELIB_DIR=@0@/arrow-glib'.format(meson.build_root())]) diff --git a/c_glib/test/run-test.rb b/c_glib/test/run-test.rb index 75ff34ff4728..10e4f2f98efe 100755 --- a/c_glib/test/run-test.rb +++ b/c_glib/test/run-test.rb @@ -21,11 +21,13 @@ require "test-unit" base_dir = Pathname(__dir__).parent -typelib_dir = base_dir + "arrow-glib" test_dir = base_dir + "test" +garrow_typelib_dir = ENV["GARROW_TYPELIB_DIR"] +garrow_typelib_dir ||= (base_dir + "arrow-glib").to_s + ENV["GI_TYPELIB_PATH"] = [ - typelib_dir.to_s, + garrow_typelib_dir.to_s, ENV["GI_TYPELIB_PATH"], ].compact.join(File::PATH_SEPARATOR) diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh index 00cb6cefebda..b05954b54670 100755 --- a/c_glib/test/run-test.sh +++ b/c_glib/test/run-test.sh @@ -18,15 +18,15 @@ # under the License. test_dir="$(cd $(dirname $0); pwd)" -base_dir="$(cd .; pwd)" +build_dir="$(cd .; pwd)" -libs_dir="${base_dir}/arrow-glib/.libs" -if [ -d "${libs_dir}" ]; then - LD_LIBRARY_PATH="${libs_dir}:${LD_LIBRARY_PATH}" +arrow_glib_build_dir="${build_dir}/arrow-glib/" +libtool_dir="${arrow_glib_build_dir}/.libs" +if [ -d "${libtool_dir}" ]; then + LD_LIBRARY_PATH="${libtool_dir}:${LD_LIBRARY_PATH}" else - build_dir="${base_dir}/arrow-glib" - if [ -d "${build_dir}" ]; then - LD_LIBRARY_PATH="${build_dir}:${LD_LIBRARY_PATH}" + if [ -d "${arrow_glib_build_dir}" ]; then + LD_LIBRARY_PATH="${arrow_glib_build_dir}:${LD_LIBRARY_PATH}" fi fi From 93cdd855ce0ebd521e7f038df7f1c8e1153f8ff7 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 12:42:16 +0900 Subject: [PATCH 10/17] [GLib] Fix build dependencies --- c_glib/arrow-glib/meson.build | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/c_glib/arrow-glib/meson.build b/c_glib/arrow-glib/meson.build index 236d3d9e0e62..fcec84c31d5d 100644 --- a/c_glib/arrow-glib/meson.build +++ b/c_glib/arrow-glib/meson.build @@ -155,13 +155,13 @@ enums = gnome.mkenums('enums', symbol_prefix: 'garrow', c_template: 'enums.c.template', h_template: 'enums.h.template', - install_dir: includedir, + install_dir: join_paths(includedir, meson.project_name()), install_header: true) enums_source = enums[0] enums_header = enums[1] -headers = c_headers + cpp_headers + [enums_header.full_path()] +headers = c_headers + cpp_headers install_headers(headers, subdir: meson.project_name()) @@ -171,18 +171,17 @@ dependencies = [ dependency('gio-2.0'), ] libarrow_glib = library('arrow-glib', - sources: sources + [enums_source], + sources: sources + enums, install: true, dependencies: dependencies, include_directories: [ root_inc, - include_directories('.'), ], soversion: so_version, version: library_version) libarrow_glib_dependency = declare_dependency(link_with: libarrow_glib, include_directories: [ - include_directories('..'), + root_inc, ], dependencies: dependencies, sources: enums_header) From f963697668fc9151ebf3fbbdcd7ecaa524bd335f Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 12:42:32 +0900 Subject: [PATCH 11/17] [GLib] Fix "string equal" operator in Travis CI script --- ci/travis_before_script_c_glib.sh | 4 ++-- ci/travis_script_c_glib.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/travis_before_script_c_glib.sh b/ci/travis_before_script_c_glib.sh index 09387570c702..25ed7b2ee4b0 100755 --- a/ci/travis_before_script_c_glib.sh +++ b/ci/travis_before_script_c_glib.sh @@ -21,7 +21,7 @@ set -ex source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh -if [ $TRAVIS_OS_NAME == "osx" ]; then +if [ $TRAVIS_OS_NAME = "osx" ]; then brew update && brew bundle --file=c_glib/Brewfile export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig @@ -34,7 +34,7 @@ fi gem install test-unit gobject-introspection -if [ $TRAVIS_OS_NAME == "osx" ]; then +if [ $TRAVIS_OS_NAME = "osx" ]; then sudo env PKG_CONFIG_PATH=$PKG_CONFIG_PATH luarocks install lgi elif [ $BUILD_SYSTEM = "autotools" ]; then git clone \ diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh index 9402460ee3e3..40eaa3878ca1 100755 --- a/ci/travis_script_c_glib.sh +++ b/ci/travis_script_c_glib.sh @@ -36,7 +36,7 @@ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_CPP_INSTALL/lib/pkgconfig export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_C_GLIB_INSTALL/lib/pkgconfig pushd example/lua -if [ $TRAVIS_OS_NAME == "osx" ]; then +if [ $TRAVIS_OS_NAME = "osx" ]; then lua write-batch.lua lua read-batch.lua lua write-stream.lua From d601ad4c251442c4bd8a6a41db383a1a595c9fa5 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 12:53:35 +0900 Subject: [PATCH 12/17] [GLib] Disable Torch build test Because it increases test time and isn't maintainable. --- .travis.yml | 2 ++ ci/travis_before_script_c_glib.sh | 24 ++++++++++++++---------- ci/travis_script_c_glib.sh | 19 +++++++++++++------ 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 18db79c09639..8b00b326856a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -122,6 +122,7 @@ matrix: os: linux env: BUILD_SYSTEM: autotools + BUILD_TORCH_EXAMPLE: false before_script: - export CC="gcc-4.9" - export CXX="g++-4.9" @@ -135,6 +136,7 @@ matrix: os: linux env: BUILD_SYSTEM: meson + BUILD_TORCH_EXAMPLE: false before_script: - export CC="gcc-4.9" - export CXX="g++-4.9" diff --git a/ci/travis_before_script_c_glib.sh b/ci/travis_before_script_c_glib.sh index 25ed7b2ee4b0..58d32a47d396 100755 --- a/ci/travis_before_script_c_glib.sh +++ b/ci/travis_before_script_c_glib.sh @@ -37,16 +37,20 @@ gem install test-unit gobject-introspection if [ $TRAVIS_OS_NAME = "osx" ]; then sudo env PKG_CONFIG_PATH=$PKG_CONFIG_PATH luarocks install lgi elif [ $BUILD_SYSTEM = "autotools" ]; then - git clone \ - --quiet \ - --depth 1 \ - --recursive \ - https://github.com/torch/distro.git ~/torch - pushd ~/torch - ./install-deps > /dev/null - echo "yes" | ./install.sh > /dev/null - . ~/torch/install/bin/torch-activate - popd + if [ $BUILD_TORCH_EXAMPLE = "yes" ]; then + git clone \ + --quiet \ + --depth 1 \ + --recursive \ + https://github.com/torch/distro.git ~/torch + pushd ~/torch + ./install-deps > /dev/null + echo "yes" | ./install.sh > /dev/null + . ~/torch/install/bin/torch-activate + popd + else + sudo apt install -y -qq luarocks + fi luarocks install lgi fi diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh index 40eaa3878ca1..b704af8cd244 100755 --- a/ci/travis_script_c_glib.sh +++ b/ci/travis_script_c_glib.sh @@ -42,12 +42,19 @@ if [ $TRAVIS_OS_NAME = "osx" ]; then lua write-stream.lua lua read-stream.lua else - . ~/torch/install/bin/torch-activate - luajit write-batch.lua - luajit read-batch.lua - luajit write-stream.lua - luajit read-stream.lua - luajit stream-to-torch-tensor.lua + if [ $BUILD_TORCH_EXAMPLE = "yes" ]; then + . ~/torch/install/bin/torch-activate + luajit write-batch.lua + luajit read-batch.lua + luajit write-stream.lua + luajit read-stream.lua + luajit stream-to-torch-tensor.lua + else + lua write-batch.lua + lua read-batch.lua + lua write-stream.lua + lua read-stream.lua + fi fi popd From 37d41161ed9dedd7d0551181e295c43834c56ed1 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 13:01:40 +0900 Subject: [PATCH 13/17] [GLib] Use installed files in test --- c_glib/meson.build | 2 +- c_glib/test/run-test.rb | 8 -------- c_glib/test/run-test.sh | 9 +++++++++ ci/travis_script_c_glib.sh | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/c_glib/meson.build b/c_glib/meson.build index 1a152858f5ab..682a417e884a 100644 --- a/c_glib/meson.build +++ b/c_glib/meson.build @@ -64,4 +64,4 @@ endif run_test = find_program('test/run-test.sh') test('unit test', run_test, - env: ['GARROW_TYPELIB_DIR=@0@/arrow-glib'.format(meson.build_root())]) + env: ['ARROW_GLIB_TYPELIB_DIR=@0@/arrow-glib'.format(meson.build_root())]) diff --git a/c_glib/test/run-test.rb b/c_glib/test/run-test.rb index 10e4f2f98efe..3451bd29fde1 100755 --- a/c_glib/test/run-test.rb +++ b/c_glib/test/run-test.rb @@ -23,14 +23,6 @@ base_dir = Pathname(__dir__).parent test_dir = base_dir + "test" -garrow_typelib_dir = ENV["GARROW_TYPELIB_DIR"] -garrow_typelib_dir ||= (base_dir + "arrow-glib").to_s - -ENV["GI_TYPELIB_PATH"] = [ - garrow_typelib_dir.to_s, - ENV["GI_TYPELIB_PATH"], -].compact.join(File::PATH_SEPARATOR) - require "gi" Gio = GI.load("Gio") diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh index b05954b54670..19ccf077833a 100755 --- a/c_glib/test/run-test.sh +++ b/c_glib/test/run-test.sh @@ -34,4 +34,13 @@ if [ -f "Makefile" -a "${NO_MAKE}" != "yes" ]; then make -j8 > /dev/null || exit $? fi +arrow_glib_typelib_dir="${ARROW_GLIB_TYPELIB_DIR}" +if [ -z "${arrow_glib_typelib_dir}" ]; then + arrow_glib_typelib_dir="${build_dir}/arrow-glib" +fi + +if [ -d "${arrow_glib_typelib_dir}" ]; then + GI_TYPELIB_PATH="${arrow_glib_typelib_dir}:${GI_TYPELIB_PATH}" +fi + ${GDB} ruby ${test_dir}/run-test.rb "$@" diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh index b704af8cd244..16a5e87b2164 100755 --- a/ci/travis_script_c_glib.sh +++ b/ci/travis_script_c_glib.sh @@ -24,14 +24,14 @@ source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh pushd $ARROW_C_GLIB_DIR export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_CPP_INSTALL/lib -NO_MAKE=yes test/run-test.sh +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_C_GLIB_INSTALL/lib +export GI_TYPELIB_PATH=$ARROW_C_GLIB_INSTALL/lib/girepository-1.0 +test/run-test.rb if [ $BUILD_SYSTEM = "meson" ]; then exit fi -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_C_GLIB_INSTALL/lib -export GI_TYPELIB_PATH=$ARROW_C_GLIB_INSTALL/lib/girepository-1.0 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_CPP_INSTALL/lib/pkgconfig export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_C_GLIB_INSTALL/lib/pkgconfig From 029d5b3fae93fb8d928af0793e81e3d45052339c Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 13:18:58 +0900 Subject: [PATCH 14/17] [GLib] Fix build failure on Travis CI --- .travis.yml | 11 +++-------- ci/travis_before_script_c_glib.sh | 3 ++- ci/travis_script_c_glib.sh | 6 +++++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b00b326856a..c682a9d9db89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -120,9 +120,7 @@ matrix: - compiler: gcc language: cpp os: linux - env: - BUILD_SYSTEM: autotools - BUILD_TORCH_EXAMPLE: false + env: BUILD_SYSTEM=autotools BUILD_TORCH_EXAMPLE=no before_script: - export CC="gcc-4.9" - export CXX="g++-4.9" @@ -134,9 +132,7 @@ matrix: - compiler: gcc language: cpp os: linux - env: - BUILD_SYSTEM: meson - BUILD_TORCH_EXAMPLE: false + env: BUILD_SYSTEM=meson BUILD_TORCH_EXAMPLE=no before_script: - export CC="gcc-4.9" - export CXX="g++-4.9" @@ -151,8 +147,7 @@ matrix: cache: addons: rvm: 2.2 - env: - BUILD_SYSTEM: autotools + env: BUILD_SYSTEM=autotools before_script: - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library - $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh diff --git a/ci/travis_before_script_c_glib.sh b/ci/travis_before_script_c_glib.sh index 58d32a47d396..d60f6296cc46 100755 --- a/ci/travis_before_script_c_glib.sh +++ b/ci/travis_before_script_c_glib.sh @@ -48,10 +48,11 @@ elif [ $BUILD_SYSTEM = "autotools" ]; then echo "yes" | ./install.sh > /dev/null . ~/torch/install/bin/torch-activate popd + luarocks install lgi else sudo apt install -y -qq luarocks + sudo luarocks install lgi fi - luarocks install lgi fi if [ $BUILD_SYSTEM = "autotools" ]; then diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh index 16a5e87b2164..6e338dea6390 100755 --- a/ci/travis_script_c_glib.sh +++ b/ci/travis_script_c_glib.sh @@ -25,7 +25,11 @@ pushd $ARROW_C_GLIB_DIR export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_CPP_INSTALL/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_C_GLIB_INSTALL/lib -export GI_TYPELIB_PATH=$ARROW_C_GLIB_INSTALL/lib/girepository-1.0 +if [ $BUILD_SYSTEM = "autotools" ]; then + export GI_TYPELIB_PATH=$ARROW_C_GLIB_INSTALL/lib/girepository-1.0 +else + export GI_TYPELIB_PATH=$(echo $ARROW_C_GLIB_INSTALL/lib/*/girepository-1.0) +fi test/run-test.rb if [ $BUILD_SYSTEM = "meson" ]; then From c5702d993bc32f457673014108ba500ae78afadc Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 15:03:33 +0900 Subject: [PATCH 15/17] [GLib] Add missing license information --- c_glib/doc/reference/xml/gtkdocentities.ent.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/c_glib/doc/reference/xml/gtkdocentities.ent.in b/c_glib/doc/reference/xml/gtkdocentities.ent.in index b5aefa8fc843..dc0cf1a0d8d4 100644 --- a/c_glib/doc/reference/xml/gtkdocentities.ent.in +++ b/c_glib/doc/reference/xml/gtkdocentities.ent.in @@ -1,3 +1,21 @@ + From 1925be0914858b025547d0129c5384c0ed7a51c9 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 18:14:50 +0900 Subject: [PATCH 16/17] [GLib] Use correct LD_LIBRARY_PATH for Meson build --- ci/travis_script_c_glib.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh index 6e338dea6390..3833bb1701d9 100755 --- a/ci/travis_script_c_glib.sh +++ b/ci/travis_script_c_glib.sh @@ -24,12 +24,13 @@ source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh pushd $ARROW_C_GLIB_DIR export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_CPP_INSTALL/lib -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_C_GLIB_INSTALL/lib if [ $BUILD_SYSTEM = "autotools" ]; then - export GI_TYPELIB_PATH=$ARROW_C_GLIB_INSTALL/lib/girepository-1.0 + arrow_c_glib_lib_dir=$ARROW_C_GLIB_INSTALL/lib else - export GI_TYPELIB_PATH=$(echo $ARROW_C_GLIB_INSTALL/lib/*/girepository-1.0) + arrow_c_glib_lib_dir=$ARROW_C_GLIB_INSTALL/lib/$(arch)-linux-gnu fi +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$arrow_c_glib_lib_dir +export GI_TYPELIB_PATH=$arrow_c_glib_lib_dir/girepository-1.0 test/run-test.rb if [ $BUILD_SYSTEM = "meson" ]; then @@ -37,7 +38,7 @@ if [ $BUILD_SYSTEM = "meson" ]; then fi export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_CPP_INSTALL/lib/pkgconfig -export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_C_GLIB_INSTALL/lib/pkgconfig +export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$arrow_c_glib_lib_dir/pkgconfig pushd example/lua if [ $TRAVIS_OS_NAME = "osx" ]; then From 409cd7bcbcdc6f42b21cf1a70316832b4cd4ff82 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 15 Oct 2017 21:46:42 +0900 Subject: [PATCH 17/17] [GLib] Use pkgconfig module --- c_glib/arrow-glib/meson.build | 24 +++++++++--------------- c_glib/doc/reference/meson.build | 2 +- c_glib/meson.build | 12 +++--------- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/c_glib/arrow-glib/meson.build b/c_glib/arrow-glib/meson.build index fcec84c31d5d..226c696bdcf3 100644 --- a/c_glib/arrow-glib/meson.build +++ b/c_glib/arrow-glib/meson.build @@ -17,20 +17,6 @@ # specific language governing permissions and limitations # under the License. -pkg_conf = configuration_data() -pkg_conf.set('prefix', prefix) -pkg_conf.set('exec_prefix', prefix) -pkg_conf.set('libdir', libdir) -pkg_conf.set('includedir', includedir) -pkg_conf.set('VERSION', version) - -pc = meson.project_name() + '.pc' -configure_file(input: pc + '.in', - output: pc, - configuration: pkg_conf, - install: true, - install_dir: join_paths(libdir, 'pkgconfig')) - sources = files( 'array.cpp', 'array-builder.cpp', @@ -155,7 +141,7 @@ enums = gnome.mkenums('enums', symbol_prefix: 'garrow', c_template: 'enums.c.template', h_template: 'enums.h.template', - install_dir: join_paths(includedir, meson.project_name()), + install_dir: join_paths(include_dir, meson.project_name()), install_header: true) enums_source = enums[0] enums_header = enums[1] @@ -186,6 +172,14 @@ libarrow_glib_dependency = declare_dependency(link_with: libarrow_glib, dependencies: dependencies, sources: enums_header) +pkgconfig.generate(filebase: meson.project_name(), + name: 'Apache Arrow GLib', + description: 'C API for Apache Arrow based on GLib', + version: version, + requires: ['gobject-2.0', 'arrow'], + libraries: [libarrow_glib], + subdirs: ['arrow-glib']) + gnome.generate_gir(libarrow_glib, sources: sources + c_headers + enums, namespace: 'Arrow', diff --git a/c_glib/doc/reference/meson.build b/c_glib/doc/reference/meson.build index 4eba0aa33317..08936daf8728 100644 --- a/c_glib/doc/reference/meson.build +++ b/c_glib/doc/reference/meson.build @@ -30,7 +30,7 @@ html_images = [ glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') glib_doc_path = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') -doc_path = join_paths(datadir, meson.project_name(), 'gtk-doc', 'html') +doc_path = join_paths(data_dir, meson.project_name(), 'gtk-doc', 'html') gnome.gtkdoc(meson.project_name(), main_xml: meson.project_name() + '-docs.sgml', diff --git a/c_glib/meson.build b/c_glib/meson.build index 682a417e884a..1fa64ba19c40 100644 --- a/c_glib/meson.build +++ b/c_glib/meson.build @@ -40,17 +40,11 @@ so_version = 0 library_version = '@0@.@1@.@2@'.format(so_version, 0, 0) prefix = get_option('prefix') -libdir = join_paths(prefix, get_option('libdir')) -sysconfdir = join_paths(prefix, get_option('sysconfdir')) -includedir = join_paths(prefix, get_option('includedir')) -datadir = join_paths(prefix, get_option('datadir')) -libexecdir = join_paths(prefix, get_option('libexecdir')) - -conf = configuration_data() -conf.set_quoted('VERSION', version) +include_dir = join_paths(prefix, get_option('includedir')) +data_dir = join_paths(prefix, get_option('datadir')) gnome = import('gnome') -configure_file(output: 'config.h', configuration: conf) +pkgconfig = import('pkgconfig') root_inc = include_directories('.')