Skip to content

Commit 39c7274

Browse files
kouwesm
authored andcommitted
ARROW-631: [GLib] Import
See also https://issues.apache.org/jira/browse/ARROW-631 and `glib/README.md` in this change. Author: Kouhei Sutou <[email protected]> Closes #382 from kou/glib-import and squashes the following commits: 67a5d24 [Kouhei Sutou] [GLib] Rename directory to c_glib/ from glib/ 24cd605 [Kouhei Sutou] [GLib] Import
1 parent c13d671 commit 39c7274

File tree

246 files changed

+18251
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+18251
-0
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ addons:
1616
- libboost-filesystem-dev
1717
- libboost-system-dev
1818
- libjemalloc-dev
19+
- gtk-doc-tools
20+
- autoconf-archive
21+
- libgirepository1.0-dev
1922

2023
matrix:
2124
fast_finish: true
@@ -30,9 +33,11 @@ matrix:
3033
- export CC="gcc-4.9"
3134
- export CXX="g++-4.9"
3235
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
36+
- $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh
3337
script:
3438
- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh
3539
- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh
40+
- $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh
3641
- compiler: clang
3742
osx_image: xcode6.4
3843
os: osx

c_glib/.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Makefile
2+
Makefile.in
3+
.deps/
4+
.libs/
5+
*.gir
6+
*.typelib
7+
*.o
8+
*.lo
9+
*.la
10+
*~
11+
/*.tar.gz
12+
/aclocal.m4
13+
/autom4te.cache/
14+
/config.h
15+
/config.h.in
16+
/config.log
17+
/config.status
18+
/config/
19+
/configure
20+
/doc/reference/*.txt
21+
/doc/reference/*.txt.bak
22+
/doc/reference/*.args
23+
/doc/reference/*.hierarchy
24+
/doc/reference/*.interfaces
25+
/doc/reference/*.prerequisites
26+
/doc/reference/*.signals
27+
/doc/reference/*.types
28+
/doc/reference/gtk-doc.make
29+
/doc/reference/*.stamp
30+
/doc/reference/html/
31+
/doc/reference/xml/
32+
/libtool
33+
/m4/
34+
/stamp-h1
35+
/version
36+
/arrow-glib/enums.c
37+
/arrow-glib/enums.h
38+
/arrow-glib/io-enums.c
39+
/arrow-glib/io-enums.h
40+
/arrow-glib/ipc-enums.c
41+
/arrow-glib/ipc-enums.h
42+
/arrow-glib/stamp-*
43+
/arrow-glib/*.pc
44+
/example/build

c_glib/Makefile.am

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
19+
20+
SUBDIRS = \
21+
arrow-glib \
22+
doc \
23+
example
24+
25+
EXTRA_DIST = \
26+
version

c_glib/README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<!---
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License. See accompanying LICENSE file.
13+
-->
14+
15+
# Arrow GLib
16+
17+
Arrow GLib is a wrapper library for Arrow C++. Arrow GLib provides C
18+
API.
19+
20+
Arrow GLib supports
21+
[GObject Introspection](https://wiki.gnome.org/action/show/Projects/GObjectIntrospection).
22+
It means that you can create language bindings at runtime or compile time.
23+
24+
For example, you can use Apache Arrow from Ruby by Arrow GLib and
25+
[gobject-introspection gem](https://rubygems.org/gems/gobject-introspection)
26+
with the following code:
27+
28+
```ruby
29+
# Generate bindings at runtime
30+
require "gi"
31+
Arrow = GI.load("Arrow")
32+
33+
# Now, you can access arrow::BooleanArray in Arrow C++ by
34+
# Arrow::BooleanArray
35+
p Arrow::BooleanArray
36+
```
37+
38+
In Ruby case, you should use
39+
[red-arrow gem](https://rubygems.org/gems/red-arrow). It's based on
40+
gobject-introspection gem. It adds many convenient features to raw
41+
gobject-introspection gem based bindings.
42+
43+
## Install
44+
45+
### Package
46+
47+
TODO
48+
49+
### Build
50+
51+
You need to install Arrow C++ before you install Arrow GLib. See Arrow
52+
C++ document about how to install Arrow C++.
53+
54+
You need [GTK-Doc](https://www.gtk.org/gtk-doc/) and
55+
[GObject Introspection](https://wiki.gnome.org/action/show/Projects/GObjectIntrospection)
56+
to build Arrow GLib. You can install them by the followings:
57+
58+
On Debian GNU/Linux or Ubuntu:
59+
60+
```text
61+
% sudo apt install -y -V gtk-doc-tools libgirepository1.0-dev
62+
```
63+
64+
On CentOS 7 or later:
65+
66+
```text
67+
% sudo yum install -y gtk-doc gobject-introspection-devel
68+
```
69+
70+
On macOS with [Homebrew](https://brew.sh/):
71+
72+
```text
73+
% brew install -y gtk-doc gobject-introspection
74+
```
75+
76+
Now, you can build Arrow GLib:
77+
78+
```text
79+
% cd glib
80+
% ./configure --enable-gtk-doc
81+
% make
82+
% sudo make install
83+
```
84+
85+
## Usage
86+
87+
You can use Arrow GLib with C or other languages. If you use Arrow
88+
GLib with C, you use C API. If you use Arrow GLib with other
89+
languages, you use GObject Introspection based bindings.
90+
91+
### C
92+
93+
You can find API reference in the
94+
`/usr/local/share/gtk-doc/html/arrow-glib/` directory. If you specify
95+
`--prefix` to `configure`, the directory will be different.
96+
97+
You can find example codes in the `example/` directory.
98+
99+
### Language bindings
100+
101+
You can use Arrow GLib with non C languages with GObject Introspection
102+
based bindings. Here are languages that support GObject Introspection:
103+
104+
* Ruby: [red-arrow gem](https://rubygems.org/gems/red-arrow) should be used.
105+
106+
* Python: [PyGObject](https://wiki.gnome.org/Projects/PyGObject) should be used. (Note that you should use PyArrow than Arrow GLib.)
107+
108+
* Lua: [LGI](https://github.com/pavouk/lgi) should be used.
109+
110+
* Go: [Go-gir-generator](https://github.com/linuxdeepin/go-gir-generator) should be used.
111+
112+
See also
113+
[Projects/GObjectIntrospection/Users - GNOME Wiki!](https://wiki.gnome.org/Projects/GObjectIntrospection/Users)
114+
for other languages.

0 commit comments

Comments
 (0)