This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new fb51888180 GH-47833: [C++] Add utf8proc option to Meson configuration 
(#47834)
fb51888180 is described below

commit fb51888180e9b44e58d5c688ccdbc9673d52c536
Author: William Ayd <[email protected]>
AuthorDate: Wed Oct 22 01:01:54 2025 -0400

    GH-47833: [C++] Add utf8proc option to Meson configuration (#47834)
    
    ### Rationale for this change
    
    This gets us closer to feature parity with CMake, and closer to fulfilling 
all the needs of a pyarrow build
    
    ### What changes are included in this PR?
    
    Added utf8proc as an option to the Meson library
    
    ### Are these changes tested?
    
    Yes
    
    ### Are there any user-facing changes?
    
    No
    * GitHub Issue: #47833
    
    Authored-by: Will Ayd <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/meson.build                |  2 ++
 cpp/meson.options              |  9 ++++++++-
 cpp/src/arrow/meson.build      | 10 ++++++++--
 cpp/src/arrow/util/meson.build |  2 +-
 cpp/subprojects/utf8proc.wrap  | 30 ++++++++++++++++++++++++++++++
 5 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/cpp/meson.build b/cpp/meson.build
index b4fab26676..388ae4be88 100644
--- a/cpp/meson.build
+++ b/cpp/meson.build
@@ -75,6 +75,7 @@ needs_tests = get_option('tests').enabled()
 needs_acero = get_option('acero').enabled() or needs_dataset
 needs_compute = get_option('compute').enabled() or needs_acero
 needs_flight = get_option('flight').enabled()
+needs_gandiva = false
 needs_ipc = (get_option('ipc').enabled()
     or needs_tests
     or needs_acero
@@ -103,6 +104,7 @@ needs_brotli = get_option('brotli').enabled() or 
needs_fuzzing
 needs_bz2 = get_option('bz2').enabled()
 needs_lz4 = get_option('lz4').enabled()
 needs_snappy = get_option('snappy').enabled()
+needs_utf8proc = get_option('utf8proc').enabled() or needs_gandiva
 needs_zlib = get_option('zlib').enabled()
 needs_zstd = get_option('zstd').enabled()
 needs_utilities = get_option('utilities').enabled()
diff --git a/cpp/meson.options b/cpp/meson.options
index 4082801803..1d26dabed8 100644
--- a/cpp/meson.options
+++ b/cpp/meson.options
@@ -134,7 +134,14 @@ option(
     type: 'feature',
     description: 'Build the Arrow googletest unit tests',
 )
-
+option(
+    'utf8proc',
+    type: 'feature',
+    description: '''
+Build with support for Unicode properties using the utf8proc library;
+(only used if compute or gandiva is enabled)''',
+    value: 'enabled',
+)
 option(
     'utilities',
     type: 'feature',
diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build
index 5a4553cfaf..fb7a7c2830 100644
--- a/cpp/src/arrow/meson.build
+++ b/cpp/src/arrow/meson.build
@@ -502,6 +502,12 @@ arrow_dep = declare_dependency(
 meson.override_dependency('arrow', arrow_dep)
 
 if needs_compute
+    arrow_compute_deps = []
+    if needs_utf8proc
+        utf8proc_dep = dependency('libutf8proc')
+        arrow_compute_deps += [utf8proc_dep]
+    endif
+
     arrow_compute_lib_sources = [
         'compute/initialize.cc',
         'compute/kernels/aggregate_basic.cc',
@@ -553,7 +559,7 @@ if needs_compute
     arrow_compute_lib = library(
         'arrow-compute',
         sources: arrow_compute_lib_sources,
-        dependencies: arrow_dep,
+        dependencies: [arrow_dep, arrow_compute_deps],
         install: true,
         gnu_symbol_visibility: 'inlineshidden',
         cpp_shared_args: ['-DARROW_COMPUTE_EXPORTING'],
@@ -561,7 +567,7 @@ if needs_compute
     arrow_compute_dep = declare_dependency(
         link_with: arrow_compute_lib,
         include_directories: include_dir,
-        dependencies: arrow_dep,
+        dependencies: [arrow_dep, arrow_compute_deps],
     )
     meson.override_dependency('arrow-compute', arrow_compute_dep)
 else
diff --git a/cpp/src/arrow/util/meson.build b/cpp/src/arrow/util/meson.build
index 2fbbedbb93..cd92f167a9 100644
--- a/cpp/src/arrow/util/meson.build
+++ b/cpp/src/arrow/util/meson.build
@@ -70,7 +70,7 @@ conf_data.set('ARROW_WITH_OPENTELEMETRY', false)
 conf_data.set('ARROW_WITH_RE2', false)
 conf_data.set('ARROW_WITH_SNAPPY', needs_snappy)
 conf_data.set('ARROW_WITH_UCX', false)
-conf_data.set('ARROW_WITH_UTF8PROC', false)
+conf_data.set('ARROW_WITH_UTF8PROC', needs_utf8proc)
 conf_data.set('ARROW_WITH_ZLIB', needs_zlib)
 conf_data.set('ARROW_WITH_ZSTD', needs_zstd)
 conf_data.set('PARQUET_REQUIRE_ENCRYPTION', needs_parquet_encryption)
diff --git a/cpp/subprojects/utf8proc.wrap b/cpp/subprojects/utf8proc.wrap
new file mode 100644
index 0000000000..9b33b3beaf
--- /dev/null
+++ b/cpp/subprojects/utf8proc.wrap
@@ -0,0 +1,30 @@
+# 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.
+
+[wrap-file]
+directory = utf8proc-2.10.0
+source_url = 
https://github.com/JuliaStrings/utf8proc/releases/download/v2.10.0/utf8proc-2.10.0.tar.gz
+source_filename = utf8proc-2.10.0.tar.gz
+source_hash = 276a37dc4d1dd24d7896826a579f4439d1e5fe33603add786bb083cab802e23e
+patch_filename = utf8proc_2.10.0-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/utf8proc_2.10.0-1/get_patch
+patch_hash = be16c4514603e922f9636045699fe1a6f844d340b9b7c14b809e47253b06a844
+source_fallback_url = 
https://github.com/mesonbuild/wrapdb/releases/download/utf8proc_2.10.0-1/utf8proc-2.10.0.tar.gz
+wrapdb_version = 2.10.0-1
+
+[provide]
+libutf8proc = utf8proc_dep

Reply via email to