Skip to content

Commit b431290

Browse files
Add Apache Avro wrap
1 parent 0b68fa9 commit b431290

File tree

5 files changed

+141
-0
lines changed

5 files changed

+141
-0
lines changed

releases.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,17 @@
208208
"0.4.1-1"
209209
]
210210
},
211+
"avro-cpp": {
212+
"dependency_names": [
213+
"avro-cpp"
214+
],
215+
"program_names": [
216+
"avrogencpp"
217+
],
218+
"versions": [
219+
"1.12.99-1"
220+
]
221+
},
211222
"backward-cpp": {
212223
"dependency_names": [
213224
"backward-cpp",

subprojects/avro-cpp.wrap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[wrap-file]
2+
directory = avro-82a2bc8b034de34626e2ab8bf091234122474d50
3+
source_url = https://github.com/apache/avro/archive/82a2bc8b034de34626e2ab8bf091234122474d50.tar.gz
4+
source_filename = arrow-82a2bc8b034de34626e2ab8bf091234122474d50.tar.gz
5+
source_hash = 1731c8aa96953caaa222ada25f8173a80d39d9ed7ffd181e62c25bf75076016d
6+
patch_directory = avro-cpp
7+
8+
[provide]
9+
program_names = avrogencpp
10+
avro-cpp = avro_dep
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
avro_flags = []
2+
avro_deps = []
3+
avro_public_deps = []
4+
5+
fmt_dep = dependency(
6+
'fmt',
7+
required: true,
8+
)
9+
avro_deps += fmt_dep
10+
avro_public_deps += fmt_dep
11+
12+
zlib_dep = dependency(
13+
'zlib',
14+
required: true,
15+
)
16+
avro_deps += zlib_dep
17+
18+
snappy_dep = dependency(
19+
'snappy',
20+
required: false,
21+
)
22+
if snappy_dep.found()
23+
avro_flags += '-DSNAPPY_CODEC_AVAILABLE'
24+
avro_deps += snappy_dep
25+
endif
26+
27+
zstd_dep = dependency(
28+
'zstd',
29+
required: false,
30+
)
31+
if zstd_dep.found()
32+
avro_flags += '-DZSTD_CODEC_AVAILABLE'
33+
avro_deps += zstd_dep
34+
endif
35+
36+
# Set static and shared flags manually since Meson 1.3.0 is still too new
37+
avro_flags += '-DAVRO_SOURCE'
38+
if get_option('default_library') == 'shared'
39+
avro_flags += '-DAVRO_DYN_LINK'
40+
elif get_option('default_library') == 'both'
41+
error('Building both static and shared libraries is not possible')
42+
endif
43+
44+
avro_inc = include_directories('include/avro')
45+
46+
avro_src = files(
47+
'impl/BinaryDecoder.cc',
48+
'impl/BinaryEncoder.cc',
49+
'impl/Compiler.cc',
50+
'impl/CustomAttributes.cc',
51+
'impl/DataFile.cc',
52+
'impl/FileStream.cc',
53+
'impl/Generic.cc',
54+
'impl/GenericDatum.cc',
55+
'impl/LogicalType.cc',
56+
'impl/Node.cc',
57+
'impl/NodeImpl.cc',
58+
'impl/Resolver.cc',
59+
'impl/ResolverSchema.cc',
60+
'impl/Schema.cc',
61+
'impl/Stream.cc',
62+
'impl/Types.cc',
63+
'impl/ValidSchema.cc',
64+
'impl/Validator.cc',
65+
'impl/Zigzag.cc',
66+
'impl/json/JsonDom.cc',
67+
'impl/json/JsonIO.cc',
68+
'impl/parsing/JsonCodec.cc',
69+
'impl/parsing/ResolvingDecoder.cc',
70+
'impl/parsing/Symbol.cc',
71+
'impl/parsing/ValidatingCodec.cc',
72+
)
73+
74+
avro_lib = library(
75+
'avrocpp',
76+
sources: avro_src,
77+
include_directories: avro_inc,
78+
cpp_args: avro_flags,
79+
dependencies: avro_deps,
80+
version: meson.project_version(),
81+
install: true,
82+
)
83+
84+
install_subdir(
85+
'include/avro',
86+
install_dir: get_option('includedir'),
87+
install_tag: 'devel',
88+
)
89+
90+
avro_dep = declare_dependency(
91+
include_directories: avro_inc,
92+
link_with: avro_lib,
93+
dependencies: avro_public_deps,
94+
)
95+
96+
if get_option('build_executable')
97+
avrogencpp_exe = executable(
98+
'avrogencpp',
99+
sources: ['impl/avrogencpp.cc'],
100+
cpp_args: ['-DAVRO_VERSION="@0@"'.format(meson.project_version())],
101+
dependencies: avro_dep,
102+
install: true,
103+
install_tag: 'devel',
104+
)
105+
meson.override_find_program('avrogencpp', avrogencpp_exe)
106+
endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
project(
2+
'avro-cpp',
3+
'cpp',
4+
version: '1.12.99',
5+
license: 'Apache-2.0',
6+
)
7+
8+
subdir('lang/c++')
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
option(
2+
'build_executable',
3+
type: 'boolean',
4+
value: true,
5+
description: 'Build avrogencpp exectuable',
6+
)

0 commit comments

Comments
 (0)