You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/09/17 22:32:22 UTC

arrow git commit: ARROW-1546: [GLib] Support GLib 2.40 again

Repository: arrow
Updated Branches:
  refs/heads/master bf73d2724 -> bfe657909


ARROW-1546: [GLib] Support GLib 2.40 again

Ubuntu 14.04 ships GLib 2.40.

Author: Kouhei Sutou <ko...@clear-code.com>

Closes #1106 from kou/glib-support-glib-2.40-again and squashes the following commits:

cbcdf9a [Kouhei Sutou] [GLib] Support GLib 2.40 again


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/bfe65790
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/bfe65790
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/bfe65790

Branch: refs/heads/master
Commit: bfe657909f5e7d96b7b8e5179baa17044b6ea375
Parents: bf73d27
Author: Kouhei Sutou <ko...@clear-code.com>
Authored: Sun Sep 17 18:32:16 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Sun Sep 17 18:32:16 2017 -0400

----------------------------------------------------------------------
 c_glib/arrow-glib/Makefile.am           |  1 +
 c_glib/arrow-glib/arrow-glib.h          |  2 +
 c_glib/arrow-glib/compute.h             | 16 ++---
 c_glib/arrow-glib/gobject-type.h        | 97 ++++++++++++++++++++++++++++
 ci/travis_before_script_c_glib.sh       |  4 --
 dev/release/verify-release-candidate.sh | 14 ----
 6 files changed, 106 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/bfe65790/c_glib/arrow-glib/Makefile.am
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/Makefile.am b/c_glib/arrow-glib/Makefile.am
index cde62cd..4c22d11 100644
--- a/c_glib/arrow-glib/Makefile.am
+++ b/c_glib/arrow-glib/Makefile.am
@@ -52,6 +52,7 @@ libarrow_glib_la_headers =			\
 	data-type.h				\
 	error.h					\
 	field.h					\
+	gobject-type.h				\
 	record-batch.h				\
 	schema.h				\
 	table.h					\

http://git-wip-us.apache.org/repos/asf/arrow/blob/bfe65790/c_glib/arrow-glib/arrow-glib.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-glib.h b/c_glib/arrow-glib/arrow-glib.h
index f15f16d..47f324d 100644
--- a/c_glib/arrow-glib/arrow-glib.h
+++ b/c_glib/arrow-glib/arrow-glib.h
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include <arrow-glib/gobject-type.h>
+
 #include <arrow-glib/array.h>
 #include <arrow-glib/array-builder.h>
 #include <arrow-glib/chunked-array.h>

http://git-wip-us.apache.org/repos/asf/arrow/blob/bfe65790/c_glib/arrow-glib/compute.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/compute.h b/c_glib/arrow-glib/compute.h
index 4b944ad..cdae579 100644
--- a/c_glib/arrow-glib/compute.h
+++ b/c_glib/arrow-glib/compute.h
@@ -19,20 +19,16 @@
 
 #pragma once
 
-#include <glib-object.h>
+#include <arrow-glib/gobject-type.h>
 
 G_BEGIN_DECLS
 
 #define GARROW_TYPE_CAST_OPTIONS (garrow_cast_options_get_type())
