-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmeta.yaml
208 lines (192 loc) · 7.43 KB
/
meta.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# keep this without major version to let the bot pick it up
{% set version = "28.3" %}
# protobuf doesn't add the major version in the tag, it's defined per language in
# https://github.com/protocolbuffers/protobuf/blob/main/version.json
{% set major = "5" %}
# pkg-config metadata sets yet another version format, not using the major version
# but adding the rc number as a patch version, or 0 for regular releases
{% set pkgconfig_ver = version.split(".")[0] ~ "." ~ version.split(".")[1] %}
{% if version.split(".")[-1].startswith("rc") %}
{% set pkgconfig_ver = pkgconfig_ver ~ "." ~ version.split(".")[-1].replace("rc", "") %}
{% else %}
{% set pkgconfig_ver = pkgconfig_ver ~ "." ~ "0" %}
{% endif %}
{% set libraries = ["libprotoc", "libprotobuf", "libprotobuf-lite"] %}
package:
name: libprotobuf-split
version: {{ major ~ "." ~ version }}
source:
- url: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v{{ version.replace(".rc", "-rc") }}.tar.gz
sha256: 7c3ebd7aaedd86fa5dc479a0fda803f602caaf78d8aff7ce83b89e1b8ae7442a
patches:
- patches/0001-set-static-lib-extension-on-windows.patch
- patches/0002-always-look-for-shared-abseil-builds.patch
# grpc_cpp_java_plugin links against otherwise internal symbols
- patches/0003-Export-functions-in-google-compiler-java-names.patch
- patches/0004-do-not-install-vendored-gmock.patch
# skip annoyingly flaky test on windows, see
# https://github.com/protocolbuffers/protobuf/issues/8645
- patches/0005-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch # [win]
build:
number: 1
outputs:
- name: libprotobuf
script: build-lib.sh # [unix]
script: build-lib.bat # [win]
build:
run_exports:
# protobuf now (intentionally) increments the SOVER with every patch release, which
# breaks tools like grpc_plugin_cpp if they get the wrong libprotoc at runtime, see
# https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/4075
- {{ pin_subpackage('libprotobuf', max_pin='x.x.x') }}
ignore_run_exports_from:
- gtest
- jsoncpp
requirements:
build:
- {{ stdlib('c') }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cmake
- ninja
host:
- gtest
- jsoncpp
- libabseil
# requires abseil test targets to build with tests enabled
- libabseil-tests
- zlib
run:
- ucrt # [win]
test:
requires:
# cmake needs compiler to be able to run package detection, see
# https://discourse.cmake.org/t/questions-about-find-package-cli-msvc/6194
- {{ compiler('cxx') }}
- cmake
- ninja
- pkg-config
files:
- cmake_test/
commands:
{% for each_lib in libraries %}
# shared libraries
- test -f ${PREFIX}/lib/{{ each_lib }}.so # [linux]
- test -f ${PREFIX}/lib/{{ each_lib }}.dylib # [osx]
- if not exist %LIBRARY_BIN%\{{ each_lib }}.dll exit 1 # [win]
- if not exist %LIBRARY_LIB%\{{ each_lib }}.lib exit 1 # [win]
# absence of static libraries
- test ! -f ${PREFIX}/lib/{{ each_lib }}.a # [unix]
- if exist %LIBRARY_LIB%\{{ each_lib }}-static.lib exit 1 # [win]
{% endfor %}
# absence of upb-related includes & libraries, see
# https://github.com/protocolbuffers/protobuf/issues/12927
- test ! -d ${PREFIX}/include/upb # [unix]
- test ! -f ${PREFIX}/lib/libupb.a # [unix]
- test ! -f ${PREFIX}/lib/libupb.so # [linux]
- test ! -f ${PREFIX}/lib/libupb.dylib # [osx]
- if exist %LIBRARY_INC%\upb exit 1 # [win]
- if exist %LIBRARY_LIB%\libupb.lib exit 1 # [win]
- if exist %LIBRARY_BIN%\libupb.dll exit 1 # [win]
# cmake
- test -f ${PREFIX}/lib/cmake/protobuf/protobuf-config.cmake # [unix]
- if not exist %LIBRARY_LIB%\cmake\protobuf\protobuf-config.cmake exit 1 # [win]
# pkg-config
- pkg-config --print-errors --exact-version "{{ pkgconfig_ver }}" protobuf
- pkg-config --print-errors --exact-version "{{ pkgconfig_ver }}" protobuf-lite
# binary
- protoc --help
# more CMake integration
- cd cmake_test
- cmake -GNinja $CMAKE_ARGS . # [unix]
- cmake -GNinja %CMAKE_ARGS% . # [win]
- cmake --build .
- name: libprotobuf-static
script: build-lib.sh # [unix]
script: build-lib.bat # [win]
build:
always_include_files:
# Must overwrite the CMake metadata from shared libprotobuf
- lib/cmake/protobuf/ # [unix]
- Library/lib/cmake/protobuf/ # [win]
ignore_run_exports_from:
- jsoncpp
requirements:
build:
- {{ stdlib('c') }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cmake
- ninja
host:
- gtest
- jsoncpp
- libabseil
- libabseil-tests
- zlib
- {{ pin_subpackage('libprotobuf', exact=True) }}
run:
- {{ pin_subpackage('libprotobuf', exact=True) }}
test:
requires:
# cmake needs compiler to be able to run package detection, see
# https://discourse.cmake.org/t/questions-about-find-package-cli-msvc/6194
- {{ compiler('cxx') }}
- cmake
- ninja
- zlib
files:
- cmake_test/
commands:
{% for each_lib in libraries %}
# static libraries
- test -f ${PREFIX}/lib/{{ each_lib }}.a # [unix]
- if not exist %LIBRARY_LIB%\{{ each_lib }}-static.lib exit 1 # [win]
{% endfor %}
# more CMake integration
- cd cmake_test
- cmake -GNinja $CMAKE_ARGS . # [unix]
- cmake -GNinja %CMAKE_ARGS% . # [win]
- cmake --build .
- name: libprotobuf-python-headers
script: build-pyheaders.sh # [unix]
script: build-pyheaders.bat # [win]
requirements:
build:
- rsync # [unix]
host:
- {{ pin_subpackage('libprotobuf', exact=True) }}
run_constrained:
- libprotobuf {{ major ~ "." ~ version }}
test:
commands:
- test -f $PREFIX/include/google/protobuf/proto_api.h # [unix]
- test -f $PREFIX/include/google/protobuf/pyext/message.h # [unix]
- if not exist %LIBRARY_PREFIX%\include\google\protobuf\proto_api.h exit 1 # [win]
- if not exist %LIBRARY_PREFIX%\include\google\protobuf\pyext\message.h exit 1 # [win]
about:
home: https://developers.google.com/protocol-buffers/
license: BSD-3-Clause
license_family: BSD
license_file: LICENSE
summary: Protocol Buffers - Google's data interchange format. C++ Libraries and protoc, the protobuf compiler.
description: |
Protocol buffers are Google's language-neutral,
platform-neutral, extensible mechanism for serializing structured data-
think XML, but smaller, faster, and simpler.
dev_url: https://github.com/protocolbuffers/protobuf
doc_url: https://developers.google.com/protocol-buffers/
doc_source_url: https://github.com/protocolbuffers/protobuf/releases
extra:
recipe-maintainers:
- JohanMabille
- jjerphan
- xylar
- dopplershift
- jakirkham
- ocefpaf
- wesm
- hajapy
- xhochy
- h-vetinari
feedstock-name: libprotobuf