pantry/projects/protobuf.dev/package.yml
2024-01-22 19:02:22 -05:00

45 lines
1 KiB
YAML

distributable:
url: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v{{version.raw}}.tar.gz
strip-components: 1
versions:
github: protocolbuffers/protobuf
dependencies:
zlib.net: ^1
abseil.io: '>=20230800<20230900' # FIXME: how? it links to e.g. libabsl_bad_any_cast_impl.so.2308.0.0
build:
dependencies:
cmake.org: ^3
working-directory: build
script: |
cmake .. $ARGS
make --jobs {{ hw.concurrency }} install
env:
ARGS:
- -Dprotobuf_BUILD_LIBPROTOC=ON
- -Dprotobuf_BUILD_SHARED_LIBS=ON
- -Dprotobuf_INSTALL_EXAMPLES=OFF
- -Dprotobuf_BUILD_TESTS=OFF
- -DCMAKE_INSTALL_PREFIX={{prefix}}
- -DCMAKE_BUILD_TYPE=Release
- -Dprotobuf_ABSL_PROVIDER=package
- -DCMAKE_PREFIX_PATH={{deps.abseil.io.prefix}}
provides:
- bin/protoc
test:
script: |
mv $FIXTURE test.proto
protoc test.proto --cpp_out=.
fixture: |
syntax = "proto3";
package test;
message TestCase {
string name = 4;
}
message Test {
repeated TestCase case = 1;
}