-G_DECLARE_DERIVABLE_TYPE(GArrowCastOptions,
-                         garrow_cast_options,
-                         GARROW,
-                         CAST_OPTIONS,
-                         GObject)
-struct _GArrowCastOptionsClass
-{
-  GObjectClass parent_class;
-};
+GARROW_DECLARE_TYPE(GArrowCastOptions,
+                    garrow_cast_options,
+                    GARROW,
+                    CAST_OPTIONS,
+                    GObject)
 
 GArrowCastOptions *garrow_cast_options_new(void);
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/bfe65790/c_glib/arrow-glib/gobject-type.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/gobject-type.h b/c_glib/arrow-glib/gobject-type.h
new file mode 100644
index 0000000..a2f8397
--- /dev/null
+++ b/c_glib/arrow-glib/gobject-type.h
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <glib-object.h>
+
+#ifdef G_DECLARE_DERIVABLE_TYPE
+#  define GARROW_DECLARE_TYPE(ObjectName,       \
+                              object_name,      \
+                              MODULE_NAME,      \
+                              OBJECT_NAME,      \
+                              ParentName)       \
+  G_DECLARE_DERIVABLE_TYPE(ObjectName,          \
+                           object_name,         \
+                           MODULE_NAME,         \
+                           OBJECT_NAME,         \
+                           ParentName)          \
+  struct _ ## ObjectName ## Class               \
+  {                                             \
+    ParentName ## Class parent_class;           \
+  };
+#else
+#  define GARROW_DECLARE_TYPE(ObjectName,                               \
+                              object_name,                              \
+                              MODULE_NAME,                              \
+                              OBJECT_NAME,                              \
+                              ParentName)                               \
+  typedef struct _ ## ObjectName ObjectName;                            \
+  typedef struct _ ## ObjectName ## Class ObjectName ## Class;          \
+                                                                        \
+  struct _ ## ObjectName                                                \
+  {                                                                     \
+    ParentName parent_instance;                                         \
+  };                                                                    \
+                                                                        \
+  struct _ ## ObjectName ## Class                                       \
+  {                                                                     \
+    ParentName ## Class parent_class;                                   \
+  };                                                                    \
+                                                                        \
+  GType object_name ## _get_type(void) G_GNUC_CONST;                    \
+                                                                        \
+  static inline ObjectName *                                            \
+  MODULE_NAME ## _ ## OBJECT_NAME(gpointer object)                      \
+  {                                                                     \
+    return G_TYPE_CHECK_INSTANCE_CAST(object,                           \
+                                      object_name ## _get_type(),       \
+                                      ObjectName);                      \
+  }                                                                     \
+                                                                        \
+  static inline ObjectName ## Class *                                   \
+  MODULE_NAME ## _ ## OBJECT_NAME ## _CLASS(gpointer klass)             \
+  {                                                                     \
+    return G_TYPE_CHECK_CLASS_CAST(klass,                               \
+                                   object_name ## _get_type(),          \
+                                   ObjectName ## Class);                \
+  }                                                                     \
+                                                                        \
+  static inline gboolean                                                \
+  MODULE_NAME ## _IS_ ## OBJECT_NAME(gpointer object)                   \
+  {                                                                     \
+    return G_TYPE_CHECK_INSTANCE_TYPE(object,                           \
+                                      object_name ## _get_type());      \
+  }                                                                     \
+                                                                        \
+  static inline gboolean                                                \
+  MODULE_NAME ## _IS_ ## OBJECT_NAME ## _CLASS(gpointer klass)          \
+  {                                                                     \
+    return G_TYPE_CHECK_CLASS_TYPE(klass,                               \
+                                   object_name ## _get_type());         \
+  }                                                                     \
+                                                                        \
+  static inline ObjectName ## Class *                                   \
+  MODULE_NAME ## _ ## ObjectName ## _GET_CLASS(gpointer object)         \
+  {                                                                     \
+    return G_TYPE_INSTANCE_GET_CLASS(object,                            \
+                                     object_name ## _get_type(),        \
+                                     ObjectName ## Class);              \
+  }
+#endif

http://git-wip-us.apache.org/repos/asf/arrow/blob/bfe65790/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 52bfe87..7100946 100755
--- a/ci/travis_before_script_c_glib.sh
+++ b/ci/travis_before_script_c_glib.sh
@@ -28,10 +28,6 @@ if [ $TRAVIS_OS_NAME == "osx" ]; then
   brew outdated || brew upgrade libtool
 
   export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig
-else
-  sudo apt-add-repository -y ppa:jonathonf/gtk3.18
-  sudo apt-get update
-  sudo apt-get install -V -y libglib2.0-dev
 fi
 
 gem install test-unit gobject-introspection

http://git-wip-us.apache.org/repos/asf/arrow/blob/bfe65790/dev/release/verify-release-candidate.sh
----------------------------------------------------------------------
diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh
index 38680f4..9ebffdb 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -151,20 +151,6 @@ test_python() {
 
 
 test_glib() {
-  # Build and test GLib, requires GLib >= 2.44 , so install that
-  # here
-  GLIB_VERSION=glib-2.53.7
-  GLIB_URL=https://gensho.ftp.acc.umu.se/pub/gnome/sources/glib/2.53/$GLIB_VERSION.tar.xz
-  curl -f -O $GLIB_URL
-  tar xf $GLIB_VERSION.tar.xz
-  pushd $GLIB_VERSION
-
-  ./configure --disable-libelf --enable-libmount=no --prefix=$ARROW_HOME
-  make -j$NPROC
-  make install
-
-  popd
-
   pushd c_glib
 
   ./configure --prefix=$ARROW_HOME