Repository: arrow Updated Branches: refs/heads/master a6a97a9d4 -> e39b47970
ARROW-1667: [GLib] Support Meson Author: Kouhei Sutou <[email protected]> Closes #1196 from kou/c-glib-support-meson and squashes the following commits: 409cd7bc [Kouhei Sutou] [GLib] Use pkgconfig module 1925be09 [Kouhei Sutou] [GLib] Use correct LD_LIBRARY_PATH for Meson build c5702d99 [Kouhei Sutou] [GLib] Add missing license information 029d5b3f [Kouhei Sutou] [GLib] Fix build failure on Travis CI 37d41161 [Kouhei Sutou] [GLib] Use installed files in test d601ad4c [Kouhei Sutou] [GLib] Disable Torch build test f9636976 [Kouhei Sutou] [GLib] Fix "string equal" operator in Travis CI script 93cdd855 [Kouhei Sutou] [GLib] Fix build dependencies cd5e9d38 [Kouhei Sutou] [GLib] Use correct file in test 06777d3c [Kouhei Sutou] [GLib] Fix generated files dependency 9db9fefe [Kouhei Sutou] [GLib] Add Travis CI configuration for building Arrow GLib with Meson 9b76f76a [Kouhei Sutou] [GLib] Support running test in no libtool case 25876b44 [Kouhei Sutou] [GLib] Support "meson test" 2d422afc [Kouhei Sutou] [GLib] Fix include path 30c2e85e [Kouhei Sutou] [GLib] Support building examples 6bc0f81b [Kouhei Sutou] [GLib] Add missing Makefile.am 12383deb [Kouhei Sutou] [GLib] Support Meson Project: http://git-wip-us.apache.org/repos/asf/arrow/repo Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/e39b4797 Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/e39b4797 Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/e39b4797 Branch: refs/heads/master Commit: e39b479707b80fa8762cea1b69e23259e1c3f507 Parents: a6a97a9 Author: Kouhei Sutou <[email protected]> Authored: Mon Oct 16 22:51:54 2017 +0900 Committer: Kouhei Sutou <[email protected]> Committed: Mon Oct 16 22:51:54 2017 +0900 ---------------------------------------------------------------------- .travis.yml | 15 +- c_glib/.gitignore | 5 +- c_glib/Makefile.am | 5 +- c_glib/arrow-glib/Makefile.am | 3 +- c_glib/arrow-glib/meson.build | 197 ++++++++++++++++++++ c_glib/configure.ac | 2 + c_glib/doc/reference/Makefile.am | 9 +- c_glib/doc/reference/meson.build | 58 ++++++ c_glib/doc/reference/xml/Makefile.am | 20 ++ c_glib/doc/reference/xml/gtkdocentities.ent.in | 24 +++ c_glib/doc/reference/xml/meson.build | 31 +++ c_glib/example/Makefile.am | 3 + c_glib/example/meson.build | 25 +++ c_glib/meson.build | 61 ++++++ c_glib/meson_options.txt | 23 +++ c_glib/test/run-test.rb | 6 - c_glib/test/run-test.sh | 25 ++- c_glib/tool/Makefile.am | 19 ++ c_glib/tool/get-version.py | 29 +++ ci/travis_before_script_c_glib.sh | 108 +++++++---- ci/travis_script_c_glib.sh | 38 ++-- 21 files changed, 638 insertions(+), 68 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index e722c27..c682a9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -120,7 +120,19 @@ matrix: - compiler: gcc language: cpp os: linux - group: deprecated + env: BUILD_SYSTEM=autotools BUILD_TORCH_EXAMPLE=no + 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 BUILD_TORCH_EXAMPLE=no before_script: - export CC="gcc-4.9" - export CXX="g++-4.9" @@ -135,6 +147,7 @@ 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 http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/.gitignore ---------------------------------------------------------------------- diff --git a/c_glib/.gitignore b/c_glib/.gitignore index 373ae73..03bb0fe 100644 --- a/c_glib/.gitignore +++ b/c_glib/.gitignore @@ -29,7 +29,10 @@ 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/ /libtool /m4/ http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/Makefile.am ---------------------------------------------------------------------- diff --git a/c_glib/Makefile.am b/c_glib/Makefile.am index d059d12..577b749 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 http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/arrow-glib/Makefile.am ---------------------------------------------------------------------- diff --git a/c_glib/arrow-glib/Makefile.am b/c_glib/arrow-glib/Makefile.am index 4c22d11..2066fa7 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) \ http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/arrow-glib/meson.build ---------------------------------------------------------------------- diff --git a/c_glib/arrow-glib/meson.build b/c_glib/arrow-glib/meson.build new file mode 100644 index 0000000..226c696 --- /dev/null +++ b/c_glib/arrow-glib/meson.build @@ -0,0 +1,197 @@ +# -*- 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. + +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', +) + + +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: join_paths(include_dir, meson.project_name()), + install_header: true) +enums_source = enums[0] +enums_header = enums[1] + + +headers = c_headers + cpp_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 + enums, + install: true, + dependencies: dependencies, + include_directories: [ + root_inc, + ], + soversion: so_version, + version: library_version) +libarrow_glib_dependency = declare_dependency(link_with: libarrow_glib, + include_directories: [ + root_inc, + ], + 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', + 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', + ]) http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/configure.ac ---------------------------------------------------------------------- diff --git a/c_glib/configure.ac b/c_glib/configure.ac index 938064c..5db4352 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 http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/doc/reference/Makefile.am ---------------------------------------------------------------------- diff --git a/c_glib/doc/reference/Makefile.am b/c_glib/doc/reference/Makefile.am index d3389dc..45b11f0 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 http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/doc/reference/meson.build ---------------------------------------------------------------------- diff --git a/c_glib/doc/reference/meson.build b/c_glib/doc/reference/meson.build new file mode 100644 index 0000000..08936da --- /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(data_dir, 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) http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/doc/reference/xml/Makefile.am ---------------------------------------------------------------------- diff --git a/c_glib/doc/reference/xml/Makefile.am b/c_glib/doc/reference/xml/Makefile.am new file mode 100644 index 0000000..833cfdd --- /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 http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/doc/reference/xml/gtkdocentities.ent.in ---------------------------------------------------------------------- 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 0000000..dc0cf1a --- /dev/null +++ b/c_glib/doc/reference/xml/gtkdocentities.ent.in @@ -0,0 +1,24 @@ +<!-- + 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. +--> +<!ENTITY package "@package@"> +<!ENTITY package_bugreport "@package_bugreport@"> +<!ENTITY package_name "@package_name@"> +<!ENTITY package_string "@package_string@"> +<!ENTITY package_url "@package_url@"> +<!ENTITY package_version "@package_version@"> http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/doc/reference/xml/meson.build ---------------------------------------------------------------------- diff --git a/c_glib/doc/reference/xml/meson.build b/c_glib/doc/reference/xml/meson.build new file mode 100644 index 0000000..5b65042 --- /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) http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/example/Makefile.am ---------------------------------------------------------------------- diff --git a/c_glib/example/Makefile.am b/c_glib/example/Makefile.am index 6c17795..3eaf808 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) \ http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/example/meson.build ---------------------------------------------------------------------- diff --git a/c_glib/example/meson.build b/c_glib/example/meson.build new file mode 100644 index 0000000..338ac36 --- /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]) http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/meson.build ---------------------------------------------------------------------- diff --git a/c_glib/meson.build b/c_glib/meson.build new file mode 100644 index 0000000..1fa64ba --- /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') +include_dir = join_paths(prefix, get_option('includedir')) +data_dir = join_paths(prefix, get_option('datadir')) + +gnome = import('gnome') +pkgconfig = import('pkgconfig') + +root_inc = include_directories('.') + +subdir('arrow-glib') +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, + env: ['ARROW_GLIB_TYPELIB_DIR=@0@/arrow-glib'.format(meson.build_root())]) http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/meson_options.txt ---------------------------------------------------------------------- diff --git a/c_glib/meson_options.txt b/c_glib/meson_options.txt new file mode 100644 index 0000000..2988e1a --- /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') http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/test/run-test.rb ---------------------------------------------------------------------- diff --git a/c_glib/test/run-test.rb b/c_glib/test/run-test.rb index 75ff34f..3451bd2 100755 --- a/c_glib/test/run-test.rb +++ b/c_glib/test/run-test.rb @@ -21,14 +21,8 @@ require "pathname" require "test-unit" base_dir = Pathname(__dir__).parent -typelib_dir = base_dir + "arrow-glib" test_dir = base_dir + "test" -ENV["GI_TYPELIB_PATH"] = [ - typelib_dir.to_s, - ENV["GI_TYPELIB_PATH"], -].compact.join(File::PATH_SEPARATOR) - require "gi" Gio = GI.load("Gio") http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/test/run-test.sh ---------------------------------------------------------------------- diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh index efa2829..19ccf07 100755 --- a/c_glib/test/run-test.sh +++ b/c_glib/test/run-test.sh @@ -17,13 +17,30 @@ # 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)" +build_dir="$(cd .; pwd)" -LD_LIBRARY_PATH="${lib_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 + if [ -d "${arrow_glib_build_dir}" ]; then + LD_LIBRARY_PATH="${arrow_glib_build_dir}:${LD_LIBRARY_PATH}" + fi +fi if [ -f "Makefile" -a "${NO_MAKE}" != "yes" ]; then make -j8 > /dev/null || exit $? fi -${GDB} ruby ${base_dir}/test/run-test.rb "$@" +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 "$@" http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/tool/Makefile.am ---------------------------------------------------------------------- diff --git a/c_glib/tool/Makefile.am b/c_glib/tool/Makefile.am new file mode 100644 index 0000000..5d7498b --- /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 http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/c_glib/tool/get-version.py ---------------------------------------------------------------------- diff --git a/c_glib/tool/get-version.py b/c_glib/tool/get-version.py new file mode 100755 index 0000000..aacea6d --- /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('^ <version>(.+)</version>', + pom.read(), + re.MULTILINE) + print(version_tag.group(1)) http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/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 14e4f9f..d60f629 100755 --- a/ci/travis_before_script_c_glib.sh +++ b/ci/travis_before_script_c_glib.sh @@ -21,65 +21,91 @@ 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 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 +if [ $TRAVIS_OS_NAME = "osx" ]; then sudo env PKG_CONFIG_PATH=$PKG_CONFIG_PATH luarocks install lgi -else - 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 - luarocks install lgi +elif [ $BUILD_SYSTEM = "autotools" ]; then + 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 + luarocks install lgi + else + sudo apt install -y -qq luarocks + sudo luarocks install lgi + fi 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 http://git-wip-us.apache.org/repos/asf/arrow/blob/e39b4797/ci/travis_script_c_glib.sh ---------------------------------------------------------------------- diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh index d392abd..3833bb1 100755 --- a/ci/travis_script_c_glib.sh +++ b/ci/travis_script_c_glib.sh @@ -24,26 +24,42 @@ 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 +if [ $BUILD_SYSTEM = "autotools" ]; then + arrow_c_glib_lib_dir=$ARROW_C_GLIB_INSTALL/lib +else + 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 + 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 +export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$arrow_c_glib_lib_dir/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 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
