Fil-C on Nix

Filnix wiki

mbrock/filnix

tests/protobuf.nix

Generate C++ with the Fil-C protoc and round-trip messages through the Fil-C runtime: binary, text and JSON formats, a JSON error (a heap-backed absl::Status), and a million-field message that must parse without a stack frame per field.

λpkgs, pkgsFilc, protobuf?
pkgs
pkgsFilc
protobufdefault pkgsFilc.protobuf
pkgsFilc.stdenv.mkDerivation
11name=
"filc-protobuf-${protobuf.version}-consumer-check"
12dontUnpack=
true
13nativeBuildInputs=
pkgs.pkg-config
14buildInputs=
15buildPhase=
cp ${./protobuf.proto} protobuf.proto
${protobuf}/bin/protoc --version
${protobuf}/bin/protoc --cpp_out=. protobuf.proto
$CXX -std=c++17 -O2 ${./protobuf.cpp} protobuf.pb.cc -I. \
$(pkg-config --cflags --libs protobuf) -o check
./check | tee check.log
grep -q '^ok: ' check.log
24installPhase=
touch "$out"