Skip to content

Commit fb51888

Browse files
authored
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]>
1 parent 0a0ee3e commit fb51888

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

cpp/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ needs_tests = get_option('tests').enabled()
7575
needs_acero = get_option('acero').enabled() or needs_dataset
7676
needs_compute = get_option('compute').enabled() or needs_acero
7777
needs_flight = get_option('flight').enabled()
78+
needs_gandiva = false
7879
needs_ipc = (get_option('ipc').enabled()
7980
or needs_tests
8081
or needs_acero
@@ -103,6 +104,7 @@ needs_brotli = get_option('brotli').enabled() or needs_fuzzing
103104
needs_bz2 = get_option('bz2').enabled()
104105
needs_lz4 = get_option('lz4').enabled()
105106
needs_snappy = get_option('snappy').enabled()
107+
needs_utf8proc = get_option('utf8proc').enabled() or needs_gandiva
106108
needs_zlib = get_option('zlib').enabled()
107109
needs_zstd = get_option('zstd').enabled()
108110
needs_utilities = get_option('utilities').enabled()

cpp/meson.options

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,14 @@ option(
134134
type: 'feature',
135135
description: 'Build the Arrow googletest unit tests',
136136
)
137-
137+
option(
138+
'utf8proc',
139+
type: 'feature',
140+
description: '''
141+
Build with support for Unicode properties using the utf8proc library;
142+
(only used if compute or gandiva is enabled)''',
143+
value: 'enabled',
144+
)
138145
option(
139146
'utilities',
140147
type: 'feature',

cpp/src/arrow/meson.build

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,12 @@ arrow_dep = declare_dependency(
502502
meson.override_dependency('arrow', arrow_dep)
503503

504504
if needs_compute
505+
arrow_compute_deps = []
506+
if needs_utf8proc
507+
utf8proc_dep = dependency('libutf8proc')
508+
arrow_compute_deps += [utf8proc_dep]
509+
endif
510+
505511
arrow_compute_lib_sources = [
506512
'compute/initialize.cc',
507513
'compute/kernels/aggregate_basic.cc',
@@ -553,15 +559,15 @@ if needs_compute
553559
arrow_compute_lib = library(
554560
'arrow-compute',
555561
sources: arrow_compute_lib_sources,
556-
dependencies: arrow_dep,
562+
dependencies: [arrow_dep, arrow_compute_deps],
557563
install: true,
558564
gnu_symbol_visibility: 'inlineshidden',
559565
cpp_shared_args: ['-DARROW_COMPUTE_EXPORTING'],
560566
)
561567
arrow_compute_dep = declare_dependency(
562568
link_with: arrow_compute_lib,
563569
include_directories: include_dir,
564-
dependencies: arrow_dep,
570+
dependencies: [arrow_dep, arrow_compute_deps],
565571
)
566572
meson.override_dependency('arrow-compute', arrow_compute_dep)
567573
else

cpp/src/arrow/util/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ conf_data.set('ARROW_WITH_OPENTELEMETRY', false)
7070
conf_data.set('ARROW_WITH_RE2', false)
7171
conf_data.set('ARROW_WITH_SNAPPY', needs_snappy)
7272
conf_data.set('ARROW_WITH_UCX', false)
73-
conf_data.set('ARROW_WITH_UTF8PROC', false)
73+
conf_data.set('ARROW_WITH_UTF8PROC', needs_utf8proc)
7474
conf_data.set('ARROW_WITH_ZLIB', needs_zlib)
7575
conf_data.set('ARROW_WITH_ZSTD', needs_zstd)
7676
conf_data.set('PARQUET_REQUIRE_ENCRYPTION', needs_parquet_encryption)

cpp/subprojects/utf8proc.wrap

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
[wrap-file]
19+
directory = utf8proc-2.10.0
20+
source_url = https://github.com/JuliaStrings/utf8proc/releases/download/v2.10.0/utf8proc-2.10.0.tar.gz
21+
source_filename = utf8proc-2.10.0.tar.gz
22+
source_hash = 276a37dc4d1dd24d7896826a579f4439d1e5fe33603add786bb083cab802e23e
23+
patch_filename = utf8proc_2.10.0-1_patch.zip
24+
patch_url = https://wrapdb.mesonbuild.com/v2/utf8proc_2.10.0-1/get_patch
25+
patch_hash = be16c4514603e922f9636045699fe1a6f844d340b9b7c14b809e47253b06a844
26+
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/utf8proc_2.10.0-1/utf8proc-2.10.0.tar.gz
27+
wrapdb_version = 2.10.0-1
28+
29+
[provide]
30+
libutf8proc = utf8proc_dep

0 commit comments

Comments
 (0)