diff --git a/cpp/meson.build b/cpp/meson.build index b4fab266769..388ae4be88d 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 40828018031..1d26dabed83 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 5590ba41c91..5abe65e5d59 100644 --- a/cpp/src/arrow/meson.build +++ b/cpp/src/arrow/meson.build @@ -500,6 +500,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', @@ -551,7 +557,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'], @@ -559,7 +565,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 2fbbedbb931..cd92f167a95 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 00000000000..9b33b3beaf1 --- /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